Interrupt In Operating System (original) (raw)

Last Updated : 11 Apr, 2026

An interrupt is a signal generated by hardware or software when an event needs immediate attention from the processor. It causes the CPU to temporarily stop the current execution and respond to a high-priority request. In I/O devices, interrupts are generated using the Interrupt Request Line (IRQ/IRL) and are handled by a software routine called the Interrupt Service Routine (ISR). After executing the ISR, the processor resumes the interrupted program from where it was paused.

Types

Event-related software or hardware can trigger the issuance of interrupt signals. These fall into one of two categories:

Types-of-Interrupt

1. Software Interrupts

Interrupts that are generated by a program (software) rather than hardware. They are also known as traps or exceptions. These interrupts are used to request services from the operating system or to handle error conditions during program execution.

2. Hardware Interrupts

In a hardware interrupt, all the devices are connected to the Interrupt Request Line. Multiple devices generate interrupts through interrupt lines (IRQ), which are managed by an interrupt controller to identify and prioritize requests. To request an interrupt, a device closes its associated switch. When a device requests an interrupt, the value of INTR is the logical OR of the requests from individual devices.

Hardware interrupts are further divided into two types of interrupt:

Sequences of Events Involved in Handling an IRQ(Interrupt Request)

Flowchart of Interrupt Handling Mechanism

The Image below depicts the flowchart of interrupt handling mechanism

Interrupt Handling Mechanism

Interrupt Handling Mechanism

Managing Multiple Devices

When more than one device raises an interrupt request signal, then additional information is needed to decide which device to be considered first. The following methods are used to decide which device to select: Polling, Vectored Interrupts, and Interrupt Nesting. These are explained below.

Processors' priority is encoded in a few bits of PS (Process Status register). It can be changed by program instructions that are written into the PS. The processor is in supervised mode only while executing OS routines. It switches to user mode before executing application programs.

Interrupt Priority Schemes

Interrupt priority schemes are used in microprocessors and microcontrollers to manage multiple interrupt requests (IRQs). These schemes ensure that more urgent tasks are processed before less important ones, making them essential for real-time systems and efficient interrupt handling.

Types of Interrupt Priority Schemes

What is Interrupt Latency?

The amount of time between the generation of an interrupt and its handling. The number of created interrupts, the number of enabled interruptions, the number of interrupts that may be handled, and the time required to handle each interrupt all affect interrupt latency.

Interrupt-Latency

Interrupt Latency

How CPU React when Interrupt Occurs?

Triggering Methods

Every interrupt signal input is intended to be activated by a certain signal edge (level change) or a logic signal level. Level-sensitive inputs make constant requests for processor attention as long as they are treated with a specific logic level (high or low). Edge-sensitive inputs are responsive to signal edges; a service request will latch on to a specific (rising or falling) edge. When the interrupt handler runs, the CPU resets the latch.

Benefits of Interrupt