Diagramium
💻 Narrated diagram

How a computer starts up

The relay race between pressing the power button and seeing your desktop — power good, self test, firmware, boot loader, kernel, drivers, init, login, and the shutdown that undoes it all.

15 steps3 min readNarrated with a studio voice
How a computer starts upyou press the power buttonreset line releasedmemory or graphics missingyou hold the button downevery check passesyou hammer the delete keysave and exitthe boot order finds a diskkernel image loadedthe kernel takes controla disk driver is foundcontrol passes to process onethe display manager is readywrong passwordcredentials acceptedyou choose shut downThe pseudostate a machine starts fromA state — optionally with entry / exit / do behaviorPowered Offdo / a trickle of standby power watches the buttonA state — optionally with entry / exit / do behaviorPower Gooddo / voltages settle, the processor is released from resetA state — optionally with entry / exit / do behaviorSelf Testdo / checking the processor, memory and busesA state — optionally with entry / exit / do behaviorSelf Test Faileddo / beeping a code, because no screen exists yetA state — optionally with entry / exit / do behaviorFirmware In Chargedo / waking devices and reading the boot orderA state — optionally with entry / exit / do behaviorSetup Screendo / waiting for you to change a settingA state — optionally with entry / exit / do behaviorBoot Loaderdo / offering a menu, loading a kernel into memoryA state — optionally with entry / exit / do behaviorKernel Loadingdo / decompressing itself and taking the machineA state — optionally with entry / exit / do behaviorHardware Discoverydo / asking every device what it isA state — optionally with entry / exit / do behaviorReal Disk Mounteddo / handing over from the ramdisk to your filesystemA state — optionally with entry / exit / do behaviorServices Startingdo / bringing up daemons in dependency orderA state — optionally with entry / exit / do behaviorLogin Promptdo / waiting for someone to prove who they areA state — optionally with entry / exit / do behaviorDesktop Sessiondo / your programs running, the machine mostly idleThe state machine has completedShutting Down
How a computer starts up — the complete diagram. Press Present to watch it build itself.
Step 1 of 15

Between pressing the button and seeing your desktop, a computer passes through a dozen distinct states, each one waking the next and then stepping aside. It is a relay race in which every runner deletes itself the moment it has handed over the baton.

Step 2 of 15

Powered Off

A modern machine is never truly off. A few watts of standby power keep the power button, the network card and the clock alive, which is exactly how a laptop can wake on a single keystroke and still know what day it is three weeks later.

Step 3 of 15

Power Good

Press the button and the power supply spends somewhere between a tenth and half a second getting its voltages stable. Only then does it raise a wire literally named power good, which frees the processor from reset. Until that instant the chip is deliberately held frozen, doing nothing at all.

Step 4 of 15

Self Test

The very first instruction the processor runs comes from a chip soldered to the motherboard, not from your disk. The self test confirms that memory answers, that buses respond, that a display exists. On a server holding a terabyte of memory this alone can take several minutes.

Step 5 of 15

Self Test Failed

If the test fails before any screen exists, the machine communicates the only way it can: beeps, or a pattern of blinking lights. One long beep and two short ones traditionally means the graphics card is missing, which is why you sometimes hear a complaint and see nothing.

Step 6 of 15

Firmware In Charge

Firmware now wakes the real hardware, the storage controllers and the network and the keyboard, then reads its boot order, a stored list of where to look for an operating system. Modern firmware is itself a small operating system, often several megabytes of code with its own drivers.

Step 7 of 15

Setup Screen

Hammer the delete key in that first second and you land in the setup screen, the one place you can configure the machine while no operating system exists at all. It is also home to secure boot, the check that refuses to run a boot loader nobody has signed.

Step 8 of 15

Boot Loader

The firmware hands over to a boot loader, the program behind the menu you see when two operating systems share one disk. It finds a kernel, copies it into memory and jumps to it. On older machines that first stage had to fit in four hundred and forty six bytes, the room left in the disk's opening sector.

Step 9 of 15

Kernel Loading

The kernel arrives compressed, so its opening move is to unpack itself, a program whose first act is rewriting its own memory. Then it builds virtual memory and the interrupt tables, the invisible machinery that every single program above it will silently depend on forever.

Step 10 of 15

Hardware Discovery

Now the kernel goes hunting. It walks each bus asking every device what it is, matches the answers against its catalogue of drivers, and loads the code needed to speak to them. That is why a fresh install recognises a mouse it has genuinely never seen before.

Step 11 of 15

Real Disk Mounted

There is a chicken and egg problem here: the driver needed to read the disk is stored on the disk. The fix is a tiny temporary filesystem loaded into memory beside the kernel, carrying just enough drivers to mount the real one and then quietly disappear.

Step 12 of 15

Services Starting

Process number one starts, the ancestor of every other program on the machine. It raises services in dependency order, clock and network and logging, starting everything it can in parallel. That parallelism, and solid state storage replacing the seek times of a spinning disk, is why boot times fell from minutes to seconds.

Step 13 of 15

Login Prompt

The login prompt is the first thing built for you rather than for the machine. Everything up to now ran with total privilege over the hardware. Your password is never stored anywhere on the disk, only a deliberately slow salted hash of it, so the check works while the secret itself stays unknown.

Step 14 of 15

Desktop Session

Your session begins, the desktop paints itself, and your saved windows reopen. Hundreds of processes are now alive, and the machine will spend almost its entire life right here in this state: awake, waiting for you, and genuinely idle for all but a sliver of every single second.

Step 15 of 15

Shutting Down

Shutting down runs the whole relay backwards. Services stop, buffered writes are flushed to disk, filesystems are marked clean. That last step is the entire reason yanking the plug is risky, not the loss of power itself but the writes still sitting in memory that never reached the disk.

Watch it explain itself

Every step above is narrated aloud. Play it, or open it in the editor and make it yours — no account needed.