Silver Bullet

Linux Kernel Learning — Part 1

Overview

linux_kernel_map

Looking at the full landscape of the Linux kernel, one can feel overwhelmed and lost amid the numerous subsystems. One approach is to observe the kernel's functionality from the perspective of Linux's diagnostic (measurement) tools and their functional slices.

linux_observability_tools

Interrupt Subsystem

  • Interrupts
    • hard interrupts
    • soft interrupts
    • Interrupt nesting
      • hard interrupts can be nested
      • soft interrupts cannot be nested
    • Differences between hard interrupts and soft interrupts
      • soft interrupts are generated by executing interrupt instructions, whereas hard interrupts are triggered by peripheral devices.
      • The interrupt number for hard interrupts is provided by the interrupt controller; for soft interrupts, the interrupt number is specified directly by the instruction, without needing an interrupt controller.
      • hard interrupts are maskable, while soft interrupts are not maskable.
      • The hard interrupt handler must ensure it completes its task quickly, so that the program execution does not wait for a long time; this is called the top half.
      • soft interrupts handle the unfinished work of hard interrupts, serving as a deferred execution mechanism, and belong to the bottom half.

Other Subsystems

TODO

References

[1] https://makelinux.github.io/kernel/map/