Foundations Level: Beginner Chapter 1: How Windows Works Underneath
Boot Phases and Boot Defenses
Boot is a chain of steps, and each step hands control to the next. Defenses at the start of that chain exist because code that runs before Windows is very hard for Windows to see.
Lesson 5 of 5 in Chapter 1: How Windows Works Underneath. Previous step in this path: Firmware and Partitioning. 3 learning objectives, 4 examples, and a knowledge check.
Start: what you will learn
Boot is a chain of steps, and each step hands control to the next. Defenses at the start of that chain exist because code that runs before Windows is very hard for Windows to see.
Learning objectives
- List the boot phases in order
- Explain Secure Boot, Trusted Boot, Early Launch Anti-Malware, and Measured Boot
- Explain why early boot attacks are hard to see, in defense terms only
Concept in simple words
What it is: Boot is the chain of steps that takes your computer from the power button to a working Windows system. A boot attack is code that tries to break into that chain early, before Windows and its security tools are fully running. This lesson is about defense and understanding only, so you can recognise why the early steps are protected, not about how to break them.
Why it works
Why it works this way: Each boot step trusts the step before it, and hands control to the next step. If an attacker can slip code into an early step, later steps may run on top of that code without knowing it. That is why Windows adds checks as early as possible, instead of only checking once the desktop appears. Trust has to start before the attacker can get in, or the checks come too late.
Think of it like this
Think of it like this: Boot is like a relay race, where each runner passes the baton to the next runner. Firmware is the first runner, then the Boot Manager, then the OS Loader, then the kernel, then the system processes. If the first runner is replaced by someone uninvited, every later runner still runs the race, but the race itself is no longer safe. Defenses are like checking each runner identity before they are allowed to take the baton.
How it works, step by step
How it works, step by step: First, firmware runs and finds the boot files. Next, the Boot Manager, called bootmgr on BIOS systems and bootmgfw.efi on UEFI systems, reads the boot settings and picks the system to start. Then the OS Loader, called winload.exe, loads the kernel, which is ntoskrnl.exe, plus the HAL and the early drivers, into memory. Then the kernel starts, and it starts the system processes that bring Windows to life, including the services and the logon screen.
Let us walk through an example: Secure Boot is a firmware check, so the firmware verifies the bootloader signature, which is a digital proof that the bootloader comes from a trusted source, before it runs that bootloader. Trusted Boot is a Windows check, so Windows verifies the kernel and the early drivers before it loads them. Early Launch Anti-Malware, often shortened to ELAM, lets an anti-malware driver load before other third party drivers, so it can watch those drivers as they load. Measured Boot records a hash, which is a fingerprint value computed from each boot component, in the TPM, which is a small security chip on the machine, so a remote checker can later compare those values with clean expected values.
When to use it
When to use it, and when not to: Use this picture when you read about a boot problem, and ask which phase could be involved, instead of guessing at the desktop stage. Do not disable a boot defense just to make a problem go away, because that removes the early check that protects the whole chain. Do not try to test a boot attack on your own machine, because that is not needed to understand the defense, and a broken boot chain can stop your computer from starting at all.
Start from zero: Boot is not one event. It is a chain, and each link hands control to the next link. Firmware runs first, then the Boot Manager, then the OS Loader, then the kernel, then the system processes, then the services, then the logon screen. Each link trusts the link before it, because it has no other way to start. If an early link is replaced by untrusted code, every later link can run on top of that code, and later security tools may never see the problem, because they start after the damage is already in place. That is why boot security starts at the very first link, not at the desktop.
The firmware phase, in depth: On a modern UEFI machine, firmware runs first, reads its boot entries from NVRAM, and finds the EFI System Partition. If Secure Boot is enabled, firmware checks the signature of the bootloader before it runs it. A signature is a digital proof, made with a private key, that the bootloader comes from a trusted source and has not been changed. Firmware holds a list of trusted signatures and keys, and if the bootloader signature does not match that list, firmware refuses to run it. That check happens before Windows code runs at all, which is the whole point. It stops an untrusted bootloader at the door, instead of letting it in and hoping Windows will catch it later.
The Boot Manager phase, in depth: The Boot Manager is the program that picks which system to start. On UEFI systems it is called bootmgfw.efi, and on BIOS systems it is called bootmgr. It reads the Boot Configuration Data, often shortened to BCD, which is a small store of boot entries, settings, and options. The BCD can list more than one system, such as Windows and a recovery environment, and it can hold options such as safe mode. If the BCD is damaged or points to a missing system, boot can stop here, even though Windows itself is healthy. That is why a Boot Manager error does not always mean Windows files are broken. It can mean the pointer to Windows is broken.
The OS Loader phase, in depth: The OS Loader is called winload.exe. Its job is to load the kernel, called ntoskrnl.exe, plus the HAL and the early boot drivers, into memory, and to set up the basic structures the kernel needs. Boot drivers are drivers that must be present before Windows can read its own system disk, such as storage drivers. If a boot driver is missing or damaged, Windows cannot reach the rest of the system, and boot stops here. Winload also checks signatures on the kernel and drivers it loads, as part of Trusted Boot, so tampered early code is caught before it can run as part of Windows.
The kernel and system process phase, in depth: Once the kernel starts, it creates the System process, starts the Session Manager, called smss.exe, and brings up the core processes that make Windows a working system. The Service Control Manager then starts services, in the order their startup types and dependencies require. Only after that do you see the logon screen, and only after you log on do your own apps start. If boot fails at this late stage, you often see a crash, a hang, or a service that never starts, which is a different clue from a firmware error or a Boot Manager error. The phase where it stops tells you where to look.
The four defenses, kept apart: Secure Boot is a firmware check on the bootloader, before Windows runs. Trusted Boot is a Windows check on the kernel and early drivers, as Winload loads them. Early Launch Anti-Malware, often shortened to ELAM, is a special anti-malware driver that loads before other third party drivers, so it can watch those drivers as they load, and it can block a driver it judges to be bad. Measured Boot is different again. It does not by itself block an attack. It records a hash, which is a fingerprint value computed from each boot component, in the TPM, which is a small security chip on the machine. Later, a remote checker can compare those recorded values with clean expected values, and spot tampering that would otherwise be invisible.
Why it works
Why early boot attacks are hard to see, in defense terms only: Security tools that run after logon can only see what is happening after they start. Code that runs before them can hide itself, change what later tools see, or disable those tools before they start. Logs may not exist yet, because the logging service has not started. Memory tools that run inside Windows may trust a kernel that is already compromised. That is why defense in depth at boot uses checks before the attacker can get in, plus recorded measurements that can be checked from outside the machine, rather than relying only on tools that start late. This lesson teaches that defense picture only. It does not teach how to break the chain, and you do not need to break it to understand why it is protected.
What you can and cannot check from PowerShell in this lesson: Get-ComputerInfo tells you basic facts about the machine after boot, such as its Windows version and edition. That is useful for confirming which Windows you are running. It does not by itself prove the state of any boot defense, so do not read a Secure Boot result, a Trusted Boot result, or a Measured Boot result into its output. No cmdlet in this lesson proves a boot defense state, and this chapter does not invent one that does. If you need to confirm a boot defense for a real machine, use the proper management tools for that machine, and do not guess from a general info command.
Troubleshooting by phase, in order: First, ask what you see. No firmware screen at all points to firmware, power, or hardware. A Boot Manager error points to boot entries or the BCD. A failure while Windows is loading points to the OS Loader, the kernel, or a boot driver. A hang or crash after the logon screen points to services, drivers that load later, or user apps. Second, ask what changed last. A firmware setting change, a new disk, a changed boot order, or a new driver are all strong clues. Third, do not disable a boot defense to make a problem go away, because that removes the early check that protects the whole chain, and it can hide the real fault while leaving the machine weaker.
Two edge cases worth knowing: First, a machine with more than one operating system has more than one Boot Manager entry, and changing the firmware boot order can change which system starts, without any Windows file being broken. Always check the boot order before you conclude Windows is damaged. Second, a normal shutdown with Fast Startup is not the same as a full restart. Fast Startup saves part of the system state to disk, so the next start is faster, but it is not a clean cold boot. If you are testing a boot problem, a full restart is the cleaner test, because it runs the full chain from the start.
Worked examples
Read each example in order. Each one explains its parts, then shows what to look for in the output.
Syntax
Get-ComputerInfoExample 1
Get-ComputerInfo asks Windows for basic facts about the computer, such as its Windows version and hardware details. It is used here only as a safe general look at the machine after boot, and it does not by itself prove the state of any boot defense, so do not read a boot defense result into its output.
Get-ComputerInfoIllustrative output: WindowsProductName : Windows 11 Pro WindowsVersion : 24H2 CsManufacturer : Example Manufacturer
Example 2
Get-Service asks Windows for the services on the machine. Where-Object keeps only the objects that pass a test, and here the test is in braces. Inside the test, $_ means the current service, .Status reads its Status property, and -eq means equals, so only services with a Status of Running survive. Select-Object then keeps the Name and Status properties, and -First 5 keeps only the first five results, showing services that started as part of bringing the system up after boot.
Get-Service | Where-Object { $_.Status -eq "Running" } | Select-Object Name, Status -First 5Illustrative output: Name Status ---- ------ Spooler Running Themes Running AudioSrv Running
Example 3
Get-ComputerInfo asks Windows for basic facts about the computer. The -Property parameter narrows the result to only the properties you name, here WindowsProductName and WindowsVersion, so you get a short readable answer instead of a very long list. Look for the product name, such as Windows 11 Pro in the example, and the version, which tells you which release you are running. If you remove -Property, you get all properties at once, which is far harder to read. Remember the limit of this command. It tells you about Windows after boot, and it does not by itself prove the state of any boot defense, so do not read a boot defense result into it.
Get-ComputerInfo -Property WindowsProductName, WindowsVersionIllustrative output: WindowsProductName : Windows 11 Pro WindowsVersion : 24H2
Example 4
Get-Volume asks Windows for the volumes on the machine. The -DriveLetter parameter narrows the result to the volume with the letter C, which is normally the Windows volume that boot had to find and mount. The pipe, written as |, passes that volume object to the next command. Select-Object then keeps the DriveLetter, FileSystem, and SizeRemaining properties. Look for C, for NTFS as the file system in the usual Windows case, and for SizeRemaining to see how much space is left. If C is missing here after a normal boot, that is a strong clue that something went wrong with the disk or the volume, not just with one app. If you change the letter, you check a different volume, so use C here only because it is the normal Windows volume in this example.
Get-Volume -DriveLetter C | Select-Object DriveLetter, FileSystem, SizeRemainingIllustrative output: DriveLetter FileSystem SizeRemaining ----------- ---------- ------------- C NTFS 50000000000
Nothing on this page executes PowerShell code. The outputs above are illustrative only.
Common mistakes and troubleshooting
Read these before you try the examples, so you can spot the same problems in your own work.
- Mixing up Secure Boot and Trusted Boot, when Secure Boot is the firmware check on the bootloader and Trusted Boot is the Windows check on the kernel and early drivers.
- Thinking Measured Boot stops an attack by itself, when it mainly records hashes in the TPM so tampering can be detected and checked later.
- Disabling a boot defense to fix a boot problem, instead of finding which phase is actually failing, and leaving the whole chain weaker.
- Thinking Measured Boot blocks an attack by itself, when it mainly records hashes in the TPM so tampering can be detected and checked later, not stopped on the spot.
- Thinking ELAM is a full antivirus product, when ELAM is only an early driver that watches other drivers as they load, and full protection still needs the rest of the security tools after boot.
- Thinking every boot error means Windows files are broken, when a firmware boot order change, a damaged BCD entry, or a missing boot driver can stop boot while Windows files themselves are healthy.
Knowledge check
Knowledge check
What does Trusted Boot check during the early part of Windows startup?
Pick one answer. Feedback appears right away, and you can try again.
Remember this and next step
Remember this: Boot runs in order, firmware, Boot Manager, OS Loader, kernel, system processes. Secure Boot checks the bootloader in firmware, Trusted Boot checks the kernel and early drivers, ELAM loads anti-malware early, Measured Boot records hashes in the TPM, and early code is hard to see because it runs before Windows security tools are fully awake.
Next step: What is PowerShell