PS/2 Mouse
PS/2 Mouse
I'm trying to program the PS/2 Mouse. I readed a tutorial and I wrote my code, but it doesn't work. Then I tried to read some open source code, but they don't work. How can I program my PS/2 Mouse?
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:PS/2 Mouse
we have code that works in the "MouseInput" page of the FAQ (iirc), but if every tutorial you found so far didn't work, i fear either there's something going wrong with your setup (e.g. INTs disabled/not properly mapped) or with your hardware.
I'd suggest you grab any OS that has mouse support in the "test" forum and check it works at your place. then compare what they do with what you did and see where's the mismatch...
or you could try to be more specific on what "doesn't work", what tutorial you've been following, etc.
I'd suggest you grab any OS that has mouse support in the "test" forum and check it works at your place. then compare what they do with what you did and see where's the mismatch...
or you could try to be more specific on what "doesn't work", what tutorial you've been following, etc.
Re:PS/2 Mouse
Personally I have grabbed over more than 6 mouse drivers and all didn't work. I walked here and there. Revised all ISR routines. Till after 3 weeks I discovered by luck that the function set lights in key board driver initialization is the reason.
I don't know exactly the reason. This function is taken from Minix. But it works when mouse disabled.
I don't know exactly the reason. This function is taken from Minix. But it works when mouse disabled.
To write an OS you need 2 minds one for coding and other for debugging.
Re:PS/2 Mouse
I don't have the link of the tutorial.
However I readed the code of the ps2 mouse driver from linux 1.0 and mobius, and they don't work.
However I readed the code of the ps2 mouse driver from linux 1.0 and mobius, and they don't work.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:PS/2 Mouse
what do you mean with "don't work" ?
you see no moving cursor?
you receive nothing but garbage?
you don't even receive a single IRQ for the mouse?
And what's your kernel environment doing atm?
do you have working IDT? where did you map IRQs?
are you dev'ing in realmode or protected mode?
do you have other pieces of code that deal with keyboard controller (leds, keyboard scanning, A20 gate, whatever) which could possibly mess with the mouse stuff?
you see no moving cursor?
you receive nothing but garbage?
you don't even receive a single IRQ for the mouse?
And what's your kernel environment doing atm?
do you have working IDT? where did you map IRQs?
are you dev'ing in realmode or protected mode?
do you have other pieces of code that deal with keyboard controller (leds, keyboard scanning, A20 gate, whatever) which could possibly mess with the mouse stuff?
Re:PS/2 Mouse
And I have another question
after enabling mouse do you receive keyboard interupt.
And if no do you recieve other IRQ interupts. timer for example.
This is a nice working mouse code
http://www.mega-tokyo.com/forum/index.php?board=1;action=display;threadid=7336
after enabling mouse do you receive keyboard interupt.
And if no do you recieve other IRQ interupts. timer for example.
This is a nice working mouse code
http://www.mega-tokyo.com/forum/index.php?board=1;action=display;threadid=7336
To write an OS you need 2 minds one for coding and other for debugging.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:PS/2 Mouse
this is the "cascading" IRQ -- e.g. every interrupt above IRQ7 is delivered through IRQ2. you normally let it masked and "listen" to IRQ12 instead ... i'd say there's something wrong with your PIC programming code (either you left IRQ12 masked, or you failed to map it to the proper handler).
<Hint> see The FAQ for proper remapping code</Hint>
<Hint> see The FAQ for proper remapping code</Hint>