OS Structure
Monolithic kernels
Most general-purpose operating systems — including Linux, the BSDs, and Windows — use a monolithic kernel architecture. The entire kernel runs in a single address space in kernel mode. All kernel services (scheduling, memory management, file systems, networking, device drivers) live inside this space and can call each other directly.
Advantages:
- Fast cross-component calls (simple function calls, no IPC overhead).
- Straightforward to implement initially.
- Good performance for tightly-coupled subsystems.
Disadvantages:
- A bug in any component (e.g., a device driver) can crash the whole kernel.
- Large codebase; harder to verify correctness.
- Adding or updating components often requires rebuilding and rebooting (though Linux kernel modules mitigate this somewhat).
Microkernels
A microkernel strips the kernel down to the bare minimum — typically address spaces, threads, and inter-process communication (IPC) — and runs everything else (file systems, networking, device drivers) in user-mode server processes.
Examples: MINIX, L4, seL4, QNX, the GNU Hurd.
Advantages:
- A crash in a file-system server does not bring down the kernel.
- Servers can be started, stopped, and updated independently.
- Smaller trusted computing base (TCB) — easier to verify formally.
Disadvantages:
- Cross-component communication goes through IPC, which is slower than direct function calls.
- Real-world microkernels often bring key servers back into kernel space for performance, blurring the distinction.
Hybrid kernels
Most modern desktop OSes (Windows NT, macOS XNU) are hybrid kernels: they retain a monolithic core but run some services (e.g., graphics, USB) in user mode. The goal is to get microkernel-like modularity without paying the full IPC cost. Linux is sometimes described as hybrid when kernel modules are loaded, but its core architecture is monolithic.
Unikernels
A unikernel compiles the application and the minimal OS library into a single address space that runs directly on the hypervisor. There is no user/kernel split — everything runs at the highest privilege. Unikernels are used for cloud workloads where a full OS would be overhead.
Example: MirageOS (OCaml).
Exokernels
An exokernel takes the opposite approach: instead of abstracting hardware away, it securely multiplexes it, giving each application a raw slice (disk blocks, physical memory frames, network rings). The application’s own library OS decides how to use them. This gives applications maximum control at the cost of making them more complex.
OS components (monolithic view)
Regardless of architecture, every general-purpose OS contains:
| Subsystem | Responsibility |
|---|---|
| Process manager | Creating, scheduling, and terminating processes |
| Memory manager | Allocating and protecting physical and virtual memory |
| File system | Organising and persisting data on stable storage |
| I/O subsystem | Managing devices, buffering, and interrupt handling |
| Protection subsystem | Enforcing access control and isolation |
| Network stack | Protocols (TCP/IP) and sockets |
Summary
- Monolithic kernels (Linux, BSDs) are fast but fragile.
- Microkernels (L4, seL4) are robust but pay IPC costs.
- Real-world systems are often hybrids.
- Exokernels and unikernels represent opposing extremes on the abstraction-control spectrum.