PadhaikoAll subjects

Past exam question: 2070 (Past Questions), QE

Operating System · 4 marks

Open in the Padhaiko app

Topic: Introduction

Question

Explain operating system as an extended machine? Distinguish between Kernel and Micro-Kernel. Explain the purpose of system call.

Solution

The Operating System as an Extended Machine: At the bare hardware level, a computer consists of complex, primitive electronic devices: processor registers, arithmetic logic units, interrupt lines, bus arbiters, and secondary storage controllers with intricate command protocols. Programming hardware directly requires navigating raw sector numbers, cylinder seek timings, and register bitmasks—a difficult, highly specialized, and error-prone process.

The operating system presents a top-down view by acting as an extended machine (or virtual machine):

Distinction Between Monolithic Kernel and Micro-Kernel: The core architectural debate in operating system design concerns how many components belong inside privileged supervisor mode (kernel space) versus unprivileged user mode:

DimensionMonolithic Kernel (Traditional Kernel)Micro-Kernel
Architectural ConceptAll operating system services execute together inside a single, large address space with full supervisor privileges (Ring 0).Strips the kernel down to the absolute minimal set of mechanisms necessary to run an OS; all other services run as user-space daemons.
Components in Kernel ModeCPU scheduling, virtual memory, file systems, IPC, networking stacks, and device drivers.Core address space management, low-level thread scheduling, and Inter-Process Communication (IPC).
Components in User ModeApplication programs and standard user-space utility libraries only.File system servers, network servers, device drivers, and user applications.
Inter-Service CommunicationDirect, highly efficient internal C function calls and shared memory structures.Message passing mediated by the microkernel via IPC primitives.
Fault Isolation & StabilityLow; a single memory bug or crash in a device driver can trigger a fatal kernel panic and crash the entire machine.High; a crash in a user-space file server or driver does not affect the kernel and can be restarted transparently without rebooting.
Performance OverheadOptimal; zero IPC context-switch penalty between OS subsystems.Moderate overhead due to frequent context switches and message copying across user-kernel boundaries.
Representative ExamplesLinux, FreeBSD, Solaris, traditional UNIX.QNX Neutrino, Minix 3, seL4, Mach.

Purpose of System Calls: Modern microprocessors enforce dual-mode execution (User Mode vs. Kernel Mode) to safeguard the operating system and prevent rogue processes from compromising system stability. User applications execute in unprivileged user mode and are strictly barred by hardware from executing privileged instructions or touching physical device controllers.

The system call fulfills three indispensable purposes:

  1. Secure Privilege Escalation: Provides the only authorized software mechanism through which an unprivileged user process can safely invoke privileged kernel routines via a hardware trap (e.g., syscall or int 0x80), which switches the processor into kernel mode at trusted entry points.
  2. Access Control and Parameter Validation: Ensures security by requiring the kernel to inspect and validate all user-supplied pointers, buffer bounds, and access permissions in supervisor space before modifying hardware or executing sensitive tasks.
  3. Consistent Hardware Abstraction Interface: Exposes a clean, portable Application Programming Interface (e.g., POSIX read(), write(), fork(), open()) so that applications can interact uniformly with disks, networks, and memory without requiring hardware-specific implementations.
Answer:

The OS acts as an extended machine by transforming primitive, complex hardware components into convenient, high-level abstractions like files, processes, and virtual memory. A Monolithic Kernel runs all OS services (file systems, drivers, networking) in a single privileged kernel space for maximum performance but vulnerable fault isolation, whereas a Micro-Kernel keeps only minimal primitives (IPC, low-level scheduling) in kernel space while running drivers and file systems as isolated user-space servers for superior reliability. System calls serve as the hardware-protected gateway allowing user applications to safely request privileged kernel operations via traps with strict parameter validation.

All past exam questions for Operating System