#include "mouse.h" #include #include #include // TODO: All output to port 0x60 or 0x64 must be preceded by waiting for bit 1 (value=2) of port 0x64 to become clear. // TODO: Similarly, bytes cannot be read from port 0x60 until bit 0 (value=1) of port 0x64 is set. void mouse_init() { // Sending a command or data byte to the mouse (to port 0x60) must be preceded by sending a 0xD4 byte to port 0x64 // (with appropriate waits on port 0x64, bit 1, before sending each output byte). Note: this 0xD4 byte does not // generate any ACK, from either the keyboard or mouse. // enable second ps/2 // outb(0x64, 0xa8); // outb(0x64, 0xd4); // outb(0x60, 0xf4); // printf("mouse_init: enable streaming(0xf4): %x\n", inb(0x60)); /* outb(0x64, 0xd4); while (inb(0x64) & 0x1) ; outb(0x60, 0xf2); printf("mouse_init: mouse_id(0xf2 %x): %x\n", inb(0x60), inb(0x60)); */ }