So, i have set up the IDT and interrupts, i can receive software interrupts, but when i press a key on the keyboard nothing happens, and it should display "interrupt". What am i doing wrong?
Code is on Github, in the kernelio folder. the files are irq.c irq.asm and idt.c : https://github.com/m00nd3ck/hydrogen
Thanks,
moondeck
Cant get hardware interrupts working
- moondeck
- Member
- Posts: 56
- Joined: Sat Dec 19, 2015 12:18 pm
- Libera.chat IRC: moondeck
- Location: The Zone, Chernobyl
Cant get hardware interrupts working
My operating system https://github.com/moondeck/hydrogen/
-
- Member
- Posts: 5587
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Cant get hardware interrupts working
Command 0xAA disables the keyboard (among other side effects). You have to properly initialize the keyboard controller, which includes enabling the keyboard.
You also need to empty the keyboard controller's buffer after you receive an interrupt from it, or it won't send any more interrupts.
You also need to empty the keyboard controller's buffer after you receive an interrupt from it, or it won't send any more interrupts.
Re: Cant get hardware interrupts working
https://github.com/m00nd3ck/hydrogen/bl ... /idt.c#L32
Okay, remember that in C, the name of an array is always a pointer to the base. For example:
Okay, remember that in C, the name of an array is always a pointer to the base. For example:
Code: Select all
//instead of:
idtp.base = (int) &idt;
//do this! idt is itself a pointer
idtp.base = (int) idt;