Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 05 · How Computers Work · Talking to the kernel · with code: Go · about 19 min to read

Play it as a journeyTutor comes with a plan

The tap on the shoulder

IO Interrupts and the Bus
IO Interrupts and the Bus · Open board

A device ringing for the processor’s attention instead of being checked on. This lesson is the same idea one floor up: the kernel ringing for the attention of a running program.

Before you start. A process is one running program, and the kernel is the program underneath all of them, which hands out turns and does the risky jobs for them (Processes, Threads & the Kernel). The lesson ends on a server that gives work to a fixed crew of workers, built later in Build a thread pool.

Lesson 29 of 41 in How Computers Work

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • 1974: a key that stops a program from outside
  • SIGINT, SIGTERM, SIGKILL, SIGSEGV, SIGCHLD: what each tap says
  • The handler: answering the tap, and why it can say almost nothing
  • EINTR: a tap while you wait
  • SIGTERM, then drain: a graceful shutdown
  • The zombie: ended, but not yet signed for

Terms it explains: signal, default action, handler, flag-and-check, EINTR, graceful shutdown, zombie, blocking I/O, bootloader (GRUB), bus, device driver, DMA, event loop, firmware (BIOS/UEFI), I/O-bound vs CPU-bound, init / systemd, interrupt, ISR / interrupt handler, memory-mapped I/O, non-blocking / async I/O, polling, timer interrupt.

Lab

The device taps the CPU on every event. What happens when it taps a million times a second?

Open Let the device tap you every time, push Events a second arriving to the top, and watch the share of arrivals handled.

Open The interrupt storm

Your write returned and the power cut a moment later. Is the record on the disk?

Click After every record, then Every 1,000 records, drag Where the power cuts, and watch Lost on the crash.

Open The fsync interval

Review How Computers Work