Really no more interrupts until "end-of-interrupt" code?

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
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Really no more interrupts until "end-of-interrupt" code?

Post by Craze Frog »

Wiki wrote:Before the ret, this code is executed, to tell the PIC that it's OK to send any new or pending interrupts, because the current one is done. The PIC doesn't send any more interrupts until the cpu acknowledges the interrupt:
Is that really true even if sti is executed?
cyr1x
Member
Member
Posts: 207
Joined: Tue Aug 21, 2007 1:41 am
Location: Germany

Re: Really no more interrupts until "end-of-interrupt" code?

Post by cyr1x »

It is.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Really no more interrupts until "end-of-interrupt" code?

Post by 01000101 »

If you don't ACK the PIC, it will assume that you're still handling that interrupt and not allow any more interrupts for that vector.
Craze Frog
Member
Member
Posts: 368
Joined: Sun Sep 23, 2007 4:52 am

Re: Really no more interrupts until "end-of-interrupt" code?

Post by Craze Frog »

01000101 wrote:If you don't ACK the PIC, it will assume that you're still handling that interrupt and not allow any more interrupts for that vector.
Ah, so it wasn't really true. Thanks for clarifying this, someone should fix the wiki.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Really no more interrupts until "end-of-interrupt" code?

Post by 01000101 »

POC: enable IRQ 0 (PIT) and IRQ 1 (keyboard) and instead of sending an EOI after the keyboard handler, just put a sti() and a for(;;); loop... once you hit a key and IRQ 1 fires, it won't again. But the handler for IRQ 0 will still be getting interrupts even after the keyboard IRQ 1 has halted.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Really no more interrupts until "end-of-interrupt" code?

Post by Brendan »

Hi,

To be as accurate as possible:

If you don't send an EOI to the PIC, and if the PIC is in it's normal operating mode (e.g. not some strange mode, like "auto-EOI" or "rotating priority"), then you won't get any more interrupts for that IRQ or any other lower priority IRQs.

Also note, the PIC's priorities go in this order:
  • irq0 <- highest priority
    irq1
    irq8
    irq9
    irq10
    irq11
    irq12
    irq13
    irq14
    irq15
    irq3
    irq4
    irq5
    irq6
    irq7 <- lowest priority
There's also the whole "spurious IRQ" mess - IMHO spurious IRQ7 and spurious IRQ15 are higher priority than IRQ0, but you should never send an EOI for spurious IRQs.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply