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 03 · How Computers Work · Many programs, one machine · about 20 min to read

Play it as a journeyTutor comes with a plan

The drawer that says it saved

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

A slow device and a fast chip sharing one set of wires. This lesson follows a save down them, and asks how far it gets before the program hears “done”.

Before you start. A file is only bytes plus an agreement about how to read them (Everything Is a Number (bits & bytes)), and a program never touches the disk itself: it asks the kernel, the one program with full access to the hardware (Processes, Threads & the Kernel). The disk is slow, so the kernel starts a job on it and does other work until the disk signals it is done (I/O, Interrupts & the Bus).

Lesson 14 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

  • January 2009: the settings files that came back empty
  • A name, a number, and the bytes: the inode
  • Why “saved” comes back in two microseconds: the page cache
  • Asking for the cabinet: fsync, and the tray on top of it
  • What the crash left behind: the journal

Terms it explains: inode, hard link, page cache, fsync, journal, delayed allocation, write amplification, 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