BIOS (Basic Input/Output System) is the first code that runs when you power on a computer. It lives in a small ROM chip on the motherboard and handles three jobs before anything else can happen:
Modern systems replace the old BIOS with UEFI, which adds a graphical menu, network stack, driver model, and Secure Boot. Both serve the same fundamental purpose — just with very different implementations.
When power is applied, the
CPU
always begins execution at a fixed address called the
reset vector. On classic x86 this is
0xFFFF:0x0000 (physical address 0xFFFF0),
just 16 bytes before the top of the 1 MB address space. The BIOS ROM is
mapped here so the very first instruction the CPU fetches is your code.
That 16-byte gap is too small for real code, so the reset vector is always a far jump into the main body of the BIOS:
Before any timed or interrupt-driven code can run, the BIOS must configure two essential chips:
The POST
memory test writes a pattern to each memory cell and reads it back.
Bad cells get flagged and subtracted from the usable total. The BIOS also
establishes the
BDA
(BIOS Data Area) at address 0x0400.
The IVT
at address 0x0000 maps interrupt numbers to handler routines.
The BIOS populates it with its own service routines — for example:
INT 0x10 — Video services (print character, set mode)INT 0x13 — Disk services (read/write sectors)INT 0x16 — Keyboard services (read key, check buffer)INT 0x1A — RTC / time servicesOne of the quirkiest parts of x86 history: the A20 gate. Early PCs had only 20 address lines; addresses above 1 MB wrapped silently back to 0. When Intel added the 21st address line with the 286, this wrap-around behaviour was controlled by toggling a bit in the keyboard controller, of all places.
The BIOS must enable A20 before switching the CPU to Protected Mode, otherwise memory accesses above 1 MB silently fail.
After POST the BIOS checks each device in the configured boot order
for a valid
MBR
or
GPT
partition table. Classic BIOS looks for the two-byte signature
0x55 0xAA at the end of the first sector:
UEFI takes a fundamentally different approach. Instead of a tiny assembly stub crammed into a ROM chip, UEFI is a full software ecosystem written in C with a defined API called Boot/Runtime Services.
The result: UEFI boots faster, supports modern hardware, and is far more extensible — but is also significantly more complex to implement from scratch.
This emulator simulates a real BIOS setup utility. Click Power On to watch the POST sequence, then press DEL (or click the button) to enter the BIOS Setup menu. Use ↑↓ to navigate, Enter to edit, F10 to save and exit.