Master the fundamental concepts of the boot process: theory through this focused micro-challenge.
You have read the whole brief, and the concepts above stay free on every task. Writing and running the code needs a plan.
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
Every task includes starter code, theory, and hidden tests so you can implement and verify locally in the browser.
How it worksOn x86, reset does not begin at address zero. The hardware fetches from 0xFFFFFFF0, sixteen bytes below the 4 GB line. In real mode only the low 20 bits matter, so the CPU effectively starts at 0xFFFF0 inside the BIOS ROM. For example, with CS=0xF000 and IP=0xFFF0, the physical address is 0xF0000 + 0xFFF0 = 0xFFFF0.
CS=0xF000, IP=0xFFF0 on standard PC-class CPUscLoading…
0x7C00, a different region entirelyYou will explain the reset vector address and show the segment:offset math that yields 0xFFFF0. This exercise requires connecting the linear 0xFFFFFFF0 value to the 8086-era 1 MB real-mode view the first firmware instructions use.
The 8086 forms a physical address as (segment << 4) + offset, but it has only 20 address lines, so a sum past 0xFFFFF wraps into the first megabyte. That is the behaviour the A20 gate later made switchable. Compute the address of each segment:offset pair, and count how many land on the real-mode reset vector, 0xFFFF0.
N, then N lines SEGMENT OFFSET, both in hexadecimal.
One line per pair, segment and offset as 4 uppercase hex digits and the address as 5:
cLoading…
When the unmasked sum exceeded 0xFFFFF, the line ends with (wrapped at 1MB, 8086 has no A20). Finally, RESET-VECTOR 0xFFFF0 ALIASES: k, the number of pairs whose address is 0xFFFF0.