int old_buttons = 0; while (1) mouse_y) printf("Mouse moved: %d, %d\n", mouse_x, mouse_y); mouse_x = 0; mouse_y = 0; sleep(10);
Your main loop can now poll mouse_x , mouse_y , and mouse_buttons . Here’s a simple console debug: ps/2 compatible mouse driver
// Send EOI to PIC outb(0x20, 0x20); In real mode or protected mode, you must set up the IDT (Interrupt Descriptor Table) for IRQ12 (vector 0x2C if PIC is in standard remap). Example for 32-bit protected mode: int old_buttons = 0; while (1) mouse_y) printf("Mouse