Skip to main content
Engineering LibreTexts

20: Interrupts

  • Page ID
    19994
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    In a general sense, an interrupt(For more information, refer to: http://en.Wikipedia.org/wiki/Interrupt) is a pause or hold in the current flow. For example, if you are talking on the phone and the doorbell rings, the phone conversation is placed on hold, and the door answered. After the salesperson is sent away, the phone conversation is resumed (where the conversation left off).

    In computer programming, an interrupt is also a pause, or hold, of the currently executing process. Typically, the current process is interrupted so that some other work can be performed. An interrupt is usually defined as an event that alters the sequence of instructions executed by a processor. Such events correspond to signals generated by software and/or hardware. For example, most Input/Output (I/O) devices generate an interrupt in order to transmit or receive data. Software programs can also generate interrupts to initiate I/O as needed, request OS services, or handle unexpected conditions.

    Handling interrupts is a sensitive task. Interrupts can occur at any time; the kernel tries to get the interrupt addressed as soon as possible. Additionally, an interrupt can be interrupted by another interrupt.

    • 20.1: Multi-user Operating System
      A modern multi-user Operating System (OS) supports multiple programs executing, or appearing to be executing, simultaneously by sharing resources as necessary. The OS is responsible for managing and sharing the resources. These resources include the CPU cores, primary memory (i.e., RAM), secondary storage (i.e., disk or SSD), display screen, keyboard, and mouse. For example, multiple programs must share the available CPU resources (core or cores as applicable).
    • 20.2: Interrupt Types and Levels
      Interrupts have various types and privileges associated with them. The following sections provide an explanation of the types and privileges. Interrupted processes may execute at a lower privilege than the interrupt processing code. In order for interrupts to be effective, the OS must securely handle this privilege escalation and deescalation securely and quickly.
    • 20.3: Interrupt Processing
      When an interrupt occurs, it must be handled or processed securely, quickly, and correctly. The general idea is that when the currently executing process is interrupted it must be placed on hold, and the appropriate interrupt handling code found and executed. The specific interrupt processing required depends on the cause or purpose of the interrupt. Once the interrupt is serviced, the original process execution will eventually be resumed.
    • 20.4: Suspension Interrupt Processing Summary
    • 20.5: Exercises


    This page titled 20: Interrupts is shared under a CC BY-NC-SA license and was authored, remixed, and/or curated by Ed Jorgensen.

    • Was this article helpful?