The concept is very simple, the details are hairy. I’m giving you a simple-minded version of it, some of the people in this list may object to some of it, but hey, works for me!
You basically have two IRQ spaces: interrupt and non-interrupt. You’re more often than not in what’s called “Passive” level, which means, you’re not in an interrupt routine, and hence, much of the kernel-side Operating System API is available to you. When a task is running at Passive Level it is preemptable according to the rules of the OS, and so on.
When an interrupt occurs, you’re in an “Interrupt” level, and you’re now in Interrupt Space. The IRQ levels are assigned in a kind of a hierarchical base, and the rule is that a peripheral’s Interrupt Service Routine can only be preempted by another higher-priority interrupt, meaning that the interrupting source (or peripheral) has a higher IRQ Level than the Level your ISR is currently running. So, “important” peripherals have a higher IRQ Level and they can interrupt “less important” peripherals whose ISRs run at lower IRQ Level.
Note that once you leave passive level, the normal rules of thread and process switching no longer apply. Windows has a couple of what I call “intermediate” levels, between Passive and Interrupt levels, the APC (Asynchronous Procedure Call) and DPC (Dispatch) levels. These are reserved for drivers and other OS functionality that must run without OS preemption but that aren’t as important as an interrupt service routine.
Now, you will understand that if you’re in an Interrupt IRQ Level, it may be the case that not all the OS’s API is available to you. Many OS kernel-side calls are not allowed if you’re running at an Interrupt IRQ Level. The issue with the memory pools is that you do not want to have a page fault to happen inside an Interrupt Service Routine, or maybe even at APC or DPC level: hence, you may not want to use non-paged pool memory when you’re at an Interrupt IRQ Level, because if that memory is paged out you will get a page fault interrupt and that throws a monkey wrench in the workings of the OS!
Now, this idea is as old as computing, and in the past IRQ Levels were handled almost one hundred per cent by the hardware. With Windows the design has spilled into the software, and you must be aware of it, specially when it comes to what kind of memory you’re using and what API calls you make to the OS. And as I said, there’s a wealth of detail behind this, so, take a look at Russinovitch and Solomon’s book, or read the DDK documentation carefully if you need more information.
Hope this helps,
Alberto.
----- Original Message -----
From: Harsha Inamdar
To: Windows System Software Devs Interest List
Sent: Tuesday, December 13, 2005 9:56 PM
Subject: [ntdev] IRQ Levels in windows OS
Hi All,
I have a question about IRQ Levels in windows. Why windows need them? Also I would like to learn fundamentals of it.
Also I want to learn how is it related to paged pool memory & non paged pool memory.
Any suggestions?
Thanks,
Harsha
Yahoo! Shopping
Find Great Deals on Holiday Gifts at Yahoo! Shopping — Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256 You are currently subscribed to ntdev as: xxxxx@ieee.org To unsubscribe send a blank email to xxxxx@lists.osr.com