The start-up problem

The operating system is on the drive, and memory is empty

Processorcan only runwhat is in memoryMemoryempty at power-onDriveholds the operating system,as files?Firmware: a small program kept in a chip on the motherboardIt is always there, and the processor is built to run it first.At power-on the operating system is on the drive and memory is empty, so something else has to run first.That something is the firmware. Its job is to wake the hardware and fetch the next program from the drive.Starting up is a relay. Each program loads a bigger one, until the whole operating system is running.

At power-on, memory is empty. Firmware, a small program in a chip on the board, runs first.

The start-up sequence

Four programs run in turn, and each loads the next

One laptop starting, as timed by systemd-analyze. Seconds, to scale.014.21Firmware4.2 stests the hardware and finds a drive to start from25.52Bootloader1.3 sfinds the operating system kernel and loads it into memory37.63Kernel2.1 stakes over the hardware and mounts the main file system414.54Services6.9 severything else starts, ending at the sign-in screenFour programs run in turn, and each one loads the next: 14.5 seconds here.Firmware lives in a chip on the motherboard; the other three are files on the drive. On Linux, systemd-analyzeprints this breakdown. On Windows, Task Manager shows the firmware part as "Last BIOS time".

Firmware, then the bootloader, then the kernel, then services.

Firmware

Firmware tests the hardware, then looks for a drive to start from

Power-on self test✓processor responds✓memory counted and tested✓graphics found: the logo appears✓keyboard and drives foundBoot order1USB drivenothing plugged in: skip2NVMe SSDbootloader found: start it3Networknever reachedFirmware tests the hardware, then walks the boot order until a drive answers.Its settings screen, opened with a key such as F2 or Delete at power on, holds the boot order, Secure Boot,virtualisation support, fan control and passwords. A coin cell keeps its clock running; when the cell dies,the date resets at every start.

The self test checks the parts. The boot order decides which drive is tried first.

Firmware · Going deeper

BIOS and UEFI

BIOS (legacy)UEFIPartition table on the boot driveMBRGPTLargest boot drive2.2 TB9.4 ZB: no practical limitPartitions4 primary128Where the bootloader livesthe first 512-byte sectora file in the EFI System PartitionSecure BootnoyesSettings screenkeyboard onlymouse, network, updatesUEFI replaced BIOS; "BIOS" survives as the everyday name for either.A drive larger than 2.2 TB, or any Windows 11 installation, needs UEFI with a GPT drive. "Legacy" or "CSM"mode makes UEFI firmware behave like a BIOS for old systems, and turns Secure Boot off.

UEFI uses GPT drives and supports Secure Boot. BIOS uses MBR and stops at 2.2 TB.

Bootloader and kernel

The bootloader finds the kernel and hands over

A 512 GB Windows 11 drive, main partitions to scaleEFI System Partition · 100 MBWindows (C:) · 511 GBRecovery · 1 GBEFI System Partitiona small FAT32 partition holdingone bootloader per systemBootloaderreads its settings; shows a menuif there is more than one systemKernelcopied into memoryand given controlThe bootloader is a small program whose one job is to find the kernel and start it.Windows: Windows Boot Manager reads the BCD store and loads ntoskrnl.exe. Linux: GRUB reads grub.cfg andloads vmlinuz with an initial RAM disk of drivers. Two systems on one drive share the EFI partition, and theboot files take 0.02% of the space: a hairline at this scale.

The bootloader sits in the EFI System Partition and loads the kernel into memory.

Services

One process starts everything else

Kernelstarts oneProcess 1starts the reststarted togetherMount file systemsLoad device driversStart loggingonce those are upNetworkTime syncSign-in screenready to useProcess 1 starts every service in dependency order, as many at once as it can.On Linux it is systemd, and systemctl lists and controls its services. On Windows the Session Manager startsthe Service Control Manager, managed through services.msc. One service that fails or waits is the usualreason a machine is slow to reach the sign-in screen.

The kernel starts process 1. Process 1 starts every service, in dependency order.

Services · Going deeper

Sleep, hibernate, shut down and restart

StateWhat stays poweredComing backUse it forSleepmemory onlya second or twoshort breaks; uses some batteryHibernatenothing: memory is saved to the driveslower: memory is read backlonger breaks with work left openShut down (Windows)nothing: the kernel is hibernatedfaster than a full startthe default, called Fast StartupRestartnothing: everything is reloadeda full startafter updates, and to clear driver faultsOn Windows, Restart gives a clean kernel; Shut down usually does not.With Fast Startup on, shutting down saves the kernel and drivers to the drive and reloads them next time. Afault in a driver survives that. This is why "restart it" is the first instruction, not "turn it off and on".

Only Restart reloads everything. Windows Shut down keeps the kernel.

Trust at start-up

Whatever starts first controls everything after it

A normal startFirmwareBootloaderKernelSecurity softwareA start with one stage replacedFirmwareBootloader, swappedKernelSecurity softwareput there by malwareloaded by the fake: not to be trustedstarts last: too late to seeEach stage runs whatever the stage before hands it. A tampered early stage controls everything after it.Security software starts near the end of the chain, so it cannot check what ran before it.The answer is for each stage to check the next before running it. That is Secure Boot: go deeper.

Each stage runs what the one before hands it, so a tampered early stage cannot be seen by later ones.

Trust at start-up · Going deeper

Secure Boot: each stage checks the next before running it

Firmwareholds the trusted keysBootloadersigned✓Kernelsigned✓Driverssigned✓The same start with an altered bootloaderFirmwarechecks the signature✗Bootloadersignature does not matchRefused. Nothing after it runs.The screen reports a Secure Boot violation.With Secure Boot, each stage runs only if the stage before it has verified its signature.This blocks malware that hides beneath the operating system. A TPM chip adds a record of what ran: BitLockerunlocks the drive only if the record matches, which is why a firmware change can prompt for the recoverykey. Windows 11 requires UEFI, Secure Boot support and TPM 2.0.

Every stage carries a signature. A stage that fails the check is never run.

Start-up failures

How far it got tells you what failed

Stage that failedWhat you seeLikely causeFirst movePowernothing: no lights, no fanspower cable, supply or batterytest the outlet and the cableFirmwarefans spin, black screen, beepsmemory, graphics card, a loose partreseat memory; read the beep codeBoot device"No bootable device"boot order; drive unplugged or deadis the drive listed in firmware?Bootloader"BOOTMGR is missing"; grub rescue>boot files damaged or deletedStartup Repair; reinstall GRUBKernelblue screen or kernel panica bad driver or a storage faultsafe mode; undo the last changeServices, sign-instuck on the spinner; black desktopa failing service, full drive, profilesafe mode; read the logsHow far the start got tells you which stage failed, and that names the suspects.A machine that shows the maker's logo has passed the self test. One that shows an operating system error hasfound its drive. Each message rules out everything before it.

Read the symptom, name the stage, and the suspects follow.

Start-up failures · Going deeper

The recovery tools

Windows Recovery Environment: opens by itself after two failed startsStartup Repairrebuilds damaged boot files automaticallySafe Modestarts Windows with only essential drivers and servicesSystem Restorereturns system files and settings to an earlier restore pointUninstall Updatesremoves the most recent quality or feature updateCommand Promptbootrec /fixmbr, /fixboot and /rebuildbcd; chkdsk; sfc /scannowReset this PCreinstalls Windows, keeping or removing personal filesTry the repair that changes least first.The list runs from least to most disruptive. Linux offers the same through the GRUB menu: recovery mode, anolder kernel, or a live USB from which to run fsck and reinstall GRUB.

From Startup Repair to Reset this PC: least disruptive first.

Lesson complete

You finished “How a computer starts”

Nicely done.

Open in a new tab