ps/2 mouse problems
Posted: Sat Nov 10, 2007 8:49 am
Hello,
I'm trying to get ps/2 mouse to work.
I've tried all sorts of things, but here's a simple case that doesn't work:
If I then do this:
The above line operates correctly, and ack is received from the mouse, but it doesn't have the desired effect. My mouse interrupt is not getting called, and the keyboard interrupt also stops getting called (the keyboard previously worked) It seems like sending any commands to the mouse (with 0xD4) stops the keyboard from sending any keyboard interrupts (in addition to not making the mouse work).
(I also tried disabling mouse data reporting with:
but it didn't reenable the keyboard
Does anybody have any idea of what I might try next ?
thanks,
--
Sigurd Lerstad
I'm trying to get ps/2 mouse to work.
I've tried all sorts of things, but here's a simple case that doesn't work:
Code: Select all
void wait_for_input()
{
for(;;)
{
if ((inb(0x64) & 2) == 0)
break;
}
}
void wait_for_output()
{
for(;;)
{
if (inb(0x64) & 1)
break;
}
}
void write_mouse_ack(byte data)
{
for (;;)
{
wait_for_input();
outb(0x64, 0xD4); // Write to mouse
wait_for_input();
outb(0x60, data);
wait_for_output();
byte scancode = inb(0x60);
if (scancode == 0xFA)
{
return;
}
printstr("no ack\n");
}
}
Code: Select all
write_mouse_ack(0xF4); // Enable data reporting
// I know I also might set the control byte to enable mouse and irq, but it is already set correctly
// I have also installed isr for keyboard and mouse
(I also tried disabling mouse data reporting with:
Code: Select all
write_mouse_ack(0xF5)
Does anybody have any idea of what I might try next ?
thanks,
--
Sigurd Lerstad