views:

166

answers:

3

How to get keyboard input in an Homemade OS?

+3  A: 

Take a look at this: http://wiki.osdev.org/PS2_Keyboard.

Kyle Lutz
...now ain't that a lucky answer!
+1  A: 

Given that no further explanations are given, I'll assume a x86 platform.

You need to install a handler for the keyboard interrupt. Here is an example as a Linux module that you can probably get inspiration from: http://tldp.org/LDP/lkmpg/2.4/html/x1210.html

And also:

http://wiki.osdev.org/Interrupts

If you give more detail about your OS (architecture? real or protected mode?) we can probably give you better answers.

Gnurou
A: 

Just like the rest of your hardware, you will need to write a device driver (or modify an existing one). If your hardware is the same as for some other o/s you will probably be lucky.

Btw, it can be a good idea to have all drivers present the same interface, say a virtual serial port.

If you are really, really stuck you will have to contact the manufacturer of some devices.

Mawg