Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get keyboard input in an Homemade OS?

How to get keyboard input in an Homemade OS?

like image 444
H4cKL0rD Avatar asked Sep 02 '25 02:09

H4cKL0rD


2 Answers

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

like image 134
Kyle Lutz Avatar answered Sep 04 '25 14:09

Kyle Lutz


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.

like image 29
Gnurou Avatar answered Sep 04 '25 16:09

Gnurou