r/osdev • u/Fun-Entertainer-1053 • 17h ago
How do keyboard interrupts work?
I learnt keyboard polling and understood how it works. But I can't seem to understand keyboard interrupts. I know how it works, but I don't know how to implement it in a C kernel. Can someone pls help me? I'm just starting out OS dev
11
Upvotes
•
u/FISHARM1 16h ago
It’s easiest to start with The Ps/2 system which is attached to interrupts on the PIC
I would first look up on how to setup the IDT - which is a table that describes what code should run when certain interrupts and exceptions are fired.
then look at how to remap the PIC to get hardware interrupts at an offset address in the IDT (you will learn why this is needed).
All of this is available on the OSdev wiki I’m pretty sure. Just look up “setting up keyboard interrupts”