Files
agila-learning-examples/en/expanded-23-1/lesson-3/lesson.html
T

6 lines
1.4 KiB
HTML

<!doctype html><html lang="en"><meta charset="utf-8"><title>Model page translation</title><h1>Model page translation</h1><p>15-minute session: read for 3 minutes, trace for 3, experiment for 7, and complete the check for 2. Spend longer whenever you need.</p><p>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.</p><p><strong>Practice and evidence:</strong> 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.</p><pre><code class="language-python">page_size=4096
table={2:7}
address=2*page_size+13
page,offset=divmod(address,page_size)
print(table[page]*page_size+offset)
</code></pre><p><strong>Expected result:</strong> <code>28685</code></p><h3>Practice and evidence</h3><p>Keep three notes: your prediction, the actual result, and why they match or differ. The completion check grades understanding; the practice task builds skill.</p><p><a href="https://git.agilaos.com/matt/open_kernel">Language reference: git.agilaos.com</a></p><p><a href="https://git.agilaos.com/matt/agila_open_tool">Language reference: git.agilaos.com</a></p></html>