CS FundamentalsEasyGATE CS (PYQ pattern)
A user-mode process accesses virtual pages with page-table entries (present, writable, user-accessible): page 0 (1,1,1), page 1 (1,0,1), page 2 (0,1,1), page 3 (1,1,0), page 4 (1,0,0), page 5 (1,1,1). The access sequence is: read 0, write 1, read 2, read 3, write 4, write 5, read 1, write 2, write 3. A fault on a non-present page is a page fault; a present page that is not user-accessible or is written while read-only gives a protection fault. How many page faults and protection faults occur?
- A. 3 page faults, 3 protection faults
- B. 2 page faults, 5 protection faults
- C. 1 page faults, 5 protection faults
- D. 2 page faults, 4 protection faults
Correct answer: D. 2 page faults, 4 protection faults
Page 2 is not present (read 2 and write 2: 2 page faults). Protection faults: write 1 (read-only), read 3 and write 3 (kernel page), write 4 (kernel page) = 4. Read 0, write 5 and read 1 succeed.
More Operating Systems questions
- Locks are ordered L1 < L2 < L3 < L4 and every thread must acquire locks in increasing order. A thread acquires locks in the following…
- Memory (in KB, from address 0): OS 100, process A 150, hole 60, B 200, hole 90, C 120, hole 80, D 100, hole 100. Compaction slides every…
- A 100 MB process is swapped out and later swapped back in on a disk that transfers 50 MB/s with an 8 ms latency per transfer. Swap-out…
- Disk requests arrive as a Poisson stream of 100 per second; service times are exponential (M/M/1 per disk). Option X buys one disk twice…
- Round Robin uses a 20 ms quantum and every context switch costs 2 ms; all n processes are CPU-bound and always use the full quantum. From…
- A ticket lock has nextticket = 10 and nowserving = 10 (free). Events in order: T1 acquires, T2 acquires, T3 acquires, T1 releases, T4…