CS FundamentalsVery hardGATE CS (PYQ pattern)
A machine has 46-bit virtual addresses, 16 KB pages and 4-byte page-table entries. Lower page-table levels are full 16 KB pages; the top level holds only the leftover address bits; tables exist only where needed. A process uses 1 GB starting at virtual address 0 and a 16 KB stack page at the very top of the address space. How much memory do its page tables occupy?
- A. 289 KB
- B. 320 KB
- C. 304 KB
- D. 305 KB
Correct answer: D. 305 KB
Offset 14 bits; 4096 entries per page = 12 bits per level; 32 index bits = 8 + 12 + 12, so 3 levels and a 256-entry (1 KB) top table. 1 GB = 2^16 pages needs 16 leaf tables under one middle table. The stack needs its own leaf and middle table. Total 19 x 16 KB + 1 KB = 305 KB. Forgetting the stack gives 289 KB; a full-page top table gives 320 KB.
More Operating Systems questions
- A machine has 48-bit virtual addresses, 4 KB pages and 4 GB of physical memory and uses a hashed inverted page table. Each IPT entry (one…
- A 3-level paging system has TLB lookup 20 ns and memory access 100 ns. On a TLB miss the three page-table levels are read from memory and…
- A system with a single-level page table has a TLB (lookup 10 ns, done before every access, hit ratio 90%) and a 100 ns memory; a TLB miss…
- Shared integer x = 1. Thread T1 executes x = x + 1; x = x + 1; and thread T2 executes x = x 2;. Each statement is compiled to a LOAD into…
- Semaphores a = 1, b = 0, c = 0. Four processes each run once: P1: wait(a); print 1; signal(b); signal(c). P2: wait(b); print 2; signal(a)…
- Round Robin with quantum 4 ms. Processes (arrival, burst) in ms: P1 (0, 7), P2 (1, 4), P3 (2, 9), P4 (3, 5), P5 (16, 3). A process that…