Page 1 of 1

how can i read data from mouse?

Posted: Mon Sep 20, 2004 1:35 am
by iamxiaohan
hi, now, i think i can intial the mouse via program the 8042.
but i can read data from mouse:(
if i don't move the mouse, i can read the keyboard data from the port 0x60 .
but if i move the mouse even only one time, i can't read any data. i hit the keyboard, and the bochs reports that: the keyboard's buffer is full. but i can't read data from 0x60 now,that's very strange!
what can i do?
thank you very much!

Re:how can i read data from mouse?

Posted: Mon Sep 20, 2004 1:58 am
by Pype.Clicker
don't try to read more values from the 8042 than available (you can know it by probing the status register (0x64 iirc). The 8042 will not always have 3 bytes of mouse data ready when IRQ12 is fired, but it's guaranteed to have at least 1 byte of such data.

Also, make sure you receive and acknowledge the IRQ first (check my answer in your other post.

btw, if you can avoid posting in multiple threads for a single problem ;)

Re:how can i read data from mouse?

Posted: Mon Sep 20, 2004 5:45 am
by iamxiaohan
thank you very much! :)

Re:how can i read data from mouse?

Posted: Mon Sep 20, 2004 7:26 am
by iamxiaohan
now, i can fire the irq12 by mouse, but when i move or click the mouse, the boches will shut down :(
why?

Re:how can i read data from mouse?

Posted: Mon Sep 20, 2004 7:56 am
by Pype.Clicker
chances are that you're mishandling IRQ, then. usually, only triple-faults will restart the Bochs.

Re:how can i read data from mouse?

Posted: Mon Sep 20, 2004 8:06 am
by iamxiaohan
yes, i forget map the irq.
now it can work will!
thank you very much!!!!:)