Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trigger Kernel Interrupt Handler: How?

enter image description hereI am trying to understand Asynchronous Interrupt handling in kernel, ofcourse through the legendary Understanding the Linux Kernel.

In this process how and who will trigger Kernel Interrupt Handler?

I would like some one to help me correcting this and to clarify my question on 1)How and Who trigger Kernel Interrupt Handler? 2)How to define new or change existing hardware interrupt handlers?

Thank you in Advance!

like image 942
Keen Learner Avatar asked Jul 22 '13 08:07

Keen Learner


People also ask

How does the kernel handle interrupts?

Interrupt handling in Linux. In Linux the interrupt handling is done in three phases: critical, immediate and deferred. In the first phase the kernel will run the generic interrupt handler that determines the interrupt number, the interrupt handler for this particular interrupt and the interrupt controller.

How interrupts are triggered?

Triggering methods Each interrupt signal input is designed to be triggered by either a logic signal level or a particular signal edge (level transition). Level-sensitive inputs continuously request processor service so long as a particular (high or low) logic level is applied to the input.

How does interrupt handler work in Linux?

An interrupt is simply a signal that the hardware can send when it wants the processor's attention. Linux handles interrupts in much the same way that it handles signals in user space. For the most part, a driver need only register a handler for its device's interrupts, and handle them properly when they arrive.

Can interrupt handler be interrupted?

However, such kernel control paths may be arbitrarily nested; an interrupt handler may be interrupted by another interrupt handler, thus giving raise to a nested execution of kernel threads.


1 Answers

Interrupt handling This picture from Robert Love's "Linux Kernel Development" pretty well describes path of interrupt. Processor interrupts the kernel in the predefined enty point do_IRQ(). If there is corresponding interrupt handler, it will get executed.

To handle interrupt, you should register your interrupt handler with request_irq().

like image 58
Alexey Shmalko Avatar answered Oct 05 '22 05:10

Alexey Shmalko