INTERRUPT HANDLING

In a Linux system, when a certain hardware error is detected and an IRQ or an interrupt request is raised, the Linux kernel attempts to fix the errors. Though the Linux kernel has a much generalized way of handling with these interrupts, the way individual interrupts are handled is mostly specific to computing architecture.

Once a certain hardware interrupt take place the CPU ceases to execute the instructions that it was busy executing before and then shifts to a specific location within the memory that either contains theinterrupthandlingcode or can lead to theinterrupt handlingcode. Theinterrupt handlingcode works in a special CPU mode called the interrupt mode and usually no other interrupts can occur in this mode. When the CPU interrupt has been dealt with, the CPU's is restored to its original state and the interrupt is dismissed. Then the CPU will continue with whatever it was previously doing before getting interrupted. The interrupt processing code needs to be as efficient as possible. It is important that the operating system cannot block interrupts for too long or too often.

Different Types Of Interrupts

I/O Interrupts: In case ofI/O interrupts, theinterrupt handlershould be quite flexible in order to render services to different devices simultaneously. Several devices may share the same IRQ line in PCI bus architecture. This means that only the interrupt vector won’t be telling us everything about the interrupt. A same vector for example may be assigned to both the sound card as well as the USB port.Interrupt handlingflexibility can be achieved in 2 ways:

· IRQ Sharing: The interrupt handler in the machine sends out many interrupt service routines (ISRs). Each ISR function is related to a single device sharing the IRQ line and each ISR is executed to check whether the device associated with it needs attention or not as it is impossible to know in advance which particular device issued the IRQ. When ISR finds that a device needs to be treated, it performs everything that needs to be done to handle the interrupt.

· IRQ Dynamic Allocation: In this mechanism, an IRQ line is associated with an individual device at the last hour; for example, when a user accesses the floppy disk device, the IRQ line of the floppy is allocated. Working in this way enables the same IRQ vector to be used by many different hardware devices even if they are not able to share the IRQ line, although this cannot be done simultaneously.

Following An Interrupt, The Linux Kernel Divides The Actions To Be Performed Into Three Classes:

· Critical

· Noncritical

· Noncritical deferrable

Interrupt Handling Actions

All I/Ointerrupt handlersperform the same four basic actions regardless of the kind of circuit that caused the interrupt.

· Firstly, aninterrupt handlersaves the IRQ value and the register contents in the Kernel Mode stack.

· It then sends an acknowledgment to the PIC, which is servicing the IRQ line which allows it to issue further interrupts.

· The Interrupt Service Routines (ISRs) associated with all the devices that is found to share the IRQ line are then executed.

· Finally it terminates the interrupt by jumping to the ret_from_intr( ) address.

We provide email-based homework help that can assist you with brilliant understanding and simulations and help you understand the subject in a more practical and relevant way for any assignment help.

Transtutors.comoffers timely homework help at a reasonable price and you can get detailed answers to all your Computer Science queries. This allows you to acquire more knowledge about your assignments apart from havingInterrupt Handling Homework Help or Assignment Help. Whatever is your query, our range of experienced and qualified tutors are always ready to assist you.