PS-2 Mouse Interfacing
Posted: Sat Feb 10, 2007 2:02 am
I am trying to interface with a PS-2 mouse device in this test OS and I was wondering if what I am doing is correct. I would appreciate it if somebody could confirm this:
1. I send command 0x20 to the On-board Keyboard controller at port 0x64.
2. Read the Keyboard controller command byte at port 0x60.
3. Enable Bit#1 in the command byte to enable the PS-2 mouse.
4. I sent command 0x60 to the On-board keyboard controller at port 0x64.
5. I then send the modified byte at the 3rd step to port 0x60 to enable the PS-2 mouse.
6. Send the command 0xF5 to port 0x60 to disable mouse’s streaming mode.
7. I then send the command 0xFF to port 0x60 to reset the mouse.
8. Send the command 0xEA to port 0x60 to enable Streaming Mode.
9. Send the command 0xE9 to port 0x60 to ask the mouse to reports its 3-byte status.
The problem is that the mouse seems to be replying with proper acknowledge messages but the status byte reported at the 9th step returns 3 acknowledge bytes (0xFA). Can anybody help me fix this, please?
1. I send command 0x20 to the On-board Keyboard controller at port 0x64.
2. Read the Keyboard controller command byte at port 0x60.
3. Enable Bit#1 in the command byte to enable the PS-2 mouse.
4. I sent command 0x60 to the On-board keyboard controller at port 0x64.
5. I then send the modified byte at the 3rd step to port 0x60 to enable the PS-2 mouse.
6. Send the command 0xF5 to port 0x60 to disable mouse’s streaming mode.
7. I then send the command 0xFF to port 0x60 to reset the mouse.
8. Send the command 0xEA to port 0x60 to enable Streaming Mode.
9. Send the command 0xE9 to port 0x60 to ask the mouse to reports its 3-byte status.
The problem is that the mouse seems to be replying with proper acknowledge messages but the status byte reported at the 9th step returns 3 acknowledge bytes (0xFA). Can anybody help me fix this, please?