Model page translation

15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.

A virtual address can be split into page number and offset. This model uses 4096-byte pages and a dictionary from virtual page to physical frame. Real page tables also encode permissions and are managed by architecture-specific hardware and kernel code. This is a model, not access to real physical memory.

Practice and evidence: Predict the output, remove mapping 2, and handle the missing page explicitly. Add read/write permissions to your model and a test that denies a write.

page_size=4096
table={2:7}
address=2*page_size+13
page,offset=divmod(address,page_size)
print(table[page]*page_size+offset)

Expected result: 28685

Practice and evidence

Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.

Language reference: git.agilaos.com

Language reference: git.agilaos.com