Cant get hardware interrupts working

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
moondeck
Member
Member
Posts: 56
Joined: Sat Dec 19, 2015 12:18 pm
Libera.chat IRC: moondeck
Location: The Zone, Chernobyl

Cant get hardware interrupts working

Post 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
Octocontrabass
Member
Member
Posts: 5587
Joined: Mon Mar 25, 2013 7:01 pm

Re: Cant get hardware interrupts working

Post 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.
JoeEagar
Posts: 6
Joined: Tue Mar 15, 2016 8:46 am
Libera.chat IRC: joeedh

Re: Cant get hardware interrupts working

Post 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;
Post Reply