CS FundamentalsVery hardGATE CS · Advanced

A 32-bit machine uses two-level paging with 4 KB pages and 4-byte entries (10 bits for the top level, 10 for the second level, 12 for the offset), so every table is exactly one page. A process maps exactly these virtual regions: 3 MiB starting at 0x00000000; 6 MiB starting at 0x3FE00000; 4202496 bytes starting at 0x7FFFF000; and 2 MiB starting at 0xBFE00000. What is the minimum total size of its page tables?

  1. A. 32 KB
  2. B. 33 KB
  3. C. 28 KB
  4. D. 36 KB

Correct answer: A. 32 KB

One top-level table plus one second-level table for every distinct 4 MiB-aligned slice touched: slice numbers are [0, 255, 256, 511, 512, 513, 767], i.e. 7 tables. Regions that straddle a 4 MiB boundary need two second-level tables, and adjacent regions in one slice share one. Total (1 + 7) x 4 KB = 32 KB.

More Operating Systems questions

Exams that ask this topic