开发者

How to get keyboard input in an Homemade OS?

开发者 https://www.devze.com 2022-12-19 23:49 出处:网络
Ho开发者_运维技巧w to get keyboard input in an Homemade OS?Take a look at this: http://wiki.osdev.org/PS2_Keyboard.Given that no further explanations are given, I\'ll assume a x86 platform.

Ho开发者_运维技巧w to get keyboard input in an Homemade OS?


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


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消