Hi
I really confused about IRQ, IRQL and interrupt priorities in intel documentation and windows programming books.
1-) In Intel doc.
Interrupt No. Exception
0 Divide Error
1 DEBUG TRAP
2 NMI/NPX Error
3 Breakpoint
4 Overflow
5 BOUND/Print Screen
6 Invalid Opcode
7 NPX Not Available
8 Double Exception
9 NPX Segment Overrun
A Invalid Task State Segment (TSS)
B Segment Not Present
C Stack Fault
D General Protection
E Page Fault
F Intel Reserved
10 Floating Point
11 Alignment Check
20-31(binary) Reserved
32-255 user Defined External or INT n instruction.
But in IBM PC IRQs are:
line interrupt function
IRQ0 08 system timer
IRQ1 09 keyboard
IRQ2 0A PC/XT: EGA vertical retrace or maybe available
PC/AT: see explanation below
IRQ3 0B COM2 or maybe available
IRQ4 0C COM1
IRQ5 0D PC/XT: hard disk drive
PC/AT: LPT2 or maybe available
IRQ6 0E floppy disk drive
IRQ7 0F LPT1
IRQ8 70 PC/AT: CMOS Real Time Clock
IRQ9 71 PC/AT: see explanation below
IRQ10 72 PC/AT: probably available
IRQ11 73 PC/AT: probably available
IRQ12 74 PC/AT: probably available
PS/2: mouse
IRQ13 75 PC/AT: numeric coprocessor
IRQ14 76 PC/AT: hard disk drive
IRQ15 77 PC/AT: probably available
There is a interferes with exceptions, so we need to remap the IRQs to a different block of interrupt numbers.Between 32-255. Right?
But these interrupt numbers don’t have relationship with interrupt and exception priorities. Because Intel manual says:
Table 5-2. Priority Among Simultaneous Exceptions and Interrupts
Priority Description
1 (Highest) Hardware Reset and Machine Checks
- RESET
- Machine Check
2 Trap on Task Switch
- T flag in TSS is set
3 External Hardware Interventions
- FLUSH
- STOPCLK
- SMI
- INIT
4 Traps on the Previous Instruction
- Breakpoints
- Debug Trap Exceptions (TF flag set or data/I-O breakpoint)
5 Nonmaskable Interrupts (NMI)
6 Maskable Hardware Interrupts
7 Code Breakpoint Fault
8 Faults from Fetching Next Instruction
- Code-Segment Limit Violation
- Code Page Fault
9 Faults from Decoding the Next Instruction
- Instruction length > 15 bytes
- Invalid Opcode
- Coprocessor Not Available
10 (Lowest) Faults on Executing an Instruction
- Overflow
- Bound error
- Invalid TSS
- Segment Not Present
- Stack fault
- General Protection
- Data Page Fault
- Alignment Check
- x87 FPU Floating-point exception
- SIMD floating-point exception
But this prioty scheme doesn’t have any relationship with windows because windows uses IRQL
In one of OSR article:
"WAIT! Doesn’t IRQ == Interrupt Priority?
Not in Windows it doesn’t, even if the hardware documentation tells you differently. Depending on your configuration, you are either using a programmable interrupt controller (PIC) or an advanced programmable interrupt controller (APIC). If you have read the article on interrupts in this issue, you already know that the INTIN lines of the APIC have no implied priority, but that the IRQ lines of the PIC do have an implied priority. This would probably lead you to believe that your device’s IRQ (and therefore your PIC priority) has a direct relation to your IRQL (and thus your device’s interrupt priority). But, you’d be wrong. This is a common misconception and it’s time for everyone out there to forget it! Where, how, when, and why your device connects to a PIC makes absolutely no difference in terms of your device’s priority in Windows.
For example, say you’re running on a system with a PIC. Device X connects to IRQ3 and device Y connects to IRQ7. If Windows just let the PIC be, X’s interrupts would always take precedence over Y’s because its IRQ has a higher (hardware interrupt) priority. However, Windows does not use the implied hardware interrupt priorities in the PIC to prioritize its interrupts. So, it could very well be that IRQ7 has an higher IRQL than IRQ3 on your system.
On Windows, the IRQ of your device never dictates the associated level of urgency of your device’s interrupt. Period. Full stop. And this is true whether you’re running on a system with a PIC or you’re on a system with an APIC. What can you do to influence this? Well, really, nothing (short of writing your own HAL, and don’t even try to go there, my friend). It’s just the way Windows works."
1-) Must i omit Intel manuals interrupt priority schema? If OS designers will/must use another priority schema. Why does intel give priority scheme?
2-) I really confused about IRQLs, IRQs and exceptions. What is the IRQLs of exceptions(Interupt No:0-31) in windows?
If there is an exception(for example: Overflow) occurs with IRQL=high, can this interrupt Maskable Hardware Interrupts? Although Table 5-2(above) Maskable Hardware Interrupts priority is higher than overflow…
4-) Is there a documented interrupt priority table for windows? (like intel’s table 5-2)
3-) I am reading Windows internals and Understanding IRQL article. Do you have any advice me to read something else to understand this?
I will be very glad, if you help me to find answers…
Thanks…