Upload
avadcs
View
217
Download
0
Embed Size (px)
Citation preview
7/29/2019 Interrupt Handlers
1/2
Interrupt Handlers
1. What is an interrupt?a. Interrupt is a signal triggered by hardware that is expecting kernel attention. It is
asynchronous to processor clock.
2. What is polling?a. Polling is a mechanism where a process keeps constantly checking the status of
another process or device.
3. What is an exception?a. Exceptions are interrupts that occurs synchronously with respect to processor clock.
They are also called soft interrupts.
4. What is IRQ line?a. Different devices are associated with unique number called interrupt Request (IRQ)line that is associated with each interrupt.
i. IRQ 0 is associated with timerii. IRQ 1 is associated with key board interrupt
iii. Interrupts associated with PCI bus are dynamically assigned.5. What is an interrupt handler?
a. The function that kernel runs in response to a specific interrupt is called an interrupthandler or interrupt service routine (ISR)
6. How an interrupt is handled?a. Interrupt is handled using an interrupt handler.
7. In linux kernel where do interrupt handlers are listed?a. Interrupts are registered in kernel using int request_irq ()
8. Are interrupt handlers reentrant?a. No, when an interrupt handler is executing, the corresponding IRQ line on all other
processors is masked out. Normally all other interrupts are enabled. It means that
interrupt handler on same IRQ line is never invoked to service a nested interrupt.
9. What is an interrupt context?a. It is the context of interrupt handler for which kernel is executing in response to
interrupt.
10.Can Interrupt hander be put to sleep? Why?a. Interrupt handler cannot be put to sleep because Interrupt context is not associated
with process. The current running macro when interrupt occurred is not relevant.
i. Interrupt handlers do not have their own stack. They share the kernel thatthey have interrupted.
If no process is running it uses the idle stack.11. In what context interrupt handlers are run in linux kernel?
a. Interrupt context12.What is top half and bottom half?
7/29/2019 Interrupt Handlers
2/2
a. Interrupts are time critical as they have interrupted other processes. Hence it has tohandled as quickly as possible and hand over back to the process that it has
interrupted.
i. Therefore Interrupt handlers are designed in two portions. Top half It runs immediately upon receiving the interrupt and
performs the work that is only time critical.
Bottom half The portion of that is not time critical in interrupthandled is deferred and is implemented as bottom half.