CS FundamentalsVery hardProduct company interview · GATE level
A 32-bit system uses two-level paging: 10 bits for the outer index, 10 bits for the inner index and a 12-bit offset, with 4-byte entries (so every table is one 4 KB page). A process uses only an 8 MB region starting at virtual address 6 MB (0x00600000) and a 6 MB stack at the very top of the address space. Page tables are created only where needed. How much memory do its page tables occupy?
- A. 20 KB
- B. 24 KB
- C. 4 MB
- D. 32 KB
Correct answer: B. 24 KB
Each inner table maps 1024 x 4 KB = 4 MB. The 8 MB region covers 6 MB to 14 MB, which touches the 4 MB slices 1 (4-8 MB), 2 (8-12) and 3 (12-16): 3 inner tables, not 2, because it does not start on a 4 MB boundary. The stack covers 4090-4096 MB, touching slices 1022 and 1023: 2 inner tables. With the outer table that is 1 + 3 + 2 = 6 pages = 24 KB. 20 KB assumes 8 MB needs only 2 inner tables; 4 MB is the size of a flat single-level table.
More Operating Systems questions
- A 32-bit system uses two-level paging with a 10-bit outer index, a 10-bit inner index and a 12-bit offset. The virtual address 0xC0A8F3E7…
- A system with a TLB and a two-level page table has TLB access time 10 ns (searched before memory), memory access time 100 ns and a TLB hit…
- Memory access takes 200 ns. A page fault takes 8 ms to service if the replaced page is clean and 20 ms if it is dirty, and 40% of replaced…
- An inode has 10 direct pointers, one single-indirect, one double-indirect and one triple-indirect pointer. Blocks are 2 KB and block…
- A Unix-style inode has 12 direct pointers plus single-, double- and triple-indirect pointers; blocks are 4 KB and pointers 4 bytes. With…
- Each process in a system spends 70% of its time waiting for I/O, independently of the others. Using the model CPU utilisation = 1 - p^n…