Master the fundamental concepts of boot sector development through this focused micro-challenge.
Function AX=0xE820 returns an array of memory regions usable for planning page tables and kernel placement. Each call fills one 20-byte record: base, length, type, ACPI attributes. For example, type 1 means usable RAM; type 2 is reserved for firmware or ACPI.
nasmLoading…
EDX is mandatory on first callKernels expect a known structure like Multiboot mmap entries or a custom array tagged with a signature. Place the buffer above 0x7E00 and record the count and pointer in registers or fixed cells for stage two. Type 3 ACPI reclaim and type 2 reserved must not be treated as free RAM. If E820 returns CF on first call, your buffer or signature is wrong; verify ECX is at least 20.
You will call E820 repeatedly and store region type, base, and length records. This exercise requires handling the continuation value in EBX and distinguishing usable RAM from reserved areas.
Implement BIOS E820 memory map retrieval in boot sector code.
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