Fundamentals 17 min read

What Really Happens When You Press the Power Button? A Deep Dive into the BIOS Boot Process

This article demystifies the computer startup sequence by explaining why BIOS controls the initial steps, how memory mapping works, what the 0x7C00 boot sector is, and how the CPU jumps from the power‑on reset to the operating system loader.

Liangxu Linux
Liangxu Linux
Liangxu Linux
What Really Happens When You Press the Power Button? A Deep Dive into the BIOS Boot Process

The author sets out to answer the common question "What happens after we press the power button?" and points out that most search results give vague textbook answers, prompting a detailed, step‑by‑step explanation.

Why does BIOS dominate the boot?

Because the CPU continuously fetches instructions from memory, the first code it can execute must reside in a known location. BIOS is placed at a fixed address and is entered via memory‑mapped addressing, which the author explains using the concept of memory mapping.

Memory Mapping

A CPU's address‑bus width determines the addressable memory space (e.g., 16‑bit bus → 1 MiB, 32‑bit → 4 GiB, 64‑bit → huge). Parts of this address space are reserved for peripherals, effectively mapping devices like video memory and disk controllers into memory regions.

Real‑mode memory layout
Real‑mode memory layout

Real‑mode Memory Distribution

In real mode the first 1 MiB of memory is available. BIOS itself is mapped to 0xC0000‑0xFFFFF, with the interrupt vector table at the very start of memory.

How the CPU Starts Executing BIOS Code

At power‑on the CPU forces the PC register to 0xFFFF0 (CS = 0xF000, IP = 0xFFF0). This address contains a far jump instruction: jmp far f000:e05b The jump leads to physical address 0xFE05B where BIOS performs hardware detection and finally loads the boot sector.

Loading the Boot Sector (0x7C00)

BIOS reads the first sector (512 bytes) of the highest‑priority boot device. If the last two bytes are 0x55AA, BIOS treats it as a boot sector, copies it to memory address 0x7C00, and jumps the PC register there.

The boot sector typically contains assembly like:

; hello‑os
ORG 0x7c00
entry:
  MOV AX,0
  MOV SS,AX
  MOV SP,0x7c00
  MOV DS,AX
  MOV ES,AX
  MOV SI,msg
putloop:
  MOV AL,[SI]
  ADD SI,1
  CMP AL,0
  JE fin
  MOV AH,0x0e
  MOV BX,15
  INT 0x10
  JMP putloop
fin:
  HLT
  JMP fin
msg:
  DB 0x0a,0x0a
  DB "hello‑os"
  DB 0x0a
  DB 0
  RESB 0x7dfe-$
  DB 0x55,0xaa

The ORG 0x7c00 directive tells the assembler that the code will be loaded at that address, and the final two bytes (0x55, 0xAA) mark the sector as bootable.

Summary of the Boot Sequence

Power‑on forces PC = 0xFFFF0, entering BIOS.

BIOS jumps to 0xFE05B and performs hardware initialization.

BIOS loads the 512‑byte boot sector from the first boot device into 0x7C00 and jumps there.

The boot sector code loads the operating system kernel and transfers control to it.

After these steps the operating system takes over, handling segmentation, paging, interrupt tables, device drivers, memory management, process management, file systems, and user‑mode interfaces.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BIOSBoot Processbootloadermemory mapping
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.