PS2 Keyboard Numlock problems
Posted: Tue Aug 11, 2009 12:53 pm
Hello,
I am having a problem implementing a PS2 Keyboard driver. I have read the wiki, related links and searched google but I cant find any relevent information so I was wondering if someone here has had similar experiences and might be able to help.
A quick background (not revelvent to the specific problem but included because this isnt a typical OS Dev project):
I have an internship in which we (3 of us) are building a SMP type supercomputer from 36 Altera DE2 boards. We have a NIOS core running a small C program, with a custom written PS2 interface on an Avalon Memory Mapped slave. The custom PS2 interface is written in System Verilog and does little more than "speak the PS2 line protocol". It deals with parity checking, resends when needed and resetting the keyboard (command 0xFF) on a full system reset.
The problem I am having is with translating the scancodes that the keyboard generates. (I am using http://www.computer-engineering.org/ps2 ... odes2.html as a reference)
The problem is with using number lock.
When pressing the NumLock key, the make and break codes for the set of keys including Insert, Home, Page Up, Page Down, Delete, End and Page Down.
After a keyboard reset, the scancodes are as listed on the reference. However, after pressing Numlock once, those keys (and possibly others but I done exhaustive testing yet) change their scancodes to have a 4 byte make code (e0, first byte, e0, second byte) and a 6 byte break code (e0, f0, second byte, e0, f0, first byte).
Subsiquent presses of the NumLock key switch the behaviour between those two modes.
Does anyone have any idea why this is happening?
Thanks in advance,
~Andrew
I am having a problem implementing a PS2 Keyboard driver. I have read the wiki, related links and searched google but I cant find any relevent information so I was wondering if someone here has had similar experiences and might be able to help.
A quick background (not revelvent to the specific problem but included because this isnt a typical OS Dev project):
I have an internship in which we (3 of us) are building a SMP type supercomputer from 36 Altera DE2 boards. We have a NIOS core running a small C program, with a custom written PS2 interface on an Avalon Memory Mapped slave. The custom PS2 interface is written in System Verilog and does little more than "speak the PS2 line protocol". It deals with parity checking, resends when needed and resetting the keyboard (command 0xFF) on a full system reset.
The problem I am having is with translating the scancodes that the keyboard generates. (I am using http://www.computer-engineering.org/ps2 ... odes2.html as a reference)
The problem is with using number lock.
When pressing the NumLock key, the make and break codes for the set of keys including Insert, Home, Page Up, Page Down, Delete, End and Page Down.
After a keyboard reset, the scancodes are as listed on the reference. However, after pressing Numlock once, those keys (and possibly others but I done exhaustive testing yet) change their scancodes to have a 4 byte make code (e0, first byte, e0, second byte) and a 6 byte break code (e0, f0, second byte, e0, f0, first byte).
Subsiquent presses of the NumLock key switch the behaviour between those two modes.
Does anyone have any idea why this is happening?
Thanks in advance,
~Andrew