Practice
Solution
Step 1: User program issues system call
The user program executes a special instruction causing a trap to kernel mode.Step 2: CPU switches to kernel mode
Control transfers to the OS kernel with elevated privileges.Step 3: Kernel validates system call
The kernel inspects the system call number and arguments to ensure they are valid and safe.Step 4: Why other options are incorrect
The kernel copies data directly to the user buffer without validation is unsafe; kernel must validate before copying data. The user program resumes execution in user mode happens after system call completion, not immediately after mode switch. The hardware raises an interrupt to the device is unrelated here; hardware interrupts occur asynchronously, not immediately after mode switch.Final Answer:
Option A -> Option AQuick Check:
System call trap -> kernel mode -> validate call -> execute service [OK]
- Assuming kernel copies data before validation
- Confusing interrupt handling with system call flow
- Thinking user mode resumes immediately after trap
Solution
Step 1: Understand resource ordering
Ordering resources prevents circular wait by forcing processes to request resources in a global order.Step 2: Identify drawbacks
Strict ordering can cause processes to wait longer than necessary, reducing concurrency and system throughput.Step 3: Analyze other options
The system can still deadlock due to hold and wait despite ordering is incorrect because ordering eliminates circular wait, thus preventing deadlock from that condition. No preemption condition is violated by enforcing ordering is false; ordering does not violate no preemption. Mutual exclusion is no longer required when ordering is enforced is false; mutual exclusion is still required for non-shareable resources.Final Answer:
Option A -> Option AQuick Check:
Ordering trades off concurrency for deadlock prevention.
- Believing ordering removes all deadlock conditions
- Confusing ordering with preemption
- Assuming mutual exclusion is eliminated by ordering
Solution
Step 1: Understand single-level index block capacity
A single-level index block can only hold pointers to a fixed number of blocks.Step 2: What if file grows beyond index block capacity?
The single index block cannot hold more pointers, so the file cannot grow further under this scheme.Step 3: Analyze the file cannot grow further; to support larger files, multi-level or combined index schemes must be used
Correct: multi-level or combined index schemes (e.g., multi-level indexing, inode structures) are used to support larger files.Step 4: Analyze the file system automatically converts the file to contiguous allocation to accommodate growth
File systems do not convert allocation methods automatically; contiguous allocation is inflexible for growth.Step 5: Analyze the index block dynamically expands by linking to additional index blocks without performance penalty
Index blocks do not dynamically expand by linking; multi-level indexing is a designed solution.Step 6: Analyze the file system switches to linked allocation for that file to handle the extra blocks
File systems do not switch allocation methods on the fly; allocation method is fixed per file.Final Answer:
Option A -> Option AQuick Check:
Single-level index block limits file size; multi-level indexing needed for large files.
- Believing index blocks can dynamically expand
- Thinking allocation methods switch automatically
- Assuming contiguous allocation can handle dynamic growth easily
Solution
Step 1: Understand cyclic reference pattern larger than frames
Pages are referenced in a cycle longer than available frames, causing repeated evictions.Step 2: Analyze LRU vs FIFO behavior
Both algorithms will evict pages that will be needed soon because the working set exceeds frame count.
LRU's advantage diminishes as no page stays long enough to be reused before eviction.Step 3: Evaluate options
LRU will have fewer page faults because it always evicts the least recently used page is false; LRU advantage is lost in cyclic patterns larger than frames.
LRU will perform optimally and minimize page faults in cyclic patterns is false; both have similar fault rates in this scenario.
LRU will have more page faults than FIFO because it keeps evicting pages that will be needed soon is false; LRU does not necessarily have more faults than FIFO here.
LRU and FIFO will have similar page fault rates due to cyclic references exceeding frame count is true; LRU and FIFO have similar fault rates due to cyclic references exceeding frame count.Final Answer:
Option D -> Option DQuick Check:
When working set > frames, LRU and FIFO fault rates converge.
- Assuming LRU always outperforms FIFO
- Believing cyclic patterns favor LRU
- Thinking LRU is optimal in all cases
Solution
Step 1: Understand Waiting state semantics
Waiting means blocked until the awaited event(s) complete.Step 2: Multiple I/O waits in five-state model
The model treats Waiting as a single state without differentiating multiple simultaneous waits.Step 3: Limitation
This means the process stays in Waiting until all I/O events complete, limiting fine-grained concurrency.Final Answer:
Option B -> Option BQuick Check:
Five-state model does not handle multiple simultaneous waits distinctly [OK]
- Assuming process moves to Ready after any I/O completes
- Believing process can split into multiple processes automatically
- Thinking process polls I/O events while Running
