CS FundamentalsVery hardGATE CS (PYQ pattern)

A 32-bit machine uses two-level paging with 4 KB pages, 4-byte entries and 10 + 10 + 12 address bits, so each page-table page maps 4 MB. A process uses three regions: addresses 3 MB to 9 MB, 100 MB to 102 MB, and the topmost 3 MB of the address space. Page-table pages are allocated only when needed. How much memory (in KB) do the page tables of this process occupy?

  1. A. 20
  2. B. 24
  3. C. 28
  4. D. 32

Correct answer: B. 24

The L2 tables needed: 3-9 MB spans 4 MB-slots 0, 1, 2 (3 tables); 100-102 MB lies in slot 25 (1 table); the top 3 MB lies in the last slot (1 table). That is 5 L2 tables plus 1 root = 6 pages = 24 KB.

More Operating Systems questions

Exams that ask this topic