Linux Kernel Notes
  • README
  • concepts
    • interrupts
    • syscalls
      • Implementation
      • Syscalls
      • Userspace from syscalls
      • vDSO and virtual syscalls
  • core-apis
    • core-apis
    • kobjects
    • core-utilities
      • Notification Mechanism
      • printk
      • Symbols and Assembler Notations
      • Workqueue
  • debugging-tracing
    • debugging
    • ebpf-tracing
    • finding-bugs
    • syzkaller
    • tracing
  • extras
    • rcu
  • implementations
    • pipes
  • lkmp
    • Prerequisites
    • Linux Kernel Mentorship
    • Setting up for kernel development
  • misc
    • Current
    • What is KABI or (Kernel ABI) ?
    • noinstr
    • this_cpu
  • subsystems
    • device-tree
      • Device Tree YAML Components
      • Testing yaml dtschemas
Powered by GitBook
On this page
  • Introduction
  • Types of Interrupts
  • Interrupt Controllers
  • Interrupt Flow
  • Top Halves
  • Bottom Halves
Edit on GitHub
  1. concepts

interrupts

PreviousconceptsNextsyscalls

Last updated 1 year ago

Introduction

  • event that alters the normal flow of a program

  • can be generated by hardware devices or by the CPU itself

  • physically produced by electronic signals generated by hardware and directed to the input pins on an interrupt controller.

Types of Interrupts

  • Based on the source of interrupt :

    • Synchronous → Generated by executing an instruction (Eg : , Divide by Zero)

    • Asynchronous → Based on external event (Eg : Key presses on keyboard)

  • Based on ability to temporarily disable :

    • Maskable → can be ignored; it is signaled via INT pin

    • Non-Maskable → cannot be ignored ; it is signaled via NMI pin

Interrupt Controllers

An interrupt controller is a simple chip that multiplexes multiple interrupt lines into a single interrupt line on the processor.

  • when an interrupt occurs, the current flow of execution is stopped and the interrupt handler runs (unless interrupts are disabled for critical sections)

  • Each interrupt has a unique value assigned to it so that interrupts from 2 different devices can be differentiated. These values are called Interrupt Request (IRQ) lines.

Interrupt Flow

TODO: add flow excali svg here

Top Halves

Bottom Halves

TODO: add backlinks here

Their are 4 ways to defer work in Bottom Half

  1. softirq

  2. tasklet

  3. kernel Timer

(replacement of task queues)

workqueue
syscalls
Introduction
Types of Interrupts
Interrupt Controllers
Interrupt Flow
Top Halves
Bottom Halves