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