A database system bypasses the OS file system and directly manages disk blocks itself. Which OS design principle best explains why a database might choose to do this?
AProtection — the database needs to prevent other processes from accessing its data
BResource management — the database wants fair CPU scheduling for its queries
CAbstraction — the file system abstraction imposes an impedance mismatch that hurts performance
DFairness — the OS's allocation policy treats the database the same as other processes
The file system abstraction is designed for the general case and makes decisions about buffering, caching, and block layout that a database may not want. Databases have domain-specific knowledge — write ordering for crash recovery, precise access patterns, specific durability guarantees — that the file system abstraction obscures or overrides. Bypassing the abstraction trades portability and simplicity for control: a classic abstraction-versus-performance tradeoff. Protection (A) concerns isolating processes from each other, not bypassing abstractions for performance.
Question 2 Multiple Choice
Which OS design principle most directly explains why application programs cannot execute privileged CPU instructions directly?
AAbstraction — applications should not need to know about CPU instruction sets
BResource management — the CPU must be shared fairly among all processes
CPerformance — privileged instructions execute more slowly from user mode
DProtection — preventing applications from accessing hardware they are not authorized to use
The kernel/user mode distinction is fundamentally a protection mechanism. Applications run in restricted mode where privileged instructions — those controlling memory mapping, I/O devices, or interrupt handling — cause exceptions that the kernel handles. This isolates processes from each other and from the kernel: a buggy or malicious application cannot corrupt hardware state that other processes depend on. Abstraction (A) hides hardware complexity behind clean interfaces, which is a different goal from preventing unauthorized access.
Question 3 True / False
Strict round-robin scheduling that gives equal CPU time to all processes can reduce overall system throughput compared to priority-based scheduling.
TTrue
FFalse
Answer: True
Equal time slices for all processes is 'fair' in the sense that no process is favored, but it can reduce throughput by allocating CPU time to idle or I/O-bound processes that cannot use it productively, while CPU-bound processes with pending work wait their turn. This is the fundamental tension between fairness and efficiency: fairness treats all processes equally; efficiency allocates resources where they produce the most useful work. Real schedulers (like multilevel feedback queues) sacrifice strict fairness to improve throughput and responsiveness.
Question 4 True / False
Abstraction typically improves OS performance because it hides hardware complexity, allowing the OS to optimize underneath without applications knowing.
TTrue
FFalse
Answer: False
Abstraction often hurts performance rather than helping it. Each abstraction layer adds indirection, copying, and generality that specialized implementations could avoid. A database bypassing the file system, a game bypassing the audio API to use ASIO, or a network application using raw sockets — all trade abstraction for performance. The OS can optimize beneath the abstraction, but only for the general case; applications with specific access patterns often know better. The benefit of abstraction is portability, simplicity, and maintainability — not performance.
Question 5 Short Answer
Explain why protection and performance are in tension in operating system design.
Think about your answer, then reveal below.
Model answer: Protection enforces boundaries between processes and between user code and the kernel. Every crossing of those boundaries costs time: a system call requires saving CPU state, switching from user mode to kernel mode, executing the kernel service, and switching back — hundreds to thousands of nanoseconds per call. MMU-based memory protection checks every memory reference against page tables, adding latency to every access. Without protection, a process could call hardware directly and skip all of this — but at the cost of allowing any process to crash or corrupt the entire system. The OS must continuously balance the overhead of enforcement against the safety guarantees it provides.
Every major OS design debate — monolithic kernel vs. microkernel, preemptive vs. cooperative scheduling — is a specific instance of this tension. Monolithic kernels are faster (no mode switches between kernel services) but harder to isolate. Microkernels are better isolated but slower due to inter-process communication. Modern OSes use mechanisms like vDSO to reduce the overhead of frequent system calls while maintaining protection.