IRQ Priority?

ucGrad

Member
May 3, 2004
91
0
0
Its been a while since I've thought of anything related to this topic. I remember that there are 0-15 IRQ addresses each assigned to a piece of hardware (keyboard, system timer, Primary IDE, Secondary IDE, etc..). Question is, if two devices request an interrupt at the same time, which gets priority?

Thanks in advance!
 

VirtualLarry

No Lifer
Aug 25, 2001
56,571
10,206
126
Yes, IRQs can be, and usually are, prioritized. There are several schemes, fixed, rotating, etc. I think that when they are operating in 8259-compatible mode, they are generally fixed in priorities, lower numbers having higher priorities. Not sure about when running in APIC mode.
 

Ryoga

Senior member
Jun 6, 2004
449
0
0
IRQ priority is as follows:
0 (highest priority)
1
2*
8
9*
10
11
12
13
14
15
3
4
5
6
7 (lowest priority)

IRQ 2 cascades to 8-15, with IRQ 9 acting as IRQ 2.
 

ucGrad

Member
May 3, 2004
91
0
0
Originally posted by: Ryoga
IRQ priority is as follows:
0 (highest priority)
1
2*
8
9*
10
11
12
13
14
15
3
4
5
6
7 (lowest priority)

IRQ 2 cascades to 8-15, with IRQ 9 acting as IRQ 2.

Interesting. I'm assuming this is because there are two IRQ controllers? Also, does this ordering hold true for every PC regardless of the OS (Windows, Linux, etc)?

thanks again!
 

Ryoga

Senior member
Jun 6, 2004
449
0
0
IRQ priority is processor/chipset dependant. All Intel PCs will use this system. Prior to the 8-bit to 16-bit change between the 8086 and 80286, there was just one IRQ controller with priorities 0 to 7. With the i286 Intel extended the number of IRQ channels available to 16 by, yes, adding a second controller. To older 8-bit devices, IRQ 9 appears as IRQ 2.

Newer OS employ IRQ steering, which (like NDIS does for network protocols) allows the system to dynamically assign multiple PCI devices to the same ISA IRQ (PCI also has it's own interrupts for the PCI controller, but that is for PCI-level bus mastering and they can be shared; PCI steering is pretty much invisible on Win2k/XP). That's why you'll generally see every PCI device in your system on either IRQ 11 or IRQ 9 on the boot summary screen, although they usually show up on some kind of virtual IRQ number higher than 15 in Windows itself. If you go Start --> Run --> "msinfo32" and then browse to /Hardware Resources/IRQs/, you can see where Windows has assigned everything. IRQ 9 will show up as "ACPI", one of the components for PNP, and all your PCI and AGP devices will have IRQs over 15.

I have no idea how SPARCs or PPCs work with interrupts, but I assume there's some form of it present.