#include "mouse.h" #include "ps2_controller.h" #include #include #include void mouse_init() { int i; /* 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(0xa8, 0x64); */ /* outb(0x64, 0xd4); */ /* outb(0x60, 0xf4); */ /* printf("mouse_init: enable streaming(0xf4): %x\n", inb(0x60)); */ outb(0xd4, 0x64); outb(0xeb, 0x60); /* single packet */ printf("mouse_init: single packet 0xeb\n"); while ((inb(0x64) & 0x01) == 0) {} for (i = 0; i < 10; ++i) printf("%x ", inb(0x60)); printf("\n"); } void mouse_packet() { int i; printf("mouse packet: "); for (i = 0; i < 4; ++i) printf("%x ", ps2_read_port2()); printf("\n"); }