Page 1 of 1

kb handling is very slow

Posted: Mon Oct 18, 2004 10:56 pm
by Prabu
keyboard handling is very slow!.

"actually things will be faster in the real machine and slow
in bochs, but for me its working opposite to this principle"

in my micro kernel os,
when a keyboard int occurs a message will be sent
to the kb_driver to wake it,
then the kb_driver will read the port 0x60.

my question is, should i do any initialisation on the keyboard chip or should i change the typematic and repeat rates of
the keyboard? If i do will it work faster.

Re:kb handling is very slow

Posted: Tue Oct 19, 2004 12:12 am
by distantvoices
That's no good, man!

You should have the keyboard ISR fetch the scancode from
Keyboard immediately and stuff it into a FIFO. Just alter a
variable for the timer ISR to check. It should do the message sending - via something like "interrupt(1)", which might attach a message to the postbox of the Keyboard driver and wake it up eventually.

The keyboard isr does nothing but changing a variable from 0 to 1.

The timer isr checks this variable (which tells: scancode FIFO has input)

the keyboard driver fetches the scancodes, prcesses them and eventually sets the variable to 0 ere it goes to sleep again.

HtH & CCW