Skip to content
Back to writing

Beyond the Spec Sheet: The Complexity and Inner Workings of Modern Processors Part 2

If you’re already familiar with registers, the control unit, the arithmetic logic unit, buses, caches, and clocks in the context of CPUs, go right ahead. If you’re not and you ended up on this page, I strongly advise you to read how-processors-work. Reading x86-vs-arm64 is a bonus, but you won’t necessarily need it to understand this piece.

We will split this into two sections. The first will talk about legacy systems to explain things in a much more systemic manner that we can build on. The fundamentals don’t change between the legacy systems and modern ones; there are just improvements on the exact mechanics of the working itself to improve speed and performance.

This is an extremely complex topic, so we will touch upon a few things that will be beyond the scope of this article. I will call these out, and we might go over them in a different article. Because of this, there may be some things that you need to accept as a black box. I will strive to ensure it doesn’t hamper understanding, but digging into those deeper concepts here will only complicate and confuse things, so we will avoid them and stay strictly on topic.

With that disclaimer out of the way, let’s do a quick recap:

  • Control Unit (CU): This is the brain and helps handle the entire orchestration of the CPU.
  • Arithmetic Logic Unit (ALU): This is the heart. It handles the core work, the actual task that you expect a CPU to do.
  • Clocks: These ensure that everything happens in a defined time so that tasks can execute predictably without one overriding the other.
  • Registers: These are very small data containers that can hold a multitude of data, from the data needed for the current instruction, to the instruction itself, to other special operations that are important to the CPU.
  • Cache memory: This is just a special type of memory that stores data related to the instruction to execute. It is slower than registers but faster than RAM.
  • Buses: These connect everything and make sure that data can travel between them.

What happens on Computer Startup?

Let’s start at the very beginning. What happens when your PC or laptop is shut down? At this stage, without power, it’s just an expensive paperweight. How does it go from that to being capable enough to open files, organize content, and give you a display screen capable of letting you watch and read content?

This is very complex in modern systems, as they are mostly SoCs (meaning a single, tightly integrated chip contains the CPU, GPU, memory controllers, and other specialized components) and include complex networking like a Network-on-Chip (NoC). However, all of those are abstractions built to solve problems or improve the efficiency of the core process. So, we will start off by looking at a historical arrangement. This means some of the things we say here would be done differently today, but the core action itself doesn’t go away.

Power Delivery

Let’s start with the very first thing that happens: you switch on your machine and power gets delivered to the CPU. But wait, this is tricky. If you’ve ever tinkered around with electronics or read about wiring in homes, you would know that wires are rated for a specific power threshold. Go above it, and they could short-circuit, melt, or catch fire.

If this can happen to the large wires in your home, it is reasonable to think it could happen to a CPU too. This is especially true when a CPU is nowhere near as resilient, and the internal pathways that channel power are sometimes smaller than the width of a single strand of human hair. It makes sense that there must be some kind of regulator that controls exactly how much power is sent.

This discussion about power should highlight one more important point (one that cannot be iterated enough, as it is easy to think of computers in the abstract and forget about the actual physics). All the data moving from registers to the ALU, all your CU decoding, etc., is just an electrical signal (a specific sequence of electric current). This means the electricity cannot drop or waver around; it has to be completely predictable and consistent.

So, the first thing that happens is the power from your wall outlet goes to a Power Supply Unit (PSU), which is connected to the motherboard. Think of the motherboard as the central hub where everything (like the CPU, RAM, GPU, etc.) is connected. We won’t go into the exact details of how the motherboard works, as that is beyond the scope of this article. Just think of the motherboard like your physical desk that holds your laptop, monitor, and peripherals like a keyboard. It connects the power supply to the CPU. The flow is simple: Wall Outlet -> PSU -> Motherboard -> CPU.

The PSU takes a fraction of a second to parse the electrical signal and convert it into the required voltage levels. It ensures the supply is regular and stable, and then it sends a Power Good signal. However, this signal does not go straight to the CPU. Instead, it travels to a central switchboard on the motherboard called the Platform Controller Hub (PCH) (this name is given by Intel; it is often simply called the Chipset on AMD systems). You can think of this signal as turning on a switch to pass the power to CPU and saying, “Hey, everything is good, you can start now.”

CPU and The Reset Signal

Now, the moment the power supply connects and a bit before the Power Good signal comes in, one more thing happens: the CPU is held in reset. What does that mean? Well, until it is released from this state, your CPU is basically as intelligent as a brick. It actually is pretty much a brick (an interesting side note: when a mobile device is completely dead, technical forums colloquially say it has been “bricked”). We talked about how the CPU can process instructions and handle complex tasks, but how does it know what to do? Like, where to start?

The Reset Signal tells it that. It is just a hard-coded signal to the CPU that sets all registers to a specific, hard-coded default value.

That might be a bit difficult to visualize, so consider the following: you’ve moved to a new place and are looking for a grocery shop. You call and ask a friend who has been there before, and he tells you, “Hey, just walk 10 meters ahead and take the first left, and you’ll see it.” Now, depending on where you are currently standing, that path could be completely incorrect. You would probably have to start off by saying, “Hey, I’m standing in front of my home right now; could you tell me where to go from here so I reach the grocery store?”

The reset signal is basically a command that tells the CPU, “Before I tell you what to do, go stand in front of your home.” This home is a hard-wired address.

What does that mean? Well, think of it like this: your home has a power connection, and you switched on the lights in your bedroom and the AC. Now, there is an outage and electricity for the entire neighborhood goes down. When it comes back on, do you have to turn on your lights and AC again? No, right? Because you had already flipped the switch, the moment power comes back, your lights and AC get switched on automatically. You could even decide to say, “Hey, this light and AC will always be on, so I don’t even need this switch. Let me directly wire it so that the moment my house gets power, they get switched on.”

Inside the CPU, something exactly like the latter happens. There is a hard-wired circuit that ensures the moment power flows in, the Platform Controller Hub (which we mentioned earlier) makes a specific line inactive by grounding the voltage to it. This is the Reset Signal. This sends a control signal to a specific circuit in the CPU that is physically hard-wired to say, “The moment I get this signal, I need to point to a specific memory address.” This memory address is what is called a Reset Vector. It is the absolute starting point that tells the CPU where it needs to go first. The way it points to this memory address is by connecting to a bunch of physical lines (like 16, 32, etc.). The exact number of lines doesn’t matter as much as the fact that each line is hard-wired to either have a voltage or not (1 or 0), which physically spells out the binary address (for reference to understand this, see x86-vs-arm64).

As we discussed earlier, everything the CPU immediately takes action on is stored in a register. When the reset signal is sent, that initial memory address is loaded into a Special Purpose Register called the Program Counter (or in some cases the Instruction Pointer, both refer to the same thing; if you need a refresher on what this is, see registers). This special purpose register is extremely important as it is what drives the entire operation moving forward.

A key point to note is exactly how this is orchestrated. Remember the Platform Controller Hub (PCH) we mentioned earlier? During this entire power-up phase, the PCH actively holds the CPU in this inactive reset state. It watches the Power Good signal, verifies that the motherboard’s internal voltage regulators are stable, and ensures the system clocks are running perfectly in sync. Once the PCH is completely satisfied that the environment is flawless, it turns off the reset signal. Raising this signal is the exact physical trigger that wakes the CPU up, giving it the green light to take its first step.

The First Instruction and Firmware

This is one of the most complex parts, so we will be breaking this down a lot. To start off with, we will mention two words: BIOS and UEFI. If you’re tech-savvy, you’ve likely heard of them in at least some form. BIOS stands for Basic Input/Output System, and UEFI stands for Unified Extensible Firmware Interface. We won’t go into the differences or details of either, but for the context of this article, we will explain using UEFI as it’s newer and keeps things from getting too complex.

Just reading the full form, you may have the question: what is firmware? Well, it is just a fancy way of calling a specific type of software. This type of software is written in a very low-level language (we won’t go into language levels here). Just think of it as the kind of logic where you have to literally specify every single thing that needs to be done by the hardware. So, firmware is basically the starting point where software begins.

Now, you might be thinking, “Wait, where did we go? We were talking about the program counter and the hard-coded address in it.” Well, I’ll use a pun here and say we jumped. I know you probably don’t get it yet, but stick around.

First things first, the hard-coded address cannot be some random address in the middle of the memory. Well, it can be, but it doesn’t make any sense as that means you split a useful block of memory into two chunks for no reason whatsoever. Think of it like this: you and a group of friends want to order a large pizza. The shop sends one box with half the pizza, saying, “Our box was only big enough to store half, so we’ll send the other half later.” You would be a bit annoyed and probably ask why they couldn’t just get a bigger box. The same logic applies in the case of memory. If you put the starting address in the middle of the memory, you’ve made it impossible to store something larger without breaking it into two parts.

This part is a bit more complex, so for the sake of simplicity, we will consider Intel x86 processors, which have a reset vector of 0xFFFFFFF0. This is a special way of writing a sequence of 0s and 1s called hexadecimal (this too is beyond the scope of this article; for learning more, you can read hex-to-binary). It basically translates to a memory location exactly 16 bytes below the maximum limit of a 4 GB address space.

The phrase “maximum limit” probably brings up a question like, “Wait, maximum limit of what? What is the address space?” Think of address space as just a way of mapping out how to point to specific memory locations. During the boot process, the reset vector is provided using 32 bits. The maximum amount of locations that can be referenced by a 32-bit address is exactly 4 GB of address space.

You might also suddenly wonder: why exactly 16 bytes? Well, instructions occupy physical space. A 16-byte block is more than enough to comfortably fit the initial JMP instruction, and it makes the underlying hardware logic much simpler than it would be if the system had to fetch a random number of bytes like 10 or 12. The PCH plays a crucial role here too. It sees the address the CPU is asking for and acts like a mailman, recognizing the address and routing the request exactly where it needs to go.

Consider that this specific address points to a special kind of non-volatile memory (non-volatile just means it doesn’t lose data when your PC is turned off; conversely, volatile memory loses data when turned off) called SPI Flash. SPI stands for Serial Peripheral Interface. We again will skip the details of this. I know I’m saying this a lot, and honestly, you’ll see it a lot more. It’s just that this topic is so complex that if we dig into everything, we’ll keep digging until we are completely away from the topic. There are a hundred complex things in this that probably deserve their own articles.

Anyway, think of the SPI Flash as a permanently fixed storage space. Now, what does the SPI Flash store? It stores the UEFI (or BIOS) core code. Now, this core code is a lot larger than 16 bytes, which was how far we were from the 4 GB max limit.

Since the core code is larger than that 16-byte space, that tiny space just contains the very first instruction, which is a JMP (or Jump) instruction. This is a special instruction that basically tells the CPU, “Hey, I don’t know what to do, but I know who can tell you,” and points it to a different memory address. If you’ve ever been in a scenario where you ask a friend a question, and he says, “Hey, I don’t know, but I know another guy who does and I can connect you to him,” the Jump instruction is basically doing exactly what your friend did.

Reset vector

From the plug to the first instruction on the board.

Scroll sideways to follow the board.

  1. 1 Plug in
  2. 2 Reset
  3. 3 Power Good

The board has no power. Plug the supply in. Standby power comes up first, and the PCH uses it to hold the CPU in reset while the rest of the power settles.

The UEFI Boot Phases

This jump enters the UEFI core code, which does quite a few things across multiple steps. We’ll break these down into phases:

  • SEC (Security): This is the point where the CPU doesn’t know anything. None of your hardware components like RAM are active yet, so the CPU says, “I can only do the very basic stuff.” Since there is no system RAM available at this point, the CPU uses its own L1/L2 cache as a temporary RAM (called Cache-as-RAM) to perform its initial calculations.

  • PEI (Pre-EFI Initialization): What’s EFI? (Hint: look at the full form of UEFI). At this point, the CPU initializes and finds out about the DRAM (D stands for Dynamic; don’t worry about what it means right now, just think of it as your normal RAM). It checks what voltage it needs, how long it takes to read or write to the RAM, how large the RAM is, etc. It needs all of this to operate properly. It gets this data and writes it to a common place so all cores can see it. We won’t go over where exactly it is stored, as that’s a different discussion.

  • DXE (Driver Execution Environment): Once RAM is set up, it loads the other stuff. It sets up the drivers for your USBs, your connecting cable slots (like PCIe, etc., don’t worry about it now), and initializes the NVMe/SATA drives (basically your hard disk). Now you might ask, what is a driver? Remember what we started off with: everything is an electrical signal, so your USB and your hard disk all need specific electrical signals too. A driver is just a thing that converts a specific instruction from the CPU into the electrical signals these specific components will understand. Basically, it tells the CPU, “Hey, if you want to fetch data from this drive, make these pins 0 and these pins 1.” Think of them as translators. Imagine you want to talk to someone who doesn’t speak English. You will need a translator who translates what you say to the other person, and what they say to you. A driver is just a translator between the CPU and whatever device you use. During this phase, each driver also triggers a hardware check. If successful, it basically says, “Hey, everything is good and working on my end.” This collective checking process forms the POST (Power-On Self-Test), which ensures that the hardware components connected to your system are present, healthy, and working as expected.

  • BDS (Boot Device Selection): This is the phase that actually goes looking for an operating system. It reads the saved boot settings and hands off control to the bootloader. We will talk a bit more about where this information is stored in the next section.

flowchart LR
  Power((Power On)) --> Reset[Reset Vector<br/>Jump to SPI Flash]
  Reset --> SEC[SEC Phase<br/>Cache-as-RAM]
  SEC --> PEI[PEI Phase<br/>DRAM Initialization]
  PEI --> DXE[DXE Phase<br/>Drivers & POST]
  DXE --> BDS[BDS Phase<br/>Boot Device Selection]
  BDS --> Boot((Bootloader<br/>Handoff))

Finding the Operating System

Once all that is done, it needs to load the operating system. As part of your SPI Flash, there is a small piece of storage attached called NVRAM (Non-Volatile RAM). I say attached, but it is actually a small region on the exact same chip. Think of it like using a physical notebook: you use the main pages for permanent records, but you save the last few pages for rough scratchpad work. Those last pages are still part of the notebook, but you can make changes to them casually without messing up the rest of your important notes.

If you tinker around with your BIOS/UEFI settings, you might know that you can configure which drive should be used for bootup, what speed the fans in the CPU should run at, etc. All these are core system values that you can change around. Because the SPI Flash basically contains data that could ruin your entire system if tinkered with improperly, you can’t directly write to the whole thing. A small section is exposed for writing and modifying user settings, and this piece is the NVRAM.

The system uses the NVRAM to locate the EFI System Partition. This is basically where your bootloader lives on your hard drive (the program that actually starts up your operating system, like Windows or Linux). Macs, especially those using Apple Silicon, are different; the name and exact process may change, but the core fundamental actions and the reasoning behind them do not. For this article, we will be referencing the process with respect to Windows or Linux for the sake of simplicity.

Once it sees the bootloader, it navigates to it and reads a header called PE/COFF (Portable Executable / Common Object File Format). This header tells it how large the bootloader is and where the exact entry point of the bootloader is located. The firmware then goes back to the CPU and says, “Hey, copy everything in this bootloader from the hard disk directly into the RAM.”

If you’ve been paying careful attention, you might recall in the previous article it was mentioned that the CPU contacts the RAM via something called an MMU. This is very important, and we’ll get to it, but for now, consider that every communication is happening using raw physical addresses (raw electric signals). So at this early stage, the MMU just says, “Whatever you tell me, I will tell the RAM.” The entire bootloader is loaded into one continuous chunk of memory.

This is important because of the PE/COFF header we mentioned earlier. It just tells the CPU how far away the entry point is. Remember the earlier analogy of “go 10 meters ahead and take the first left”? Well, the entry point says something exactly like that, except it phrases it as, “Go 10 meters ahead from where I am standing right now.” The firmware code and the CPU use that relative offset to figure out where exactly the bootloader starts in the RAM.

This might be very confusing to start off with, so let me simplify it with an analogy.

Imagine you want to buy a nice watch. You just know you want it to look good, tell time accurately, and be durable. You know nothing about watches though. So you go to a friend, let’s call him Nick (NVRAM)—who knows about a bunch of things like cars, fashion, and gadgets. However, Nick says, “Hey, I don’t know about watches, but I do know a guy who knows about watches. This guy is a bit shy though, so I can’t take you to him, but I’ll ask him with the information you gave me, and he’ll know for sure.”

So, Nick goes to the shy guy, Harry (the Hard Disk), and asks him about watches. Harry says, “You know what, I don’t know much about watches either. But I do know about this really good watch shop (the Bootloader), and I know there is an expert there who can get you exactly the watch you need.”

Nick comes back and tells you where the shop is. You end up going there (the CPU copies the entire Bootloader into memory). You walk in, see the receptionist, Penny (PE/COFF), and ask her where the expert is. Penny guides you directly to his office (the Entry Point). This expert, Oscar (the Operating System), then helps you sort everything out and gets you the watch you need.

The analogy may not be 100% physically accurate as I needed to bend things a bit for the sake of the explanation, but it is extremely close to the logical flow of what actually happens.

During the DXE phase, the system loads basic drivers for your storage and graphics. They aren’t running at full capability yet, but they are good enough to get a basic display running. This is also when a very basic display can come up. If you’ve ever booted a laptop and seen the manufacturer’s logo (HP or Dell) and a spinner on a black screen before the operating system appears, that picture is the firmware, drawn around here.

Starting Off and Setting Up the Environment

We got to the part where the bootloader is loaded into memory, and the CPU navigated to the starting point of the bootloader using the PE/COFF header. Now, what exactly happens during this handoff, and what does the bootloader do? Well, there are a bunch of low-level tasks that need to be carried out before your operating system can actually run.

Before we get into that, here is another quick reminder that we are talking about x86 chips. Since these parts are so heavily dependent on hardware, it needs explicit calling out. The fundamental concept doesn’t change, but the way that concept is used or implemented does change between different processor types. We are using x86 because these systems were the most common for a long period of time, are easy to explain, and provide a lot of insight into what prompted newer reforms and changes. We won’t be going into all of them, but all of this is part of the core foundation.

Now, the low-level steps required to prep the CPU are pretty logical, so let’s look at them (note: in older BIOS systems, the bootloader had to do all of these itself, whereas in modern UEFI systems, the firmware handles the initial mode and cache transitions right before handing control over to the bootloader):

  • Setting up the Stack Pointer: This is an address stored in a special purpose register called, well, the Stack Pointer register. Now, what exactly is a stack, and what does the Stack Pointer do? Remember our earlier analogy about going to the watch shop? You went to Nick, and he went to Harry. Once Harry tells Nick about the shop, Nick has to come back to tell you. Keep in mind that inside a computer, all these components are extremely dumb pieces of silicon running on electricity. If you replace the people with electrical components, Harry might figure out, “Hey, I need to tell someone about the shop,” and then completely forget who asked him! To solve this, the RAM keeps a running list in memory called a stack, which records the return address of where a function must go back to after it finishes executing, and the Stack Pointer (register in CPU) tracks the very top of that list. In our analogy, Harry must know that he needs to report back to Nick, and Nick also needs to know that he has to come back and talk to you. So at the moment Harry is thinking, the top of the stack (pointed to by the Stack Pointer) is set to Nick. Once Harry finishes and hands the info back to Nick, the Stack Pointer shifts to you, so Nick knows he needs to come and talk to you next.

  • Processor Mode Configuration: You might have heard about 64-bit vs. 32-bit Intel processors. If you never have, well, I will pretend you have so I don’t feel ancient while still in my twenties. These numbers refer to the size of the registers. Understandably, the first computers weren’t as advanced as today’s machines. Intel processors started off with 16-bit registers, moved to 32-bit, and now use the current 64-bit registers. Because of backwards compatibility, Intel processors always boot up in 16-bit mode (called Real Mode), then transition to 32-bit mode (called Protected Mode), and finally enter 64-bit mode (called Long Mode). Where is this info stored so the CPU knows which bit mode it needs to be in? That is also handled using a few special purpose registers, specifically CR0 and CR4 (we name registers for easy identification, similar to how people have names so you don’t have to call your friend, “Hey you, the guy in the red t-shirt”). Entering this mode also sets up basic memory protection and page tables. What does that mean? Until this point, everything was communicating by sending out the exact physical address in RAM. At this stage, instead of a raw physical address, a virtual address is used, which 64-bit architecture mandates (the exact why is beyond the scope of this article, so we will discuss it later). Think of a virtual address as a nickname or alias that you use. A friend you call Nick might actually have a long legal name like Nicholas and a complex government ID, which is a mouthful to use every time you talk to him, so you just use the clean alias instead. The CPU does something similar by giving programs clean, isolated virtual addresses instead of making them deal with raw physical hardware locations. Memory protection is simply a flag that acts as a safety check, telling the CPU which locations in RAM can be written to safely so the memory locations containing the bootloader or core system files aren’t accidentally overwritten.

  • Clearing Registers: Recall the General Purpose Registers (see registers)? Another important housekeeping step is clearing them out so random junk values from earlier boot steps aren’t left sitting in there.

  • Enabling Normal CPU Caches: Recall the part where we said the CPU was using its L1/L2 cache as temporary memory (Cache-as-RAM) before the main RAM sticks were initialized? Once the main RAM is ready, the CPU switches those caches back to behaving like normal caches again (see caches). Cache-as-RAM is actually much slower than using the silicon as a normal cache, even though they are physically the exact same piece of hardware (why that happens is again beyond the scope of this article).

Loading the Kernel (The Multilingual Translator)

After all of the hardware prep above is complete, the system starts loading in much more complex instructions (if you’re a software engineer, a fun detail here is that the very first moments are written in low-level Assembly during the SEC phase, but a lot of the firmware after that, and the kernel itself, is written in C).

Once the bootloader has everything ready, its final job is copying the kernel into RAM and starting it up.

What is a kernel? It is the core part of your operating system and the foundation of how anything on your PC actually works. Keep in mind that up until this point, we have been walking on eggshells with memory addresses, treating everything as raw physical signals on a circuit, with no complex user interface loaded yet.

Now, imagine if software developers had to write every single application (like your web browser or a game) with all of those raw hardware constraints in mind. Think about how painful that would be: a developer would have to build a completely different version of their software depending on whether your PC is running an Intel or AMD chipset, whether your display is HD or 4K, or whether your RAM is 8 GB or 16 GB. For every possible hardware configuration, they would have to write custom code.

Instead, the kernel steps in and acts as an abstraction layer. Because of the kernel, an application developer mostly only cares about which operating system the device is running (Windows, Linux, or macOS), and the kernel handles the messy hardware specifics underneath.

To make this concrete, think of the following analogy. Imagine you need to deliver a presentation to five people. One person only understands Hindi, the second only understands Spanish, the third French, the fourth German, and the fifth Mandarin. You, however, only speak English. How do you deliver this presentation?

You have two options. First, you could go out, find five different coworkers who speak each of those languages, and build five separate versions of your presentation for them to deliver. This is a ton of work, and it will undoubtedly cause variations in how the message is delivered, since each of the five people you brought in will have a slightly different understanding of your topic. Instead of one consistent presentation, you end up maintaining five different ones.

Now, imagine that while you are stressing over this problem, someone walks up to you and says, “You know what? I’m multilingual. I speak all five of those languages fluently, and I also speak English. How about you just explain the presentation once to me in English, and I’ll take care of translating and explaining it to everyone else in the room?”

You would obviously prefer this second option, because it drastically reduces the amount of work you have to do. You just talk to one person, and they handle the translations for everyone else. In this analogy, the kernel is that multilingual translator. It sits at the core of your operating system and defines how all your software safely and easily interacts with your physical hardware.

Kernel Abstraction

The kernel is the multilingual translator between programs and hardware.

  • Program driving a device itself
  • Path through the kernel

Without a kernel. Each program would have to speak every device's language itself. Five programs, each with a private path to the GPU, to RAM, and to the disk, make fifteen paths. They tangle because nothing in the middle is sharing the work. A different graphics card, a different amount of memory, or a different drive means rewriting every program.


Well if you survived until now. Congratulations! I know traversing through firmware, memory addresses, and the OS kernel is a lot to take in, but I’m glad you found my writing interesting enough to devote so much time to it and hope that I’ve managed to clarify the topic. Stay tuned for the next part, where we will finally explore how the CPU cheats time to run all of this so incredibly fast.

Suggested next reading