Page 1 of 1

Interrupts and PMode

Posted: Mon Aug 09, 2004 4:06 pm
by Al
Hello All,

I am having a problem(a triple fault) with enabling interrupts in protected mode after remapping the PIC and setting up the IDT. The problem does not appear to be in the code for the IDT, as the computer triple faults with the IDT in or out.

The problem occurs when I unmask an IRQ

Does anyone know what my problem is?

Al

Re:Interrupts and PMode

Posted: Mon Aug 09, 2004 4:17 pm
by Al
BTW, I am using C.

Re:Interrupts and PMode

Posted: Mon Aug 09, 2004 9:47 pm
by XStream
You may need to supply some of your code if anyone is going to be able to help you.

I would guess the problem is probably in your IRQ handler code.

Re:Interrupts and PMode

Posted: Tue Aug 10, 2004 1:39 am
by Pype.Clicker
A few rules to observe (more at the WikiFAQ)...

1. don't enable IRQs until you have a working IDT
2. make sure you loaded the proper values in the IDT (sizeof(struct IDTR)==6, base address is linear, etc.)
3. check your IDT is set up properly by calling INT nn in your code
4. provide working handlers for exceptions
5. only then you can try to toy with IRQ handlers.

Re:Interrupts and PMode

Posted: Tue Aug 10, 2004 12:59 pm
by Al
Thanks!

I did not set the _packed_ attribute; I did not even know what it meant. I finally figured it out, and it works perfectly.

Thanks again,

Al