Master the fundamental concepts of memory hierarchy through this focused micro-challenge.
x86-64 uses a four-level tree: PML4, PDPT, PD, PT. Each non-leaf entry points at the next table; leaf PTEs hold the physical frame plus permission bits (present, writable, user).
cLoading…
For example, virtual 0x00401000 splits into indices that index each table level; a missing present bit stops the walk and raises #PF.
For this exercise, you will simulate a walk that returns a physical address or fault code. This task asks you to model PTE bits explicitly, matching what the OS track's memory manager will install when mapping heap pages.
Keep the relevant datasheet, ISA manual, or architecture textbook chapter open while you implement. When your output disagrees with the reference trace on the same program, the bug is usually a mis-decoded opcode, a stale register read, or a flag bit left unchanged after arithmetic.
For this exercise, you will use those habits while implementing the requirement in the starter code. Microarchitectural product names change across CPU generations, but the control ideas (fetch, bypass, cache lines, vector lanes) stay stable enough to debug from first principles.
Simulate page table walk for address translation.
Requirements:
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