diff options
Diffstat (limited to 'devices/mouse.c')
-rw-r--r-- | devices/mouse.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/devices/mouse.c b/devices/mouse.c index a950e8c..a03388a 100644 --- a/devices/mouse.c +++ b/devices/mouse.c @@ -7,29 +7,33 @@ 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. + int i; - // enable second ps/2 - // outb(0xa8, 0x64); + /* 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. */ - // outb(0x64, 0xd4); - // outb(0x60, 0xf4); - // printf("mouse_init: enable streaming(0xf4): %x\n", inb(0x60)); + /* 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 + outb(0xeb, 0x60); /* single packet */ printf("mouse_init: single packet 0xeb\n"); while ((inb(0x64) & 0x01) == 0) {} - for (int i = 0; i < 10; ++i) printf("%x ", inb(0x60)); + for (i = 0; i < 10; ++i) printf("%x ", inb(0x60)); printf("\n"); } void mouse_packet() { + int i; + printf("mouse packet: "); - for (int i = 0; i < 4; ++i) printf("%x ", ps2_read_port2()); + for (i = 0; i < 4; ++i) printf("%x ", ps2_read_port2()); printf("\n"); } |