Page 1 of 1

Keyboard Driver

Posted: Fri Feb 23, 2001 12:00 am
by Collin
Hello,
I need to find a keyboard driver for my OS. Does anyone
know where I could find some source code?

Collin

RE:Keyboard Driver

Posted: Fri Feb 23, 2001 12:00 am
by Crg^
>On 2001-02-23 12:58:09, Collin wrote:
>Hello,
>I need to find a keyboard driver for my OS. Does anyone
>know where I could find some source code?
>
>Collin
It`s quite simple, after the IRQ occurs you have to get a
scancode from port 60h and then send to port 20h value 20h
to tell the controler that the IRQ was dispatched.
so the code could look like:

mov dx,60h
in dx,al
mov bl,al
mov al,20h
mov dx,20h
out dx,al
;; bl -> scancode

another story comes when you want to change scancode to a
ascii character:) anyone have any table about it ?

RE:Keyboard Driver

Posted: Fri Feb 23, 2001 12:00 am
by Guest
>On 2001-02-23 13:22:44, Crg^ wrote:
>>On 2001-02-23 12:58:09, Collin wrote:
>>Hello,
>>I need to find a keyboard driver for my OS. Does
anyone
>>know where I could find some source code?
>>
>>Collin
>It`s quite simple, after the IRQ occurs you have to get
a
>scancode from port 60h and then send to port 20h value
20h
>to tell the controler that the IRQ was dispatched.
>so the code could look like:
>
>mov dx,60h
>in dx,al
>mov bl,al
>mov al,20h
>mov dx,20h
>out dx,al
>;; bl -> scancode
>
>another story comes when you want to change scancode to
a
>ascii character:) anyone have any table about it ?

Thanks. This will help alot.

Collin

RE:Keyboard Driver

Posted: Sat Feb 24, 2001 12:00 am
by Chris Giese
>On 2001-02-23 13:22:44, Crg^ wrote:
>>On 2001-02-23 12:58:09, Collin wrote:
>>Hello,
>>I need to find a keyboard driver for my OS. Does
anyone
>>know where I could find some source code?
>>
>>Collin
>It`s quite simple, after the IRQ occurs you have to get
a
>scancode from port 60h and then send to port 20h value
20h
>to tell the controler that the IRQ was dispatched.
>so the code could look like:
>
>mov dx,60h
>in dx,al
>mov bl,al
>mov al,20h
>mov dx,20h
>out dx,al
>;; bl -> scancode

That's a good start. Write a program to take
over IRQ 1, read bytes from port 60h, and
print them in hex.

You should not use printf() in an interrupt
handler, so use a queue or global variable to
pass the port 60h values to main()

Then, you can switch the keyboard controller
(8042 chip) into different modes: scancode
sets 1, 2, and 3; set-2-to-set-1 translation
or or off. See what difference it makes.

Or, just read all this crap:

http://www.execpc.com/~geezer/os/kbd.txt
http://www.execpc.com/~geezer/os/kbd.c
http://www.execpc.com/~geezer/osd/kbd/index.htm

RE:Keyboard Driver

Posted: Sat Feb 24, 2001 12:00 am
by Guest
>On 2001-02-24 04:05:42, Chris Giese wrote:
>>On 2001-02-23 13:22:44, Crg^ wrote:
>>>On 2001-02-23 12:58:09, Collin wrote:
>>>Hello,
>>>I need to find a keyboard driver for my OS.
Does
>anyone
>>>know where I could find some source code?
>>>
>>>Collin
>>It`s quite simple, after the IRQ occurs you have to
get
>a
>>scancode from port 60h and then send to port 20h
value
>20h
>>to tell the controler that the IRQ was dispatched.
>>so the code could look like:
>>
>>mov dx,60h
>>in dx,al
>>mov bl,al
>>mov al,20h
>>mov dx,20h
>>out dx,al
>>;; bl -> scancode
>
>That's a good start. Write a program to take
>over IRQ 1, read bytes from port 60h, and
>print them in hex.
>
>You should not use printf() in an interrupt
>handler, so use a queue or global variable to
>pass the port 60h values to main()
>
>Then, you can switch the keyboard controller
>(8042 chip) into different modes: scancode
>sets 1, 2, and 3; set-2-to-set-1 translation
>or or off. See what difference it makes.
>
>Or, just read all this crap:
>
>http://www.execpc.com/~geezer/os/kbd.txt
>http://www.execpc.com/~geezer/os/kbd.c
>http://www.execpc.com/~geezer/osd/kbd/index.htm

Hehheheh, hey Geeze, here's [email protected] ;]
Anyone have a table to convert scancode-> ascii?

RE:Keyboard Driver

Posted: Sun Feb 25, 2001 12:00 am
by Chase
>On 2001-02-24 04:57:54, Anonymous wrote:

>Anyone have a table to convert scancode-> ascii?

Lots of keyboard info here
http://www.arne.si/~mauricio/Kbdfaq.htm

reply

Posted: Wed Feb 13, 2008 5:00 am
by houbOS1
All the links to keyboard info & tables are broken, or did not work for me. So here's another one for scancodes : http://www.glue.umd.edu/~NSW/ench250/scancode.htm#Key3

Posted: Wed Feb 13, 2008 5:11 am
by JamesM
Oh well bumped, knobarse. Do you really think that those people posting in 2001 really need the information now?!

Posted: Wed Feb 13, 2008 5:43 pm
by Ready4Dis
JamesM wrote:Oh well bumped, knobarse. Do you really think that those people posting in 2001 really need the information now?!
Probably not, but it proves he searched, and anybody using search (which everybody should be using before posting) that finds this link will now have a valid link to find the information since all the olds ones have dissappeared, meaning they don't have to create another post asking the same question ;).