Keyboard

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
AnotherNewOS

Keyboard

Post by AnotherNewOS »

Hallo !

I've problems with my keyboard driver.
Here are the facts:
Sometimes, if I enter a couple of chars, the input hangs.
Then I just tried to let the finger on a key.
Somtimes it takes only some seconds, somtimes some minutes,
and the input hanges again.
On slower systems it seams to hang more earlier, on faster
more later.

I put some code in my ISR that outs an '.' on every
Keyboard-IRQ. Result: No Keyboard-IRQ is coming after the input hangs.

Then I started a kernel thread, that has a large for-loop and a
printf("%02X\n%, inb(0x60));. Result: After the input hangs, there
are scan codes in the buffer. After all scan codes are out, still
no Keyboard-IRQ's !

Any ideas ?

Greetings from Dinslaken, Germany !

Joerg
dave68

RE:Keyboard

Post by dave68 »

one thought springs to mind, are you acknowledging the interrupt usually by a line like out 0x20,0x20 or similar. It is hard to suggest anything without seeing the appropriate code segment
AnotherNewOS

RE:STI and CLI

Post by AnotherNewOS »

Finaly I found it !
It's always a good idea to stay a while at the toilete
to get a good idea !

I had a similar problem before. I had some code in an ISR that
went to the library routine (a queue). Then I recognised that this routine
had 'critical areas'. So I used CLI and STI to prevent taskswitching
at that code.....
But this guides to a nested ISR !

If your ISR don't support nested calls don't use this
in called library routines:
_asm cli;
.... do some code
_asm sti;


Do this:

_asm pushfd
_asm cli
..... do some code
_asm popfd

Greetings from the awashed germany !

Joerg
Post Reply