Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Can any one tell me how to handle interrupts at low level in linux kernel.
what do you mean by this?
If you need a lowest level than the one provided by linux kernel mechanism, so don't use linux kernel, try a "stand alone" application. When A. Rubini says that "The lowest level of interrupt handling can be found in entry.S", you have to understand that is where the linux kernel connect with hardware interrupts. But right after that, the interrupts is "caught" by the kernel and the only good way to use it is through the "request_irq" mechanism. Maybe, if your a "place your arch here" guru, and you're well aware of the linux interrupts handling mechanism, you can modify the entry.S to fit a latence requirement for a specific IRQ... But IMHO it's the wrong way: I think it's far better to try a RT OS, or a 'stand alone' application (I mean an application which doesn't need facility given by a complex system like linux)
All hardware interrupts can call one or more "bottom-half handlers." These handlers generally check to see if "their" device is the one responsible for the interrupt, and if so, they schedule a "top-half routine" to do the meat-and-potatoes work. Any number of handlers can be called.
The exact mechanisms for doing this have changed over time, but the essential idea is the same: the hardware-triggered response is short and sweet, and it schedules the "real consequences" to take place a very short time later.
If you trace this logic from this foundation up to routines like do_IRQ(), you'll see that the interrupt handler code attempts to spend the least possible amount of time in a hardware-interrupt context. It wants to gather whatever status-information is to be found on the hardware-device latches, and then "get the hell out of there."
The usual response is to pre-empt the current task on this CPU, having scheduled the top-half interrupt handling routine to run. The time between this "bottom-half" response and the "top-half" response is called interrupt latency. Unlike a "real-time operating system (RTOS)," Linux does not guarantee latency-time.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.