Dulranga's Notes
Semester 3Operating Systems

Operating System Structures

Operating systems structured mainly considering the security. They are structured in one question in mind. "How much code should execute in privileged Kernel Mode versus unprivileged User Mode?"

There are two different modes in an OS.

  1. User Mode
  2. Kernel Mode

User Mode vs Kernel Mode

Main Kernel Architectures

there are two types of kernels

  1. Monolithic Kernels
  2. Micro-Kernel

kernel-types.png

Monolithic Kernel ("All-in-One")

In a monolithic design, the entire operating system runs as a single, large program in Kernel Mode. Memory management, CPU scheduling, file systems, device drivers, and networking stacks all share the same memory space.

  • Pros: Maximum performance. Direct function calls inside shared memory mean zero switching overhead between protection levels.

  • Cons: Fragile security. A bug or memory leak in a single third-party graphics driver can crash the entire OS (a Kernel Panic or Blue Screen).

  • Examples: Linux, FreeBSD, MS-DOS.

Microkernel ("Bare Minimum Core")

A microkernel strips kernel space down to its absolute essence: basic memory management, thread scheduling, and Inter-Process Communication (IPC). Everything else—file systems, network drivers, peripheral control—is pushed out into User Mode as separate server processes.

  • How it works: When an app wants to read a file, it sends an IPC message to the Microkernel, which routes that message to a User-Space "File System Server."

  • Pros: High security and crash isolation. If the file system server or a device driver crashes, it dies as an isolated user process. The kernel restarts it without crashing the machine.

  • Cons: IPC Performance Overhead. Constant context switching between User Mode and Kernel Mode to pass messages slows down execution.

  • Examples: QNX, Minix 3, L4 kernel family.

Subset Kernels

Hybrid Kernel

this is the modern standard. (best of both worlds). It uses a microkernel-style architecture with well-defined server subsystems, but runs these critical subsystems inside Kernel Space to eliminate the performance penalty of message passing.

Examples:

  • Windows NT (11/10/Server): Combines a microkernel core with executive services and drivers running in kernel space.
  • macOS / iOS (XNU Kernel): Combines Mach (a microkernel) and BSD (monolithic Unix) into a single kernel-space executable.

Nanokernel

An ultra-lightweight layer beneath the OS that provides hardware abstraction, frequently used in virtualized environments or simple embedded microcontrollers. Main goal is to provide the bare minimum to do the job with as little as resource usage

Exokernel

These remove the hardware abstraction layer completely. and provide safe environment to access raw physical hardware directly.

On this page