Page 1 of 1

Ketboard driver and buffer

Posted: Sun Jan 05, 2003 10:59 am
by Unexpected
[attachment deleted by admin]

Re:Ketboard driver and buffer

Posted: Sun Jan 05, 2003 11:22 am
by jrfritz
You need a asm stub that pusha's and calles the C code.

Re:Ketboard driver and buffer

Posted: Sun Jan 05, 2003 2:38 pm
by Unexpected
My handler looks like this:

Code: Select all

_IRQ1_Handler:
     CLI
     PUSHA
     PUSHF
     CALL _KBD_Handler
     POPF
     POPA
     STI
IRET
And here is another problem:
When pressing a key, OS prints all keys correctly but shift is not working.
Maby errors with buffer?
Loss...

Re:Ketboard driver and buffer

Posted: Sun Jan 05, 2003 3:48 pm
by jrfritz
I'm about to enter your situation...but I need to bet my kernel loaded at 1 meg....

Then we'll work together on this problem ( I have it too )...

Re:Ketboard driver and buffer

Posted: Sun Jan 05, 2003 5:31 pm
by df
scancodes dont change for shifted keys. you neede to track shift+capslock yourself and make them uppercase, or numlock numbers/arrows, etc.

Re:Ketboard driver and buffer

Posted: Mon Jan 06, 2003 5:17 am
by Unexpected
Ok Tom! ;)
df:
If there something wrong?

Code: Select all

     if (KBD_Shift = false && CapsLock == true) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = false && CapsLock == false) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];

     if (KBD_Shift = true && CapsLock == false) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = true && CapsLock == true) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];

Re:Ketboard driver and buffer

Posted: Mon Jan 06, 2003 9:40 am
by Pype.Clicker
so, basically

Code: Select all

if (shift == caps) keyAscii = KbdAsciiKeyNS[scancode];
else keyAscii=KbdAsciiKeyS[scancode];

Re:Ketboard driver and buffer

Posted: Mon Jan 06, 2003 11:27 am
by Unexpected
Thanx Pype.Clicker for optimization ;)
I forgot to do keybourd overflow protection :) And write = not == :)
Now is only one trouble, printing key two times. But I think it will be ease to correct.
Thnx you all!

Re:Ketboard driver and buffer

Posted: Mon Jan 06, 2003 1:02 pm
by df
Unexpected wrote: Ok Tom! ;)
df:
If there something wrong?

Code: Select all

     if (KBD_Shift = false && CapsLock == true) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = false && CapsLock == false) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];

     if (KBD_Shift = true && CapsLock == false) KeyASCII = KBD_ASCII_KEY_S[ScanCode];
     if (KBD_Shift = true && CapsLock == true) KeyASCII = KBD_ASCII_KEY_NS[ScanCode];
kbd_shift ==... your setting value not comparing.

Re:Ketboard driver and buffer

Posted: Mon Jan 06, 2003 2:58 pm
by Unexpected
Now corrected all bugs!
All works!
It was 3 bugs:
1) I write = not == (just typo)
2) Forgot buffer overflow
3) When key released KB_Hit must be 0 not 1
Thanx you all again!