Page 1 of 1
Hardware Activated IRQs don't fire; what might I be going wr
Posted: Sun Aug 17, 2003 11:00 pm
by bowchow79
In my kernel, I turn off interrupts, remap the PIC, mask all IRQs, set up and load the IDT so the IRQs are in 0x20 and 0x28 (32-47 in decimal) as well as an extra test INT as 0x30 (48). I then test this interrupt (it simply prints "Test interrupt succesfull"), then unmask all the IRQs. Now, I'd expect that when I hit a key, interrupt 0x21 would fire, or when the system timer goes off interrupt 0x20 would as well. However, no such thing appears to happen (all these interrupts except the test one simply print that they were called, ie "INT 33 was called"). I can call all of the interrupts with inline assembly just fine, and the exception ISRs work fine (ie, divide by 0 prints "INT 00 called"). However, none of the hardware activated interrupts seem to fire. Any ideas about what could cause this? Hopefully something I said will tip off someone, but if there's anything else you need to know just ask. Thank you.
RE:Hardware Activated IRQs don't fire; what might I be going
Posted: Sun Aug 17, 2003 11:00 pm
by carbonBased
Are you exiting out of your test interrupt properly, with an EOI?
What happens if you don't call your test interrupt first... do any of the irqs fire?
That's all I can think about, offhand... unless, of course, the pic hasn't been remapped properly.
Cheers,
Jeff
RE:Hardware Activated IRQs don't fire; what might I be going
Posted: Sun Aug 17, 2003 11:00 pm
by bowchow79
It turned out I was just coding the IDRT table wrong; I was sending it a pointer to the C function for the test interrupt, rather than the assembly function that called the corresponding C function. Because of that, it didn't have an IRET when it returned control to the kernel, and hence no other IRQs could fire (due to precedence?). I don't know exactly why, but I imagine the lack of IRET was the culprit. Thanks for your help!
Though, do I still need to send an EOI to the PIC after software interrupts or exceptions? I would imagine it would only be necessary after the hardware generates the interrupt, is this the case?
RE:Hardware Activated IRQs don't fire; what might I be going
Posted: Sun Aug 17, 2003 11:00 pm
by mikeleany
You only need an EOI at the end of interrupts generated by the PIC. So no, you don't need it after software interrupts and exceptions. I think carbonBased was confused in suggesting that you put it at the end of your test interrupt, because you don't need it since it's just a software interrupt.