Page 1 of 1
Cant get hardware interrupts working
Posted: Sat Apr 16, 2016 4:45 am
by moondeck
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
Re: Cant get hardware interrupts working
Posted: Sat Apr 16, 2016 5:22 am
by Octocontrabass
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.
Re: Cant get hardware interrupts working
Posted: Sun Apr 17, 2016 11:12 pm
by JoeEagar
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:
Code: Select all
//instead of:
idtp.base = (int) &idt;
//do this! idt is itself a pointer
idtp.base = (int) idt;