CS FundamentalsHardGATE CS (PYQ pattern)

A 32-bit machine uses two-level paging with 10 + 10 + 12 address bits. For the running process, root-table entries 3 and 0x2FF are valid and point to second-level tables in frames 0x0A0 and 0x0B1 (all other root entries are invalid). Table 0x0A0 has valid entries 2 -> frame 0x1F7 and 0x3FF -> frame 0x1F7; table 0x0B1 has valid entries 0 -> frame 0x1F7 and 5 -> frame 0x1F8. How many virtual addresses translate to physical address 0x1F7A5C, and what is the largest?

  1. A. 3; 0x2FF00A5C
  2. B. 2; 0x00FFFA5C
  3. C. 3; 0xBFF00A5C
  4. D. 3; 0xBFC00A5C

Correct answer: D. 3; 0xBFC00A5C

Physical 0x1F7A5C is frame 0x1F7, offset 0xA5C. Three mappings reach frame 0x1F7: (3, 2) -> 0x00C02A5C, (3, 0x3FF) -> 0x00FFFA5C and (0x2FF, 0) -> 0x2FF << 22 = 0xBFC00000, giving 0xBFC00A5C. Writing the root index as the top hex digits (0x2FF00A5C) ignores that it occupies 10 bits, not 12.

More Operating Systems questions

Exams that ask this topic