Past exam question: 2073 (Past Questions), QI
Open in the Padhaiko appWhat is System Call? Explain in brief about the given architecture of operating system. i) Monolithic Architecture ii) Virtual Machine
Solution
Definition and Fundamental Role of System Calls: A system call is the programmatic mechanism that allows an unprivileged user-level application to request services directly from the operating system kernel.
- Privilege Enforcement: Modern microprocessors implement hardware privilege levels (dual-mode execution): User Mode (unprivileged) and Kernel Mode (supervisor/privileged). Application software executes strictly in user mode, preventing direct execution of privileged machine instructions (such as disabling interrupts or modifying I/O ports).
- Controlled Gateway via Software Traps: When a program needs to access physical hardware (e.g., reading a file, sending a packet, or creating a thread), it invokes a system call. The call executes a special trap instruction (e.g.,
syscallorint 0x80), which switches the processor to kernel mode, triggers execution of a trusted kernel handler, performs parameter validation, completes the operation, and drops privilege back to user mode.
Monolithic Architecture: In a monolithic operating system architecture, the entire operating system executes as a single, unified program within a single privileged kernel address space (Ring 0).
- Organization: Major subsystems—including the CPU scheduler, memory management, virtual memory paging, file systems, IPC, network protocol stacks, and device drivers—are compiled and linked together into a massive binary image.
- Communication: Subsystems interact directly through conventional, high-speed C function calls and shared internal data structures without crossing privilege or memory boundaries.
- Trade-Offs:
- Advantages: Exceptional runtime performance and low latency because there is zero inter-process communication (IPC) overhead or context-switch penalty between OS modules.
- Disadvantages: Poor fault isolation and structural vulnerability. Since all modules share one address space with full supervisor privileges, a single coding bug or memory leak in any device driver can corrupt kernel data structures and crash the entire machine (e.g., traditional UNIX, Linux).
Virtual Machine Architecture: The virtual machine architecture introduces a virtualization software layer—the Virtual Machine Monitor (VMM) or Hypervisor—directly between the physical host hardware and operating system instances.
- Organization: The hypervisor multiplexes the underlying physical hardware (CPU, physical RAM, disk arrays, network controllers) to create multiple independent, self-contained virtual machines (VMs).
- Guest Isolation: Each virtual machine presents an exact replica of bare-metal hardware to its guest operating system. A guest OS (which may itself be monolithic or microkernel) runs inside this isolated container, completely unaware of other co-located VMs.
- Trade-Offs:
- Advantages: Robust security sandboxing and fault isolation (a crash in one VM has zero impact on the hypervisor or other VMs), ability to run heterogeneous operating systems (e.g., Linux and Windows) simultaneously on one physical machine, and rapid server consolidation.
- Disadvantages: Minor performance overhead resulting from hypervisor trap-and-emulate handling and memory virtualization, though largely minimized by hardware-assisted virtualization extensions (Intel VT-x / AMD-V).
A system call is the hardware-enforced software gateway allowing user-mode applications to safely request privileged kernel services via traps. A Monolithic Architecture compiles all operating system services into a single kernel-mode address space, delivering maximum execution speed at the cost of fault isolation. A Virtual Machine Architecture employs a hypervisor to multiplex physical hardware into fully isolated virtual execution environments, maximizing security and multi-OS flexibility.