Page 1 of 1

Question about a real keyboard on 8042

Posted: Wed Jul 10, 2013 9:00 am
by doxrobot
For some reason this dosen't happen in bochs, but on my real machine when you hold down a key without letting it up, the 8042 controller will keep firing interrupts. This is normal behavior correct?

I just want my interface to be as if when the user holds down a key, it will continue to print the key, but in bochs when the user holds a key, it will only print once until the key is released.

Maybe I need to update bochs. What is normal behavior?

Re: Question about a real keyboard on 8042

Posted: Wed Jul 10, 2013 2:21 pm
by Casm
By default Bochs should fire an interrupt every 250ms, unless you have accidentally changed it.

Re: Question about a real keyboard on 8042

Posted: Thu Jul 11, 2013 1:04 am
by sounds
The "typematic rate" and "typematic delay" are set in the keyboard itself, in the controller chip. Not the 8042 controller in the system.

If I hold down A, I should receive the following:

A pressed (IRQ fires)
(typematic delay)
A pressed (IRQ fires)
(typematic rate)
A pressed (IRQ fires)
(typematic rate)
A pressed (IRQ fires)
...

Only when I release A, I should get:
A released (IRQ fires)

Bochs should also show that.

Setting the rate & delay involves sending bytes to the keyboard controller.