Similar questions 2 more →
Virtual Memory & Paging


Answer & solution
Answer: C (no official key was published)
1. A 10-bit index selects 1024 entries. At four bytes per entry each full table occupies 4096 bytes, one 4 KiB page.
2. One second-level table covers 1024 virtual pages, or 1024×4096=4 MiB. The code pages fall in the first 4 MiB region, top-level index 0. The data begins exactly at 4 MiB, index 1. The stack address has index 1023.
3. The two contiguous code pages share one second-level table, as do the two data pages. The stack needs a third second-level table. Add one top-level table: four tables total.
4. Storage=4×4096=16384 bytes=16 KiB, option C. Mapped content pages are not additional page-table storage.
Solution: Each page-table level has 210 entries of four bytes, so each allocated table uses 4096 bytes. The two code pages occupy top-level index 0; the two data pages starting at 0x00400000 occupy index 1; the stack page at 0xFFFFF000 occupies index 1023. Three second-level tables are therefore required, plus the first-level table. Total page-table storage is 4×4096=16384 bytes=16 KiB, option C. The five mapped code/data/stack pages are not themselves included in page-table storage.