How 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With