Compatible Mouse Driver — Ps/2

uint8_t data = inb(0x60);

void install_mouse_handler() set_idt_gate(0x2C, (uint32_t)mouse_isr, 0x08, 0x8E); outb(0x21, inb(0x21) & ~0x20); // Unmask IRQ12 on slave PIC outb(0xA1, inb(0xA1) & ~0x20); ps/2 compatible mouse driver

Next steps: Add absolute positioning (tablet mode), dynamic rate switching, or hook the driver into a windowing system. Happy coding! Did this article help you? Share your PS/2 driver war stories in the comments below. uint8_t data = inb(0x60)

// Set controller configuration byte outb(0x64, 0x20); // Read command byte uint8_t config = inb(0x60); config |= 0x02; // Enable mouse IRQ12 (bit 1) config &= ~0x10; // Enable standard translation (optional) outb(0x64, 0x60); // Write command byte outb(0x60, config); void install_mouse_handler() set_idt_gate(0x2C