summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kernel.c4
-rw-r--r--kernel/mouse.c12
2 files changed, 9 insertions, 7 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index f8b6571..419a808 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -203,10 +203,6 @@ void kernel_main(uint32_t initial_stack, int mp)
//vesa_init_doublebuff();
while(1)
{
-
- // lock_spin(0);
-// log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"x: %d y:%d",mouse_get_x(), mouse_get_y());
- // lock_release(0);
}
diff --git a/kernel/mouse.c b/kernel/mouse.c
index de1e3bf..bee595c 100644
--- a/kernel/mouse.c
+++ b/kernel/mouse.c
@@ -12,8 +12,9 @@
static volatile uint8_t mouse_cycle;
static volatile int8_t mouse_byte[3];
-static volatile int8_t mouse_x;
-static volatile int8_t mouse_y;
+static volatile uint8_t mouse_x;
+static volatile uint8_t mouse_y;
+static volatile uint8_t mouse_a;
uint8_t mouse_read();
@@ -59,6 +60,10 @@ void mouse_init()
}
+void mouse_log()
+{
+ log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"%d delta x: %d delta y: %d ",mouse_a, mouse_x,mouse_y);
+}
//Mouse functions
void mouse_handler()//struct regs *a_r) //struct regs *a_r (not used but just there)
{
@@ -76,14 +81,15 @@ void mouse_handler()//struct regs *a_r) //struct regs *a_r (not used but just th
break;
case 2:
mouse_byte[2]=x86_inb(0x60);
+ mouse_a=mouse_byte[0];
mouse_x=mouse_byte[1];
mouse_y=mouse_byte[2];
mouse_cycle=0;
+ mouse_log();
break;
}
- //log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"irq12");
X86_IRQ_END
}