Master the fundamental concepts of boot sector development through this focused micro-challenge.
Stage one fits in 512 bytes: enable A20, load sectors, maybe print status. Stage two holds filesystem logic, ELF parsing, or mode switches. For example, stage one reads sectors 2-17 to 0x7E00 and executes jmp 0x0000:0x7E00 after verifying a magic constant at the buffer start.
cLoading…
Stage two can be assembled with ORG 0x7E00 so labels match the runtime address. If you use a higher load address, fix up relocations or use position-independent code for data references. Store a magic value at the front of stage two so stage one can detect a failed read before jumping into garbage. Serial debug output in stage one costs bytes but saves hours when LBA math is wrong.
You will load and jump to a second-stage image stored contiguously on disk. This exercise requires coordinating load address, entry jump, and register conventions between stages.
Create a two-stage bootloader where Stage 1 loads Stage 2.
Requirements:
Test:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github