CS FundamentalsHardGATE CS (PYQ pattern)
A machine with 4 KB pages and demand paging has a 6-byte memory-to-memory MOVE instruction stored at virtual address 0x0FFC. It copies 300 bytes from source address 0x1F80 to destination address 0x2F80, and it can only complete once every byte it touches (instruction, source and destination) is resident at the same time. What is the minimum number of frames the process must be allocated so that this instruction can ever complete?
- A. 6
- B. 3
- C. 4
- D. 5
Correct answer: C. 4
Instruction bytes 0x0FFC-0x1001 span pages 0 and 1. Source 0x1F80-0x20AB spans pages 1 and 2. Destination 0x2F80-0x30AB spans pages 2 and 3. The union is {0, 1, 2, 3}: 4 frames. Adding 2 + 2 + 2 = 6 double-counts the shared pages 1 and 2; 3 forgets that the instruction itself straddles a page boundary.
More Operating Systems questions
- Six threads each take two locks in a fixed order and hold the first while acquiring the second: T1 takes A then B, T2: B then C, T3: C…
- Four processes (arrival, burst) in ms: A (0, 7), B (1, 2), C (2, 1), D (2, 2). Scheduling is non-preemptive. Compare non-preemptive SJF…
- A 2-slot bounded buffer uses mutex = 1, empty = 2, full = 0. Two producers each insert 2 items with the (buggy) code wait(mutex)…
- SRTF (preemptive shortest remaining time first; ties go to the earlier arrival) is used for processes (arrival, burst) in ms: P1 (0, 9)…
- Preemptive priority scheduling (a smaller number means higher priority; equal priorities are served by earlier arrival, without time…
- A lottery scheduler holds a fresh draw every quantum. Process A has 100 tickets, B has 200 and C has 300 (every process always stays…