CSS Optional — Paper-II, Section-A · P-II.III.I (cont.) · Previously missing from this vault — added because "Structures, and Operations" is named explicitly in the syllabus line for this topic, distinct from Classification (which is about purpose, not internal architecture).

1. OS Structures (how the OS itself is internally organized)

graph TD
    S["OS Structures"] --> M["Monolithic<br>(all in one address space)"]
    S --> L["Layered<br>(strict layer-on-layer)"]
    S --> MK["Microkernel<br>(minimal kernel + user-space servers)"]
    S --> MOD["Modular<br>(loadable kernel modules)"]
    S --> H["Hybrid<br>(monolithic core + microkernel-style modules)"]
Structure Idea Strength Weakness Example
Monolithic Entire OS (process/memory/file/device management) runs together in one large privileged program Fast — direct function calls, no IPC overhead A bug/crash in any driver can crash the whole system; hard to maintain Traditional UNIX, original Linux
Layered OS built as a stack of layers, each using only the services of the layer directly below it Easy to design, debug, and verify layer by layer Strict layering hurts performance (every call may cascade through layers); hard to define correct layer boundaries THE (early academic OS)
Microkernel Only bare minimum (IPC, minimal scheduling, minimal memory management) runs in kernel mode; file systems, drivers, network stacks run as user-space "servers" Robust, secure, modular — a failing server can be restarted without crashing the kernel Performance overhead from extra message-passing/context switches Minix, QNX
Modular Monolithic-style kernel core, but functionality added/removed at runtime as loadable kernel modules Combines monolithic speed with some of microkernel's flexibility Modules still typically run in the same privileged space, so a bad module can still crash the kernel Modern Linux, Solaris
Hybrid A monolithic-like core for performance, with some services designed in a microkernel-like modular fashion Pragmatic performance/robustness balance More complex design decisions about what goes where Windows NT-family, macOS (XNU)

2. Dual-Mode Operation

To protect the OS and other processes from a malfunctioning or malicious program, hardware provides at least two modes, tracked by a mode bit:

When a user program needs a privileged operation, it cannot execute it directly — it must invoke a system call, which switches the mode bit to kernel mode for the duration of that service, then switches back.

3. System Calls

A system call is the programming interface through which a user-space program requests a service from the kernel (the only sanctioned door between the two modes).

Category Examples
Process control create/terminate process, load/execute, wait, allocate memory
File management create/delete/open/close/read/write a file
Device management request/release a device, read/write, attach/detach
Information maintenance get/set time, date, system data, process/file attributes
Communication send/receive messages, create/delete a communication connection
Protection get/set file permissions, allow/deny access

Mechanism: a system call is invoked (commonly via a library wrapper), which executes a special trap instruction; this switches to kernel mode and transfers control to a fixed entry point in the OS, which looks up the requested service by its system call number in a table, executes it, then returns control (and mode) back to the user process.

4. OS Operations

5. Virtual Machines (a structure question examiners increasingly ask alongside monolithic/microkernel)

A Virtual Machine (VM) uses a software layer — the hypervisor (Virtual Machine Monitor, VMM) — to present each guest OS with what looks like its own dedicated hardware, even though several guests share one physical machine.

Type Where the hypervisor runs Example
Type 1 (bare-metal / native) Directly on the hardware, no host OS underneath VMware ESXi, Xen, Microsoft Hyper-V
Type 2 (hosted) As an application on top of a conventional host OS VMware Workstation, Oracle VirtualBox