next up previous contents
Next: Framework Up: Interrupt Handling Previous: Interrupt Handling   Contents

Introduction

An interrupt is a signal that the hardware can send when it wants the processor's attention. Interrupts are asynchronous to the threads running on the CPU. It becomes the responsibility of the kernel to service these interrupts as immediately as it can at a ``safe'' time.

Interrupt Handling is one feature that makes a real time operating system considerably different from a general purpose operating system. A real time operating system needs to respond to real time events & hence should have minimum possible interrupt latency. Secondly, since some critical real time systems need to respond to the external device in bounded time, therefore there should be a bounded maximum interrupt latency.

The delay in execution of the Interrupt Service Routine(ISR) from the time the device raises the interrupt is called interrupt latency. Interrupt latency arises mainly because of the three factors -

  1. Kernel's disabling the interrupts to protect the kernel data structures from the interrupt service routines
  2. Kernel's processing time to call the ISR
  3. Device driver's disabling of interrupts because device specification required it.
Little can be done about the delay due to third reason. Delay due to second reason is very less as compared to other ones.

The interrupt latency in an operating system is majorily related to the maximum time for which interrupts are disabled by the OS. Therefore, one can improve upon the interrupt latency by focusing on the first reason. Hence in a real time operating system interrupts should be disabled for minimum possible time. This is in contrast to general purpose operating systems like Linux where the time for which interrupts remain disabled can be as large as 500 ms.

In our real time operating system we have developed a framework under which interrupts are never disabled by the kernel. This however requires us to handle synchronization of kernel data structures in a different manner viz a viz operating systems like Linux where it is achieved by disabling & enabling interrupts. In next section we discuss it in more details.


next up previous contents
Next: Framework Up: Interrupt Handling Previous: Interrupt Handling   Contents
Soumyadeb Mitra 2002-08-07