NivaarExam PrepOfficial exam papers ↗

25-Comp-A5 Operating Systems · Undated paper

Question 2 of 7: Address Translation & Demand Paging

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Candidates were instructed to answer any five of the seven questions; all seven are answered below as a complete study resource.

Reference texts: Silberschatz, Galvin & Gagne, Operating System Concepts (10th ed.) — CPU scheduling (ch. 5), process synchronization/monitors (ch. 6–7), deadlocks (ch. 8), memory management/paging (ch. 9–10), mass-storage/file-system implementation and disk scheduling (ch. 11–12), protection (ch. 14); Tanenbaum, Modern Operating Systems (5th ed.), corroborating chapters on scheduling, synchronization, memory and file systems.

Question 2: Address Translation & Demand Paging (20 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

(a)–(b) Base/limit address translation

Given. (a) base = 1300, limit = 1500, logical address = 501. (b) base = 1600, limit = 1500, logical address = 1550.

Find. The physical address in each case (or the appropriate error if the logical address is invalid).

Approach. A base/limit (relocation) MMU accepts a logical address only if $0\le \text{logical} \lt \text{limit}$; if valid, physical $=$ base $+$ logical, otherwise the CPU traps an addressing error and no physical address is generated.

  1. (a) Check bounds, then translate. $501 \lt 1500$ (the limit), so the address is valid. $$\text{physical} = \text{base}+\text{logical} = 1300+501=\boxed{1801}$$
  2. (b) Check bounds first. $1550 \ge 1500$ (the limit) — the logical address lies outside the process's address space. $$\boxed{\text{Addressing error trap: no physical address is generated (1550} \ge \text{limit 1500)}}$$ This case exists specifically to test that the limit check, not just the addition, must be applied — the base value (1600) is a distractor.
Final Results – Question 2(a)–(b)
PartBaseLimitLogicalResult
(a)13001500501Physical = 1801
(b)160015001550Addressing error (1550 ≥ 1500)

(c) FIFO page faults

Given. Reference string 92, 93, 94, 95, 93, 94, 91, 96, 97, 99, 97, 99, 99, 97, 99, 91 (16 references); 3 frames; FIFO replacement.

Find. Total number of page faults.

Approach. Simulate FIFO: maintain a queue of resident pages; a reference already resident is a hit; otherwise it's a fault, and if the frames are full, evict the oldest-loaded page (front of the queue) before loading the new one.

  1. Step through the reference string, tracking the 3 resident frames in load order.
    FIFO trace, 3 frames
    Ref92939495939491969799979999979991
    Fault?FFFFhithitFFFFhithithithithitF
    Frames9292,9392,93,9493,94,9593,94,9593,94,9594,95,9195,91,9691,96,9796,97,9996,97,9996,97,9996,97,9996,97,9996,97,9997,99,91
    Each fault (F) is counted once; the table shows the resident set (in load order, oldest first) after each reference.
  2. Count the faults. Faults occur at references 92, 93, 94, 95, 91, 96, 97, 99, 91 (the last one) — nine references marked "F" in the trace. $$\boxed{\text{FIFO page faults (3 frames)} = 9}$$
Final Results – Question 2(c)
QuantityValue
Reference string length16
Frames3
Page faults (FIFO)9
Hits7

(d) Hard vs. soft real-time classification

(i) An airline reservation system is a soft real-time system: it should respond promptly, but an occasional slow response degrades user experience and may cost business, it does not endanger life or cause catastrophic failure. (ii) A spaceship direction control system is a hard real-time system: a missed deadline in attitude/thruster control can mean loss of the vehicle or crew, so every control-loop deadline must be met without exception.