OS Structure·Lesson 1 of 10
OS Structure Overview
What "Structure" Means Here
An operating system is not one giant program. It's a collection of parts, each responsible for a different job, arranged in a deliberate way. "OS structure" is simply the question of how those parts are organized: which pieces are trusted with full control of the hardware, which pieces are kept at arm's length, and how they talk to each other. Different operating systems answer that question differently, and those answers are the architectures you'll meet in this topic.
The one thing to remember
Every OS structure is a trade-off between speed and safety. Put everything in one trusted block and it runs fast, but one bug can crash the machine. Split it into isolated pieces and a crash stays contained, but every conversation between pieces costs time.
A restaurant with a kitchen door
Customers sit in the dining room and never walk into the kitchen. They tell a waiter what they want, the waiter carries the order through the kitchen door, and the food comes back out. The kitchen has the knives, the fire, and the raw ingredients — dangerous things you don't hand to customers. An operating system works the same way: your apps sit in the dining room, the kernel is the kitchen, and requests pass through one controlled door.
Two Worlds: User Space and Kernel Space
Before you can talk about architectures, you need one idea: memory and privileges are split into two worlds. The is the core of the OS, and it runs in where it can touch any piece of hardware and any byte of memory. Your programs — the browser, the code editor, the music player — run in , where the hardware physically refuses to let them do anything dangerous.
The CPU itself enforces the split. It keeps a that says which world it is currently in. In every instruction is allowed. In the privileged instructions — halt the CPU, change the memory map, talk directly to a disk controller — are simply blocked. When a program needs one of those things done, it has to ask the kernel through a .
Stacked up, a typical system looks like this — read it from the top down, from what you click to the silicon underneath:
A running system, top to bottom
Application Programs
Browsers, editors, games — whatever you installed to get work done
System Programs & Libraries
The shell, file utilities, compilers, and the standard C library
System Call Interface
The one controlled doorway between user space and the kernel
Kernel
Scheduler, memory manager, file systems, device drivers, IPC
Hardware
CPU, RAM, disks, network cards, keyboard, screen
Where the architectures differ
Notice that only one box in that stack is labelled "kernel space". Every OS architecture in this topic is really an argument about how much goes inside that box. Monolithic says "everything". Microkernel says "almost nothing". The rest sit somewhere in between.
What the Kernel Is Responsible For
Whatever the architecture, the same set of jobs has to get done somewhere. In a monolithic kernel they all live inside the kernel; in a microkernel most of them are pushed out to user space. Either way, this is the work:
Core operating system responsibilities
- Process management — creating, scheduling, pausing, and terminating running programs
- Deciding which process gets the CPU next, and switching between them
- Memory management — handing out RAM and keeping each process inside its own space
- Tracking which pages of memory belong to whom, and swapping to disk when RAM runs short
- File system management — turning raw blocks on a disk into files and folders
- Permissions, directories, and keeping the on-disk layout consistent
- Device management — driving the keyboard, screen, disk, and network card through device drivers
- Inter-process communication — letting separate processes exchange data through pipes, messages, or shared memory
- Protection and security — enforcing who is allowed to read, write, or run what
Why the Arrangement Matters
It's tempting to think this is an academic question. It isn't. Where a piece of code lives decides what happens when that code has a bug. A printer driver running inside the kernel that dereferences a bad pointer can take the entire machine down — that's the classic Windows blue screen or Linux kernel panic. The same driver running as an ordinary user-space program would just crash itself, and the OS could restart it while everything else kept running.
The catch is cost. Two pieces of code inside the kernel talk to each other with a plain function call, which takes a handful of nanoseconds. Two pieces separated across the user/kernel border have to exchange messages, and every message means saving state, switching privilege levels, and switching back. Do that millions of times a second and the difference becomes very real.
The Main Architectures
Here are the five structures you'll be asked about, roughly in the order they appeared historically. Each one gets its own lesson in this topic — this is the map before the detail.
Simple Structure
Barely structured at all. Interfaces and functionality are not cleanly separated, and application programs can reach the hardware directly. MS-DOS is the textbook example — a bad program could overwrite the OS itself.
Monolithic Kernel
Every OS service — scheduler, memory manager, file systems, drivers, networking — runs together in one address space in kernel mode. Very fast, but very large and fragile. Traditional UNIX and Linux follow this model.
Layered Architecture
The OS is cut into numbered layers, hardware at the bottom and the user interface at the top. Each layer may only use the layer directly beneath it. Clean and easy to debug, but slower and hard to order correctly.
Microkernel
Keep only the bare minimum in the kernel — communication, basic scheduling, low-level memory. File systems, drivers, and networking become ordinary user-space servers. Reliable and secure, but message passing costs performance.
Modular Architecture
A compact core kernel plus loadable modules that can be plugged in and out while the system is running. You get extensibility without recompiling the kernel. Linux, Solaris, and macOS all work this way.
Hybrid Kernel
Borrow the modular ideas of a microkernel but keep the performance-critical services inside the kernel for speed. Windows NT and macOS are usually described this way.
One more design turns up occasionally in interviews: the . It takes minimalism even further than a microkernel by refusing to provide abstractions at all — it just safely divides up the hardware and lets each application build the abstractions it wants. It's mostly a research idea, but it shows that the spectrum doesn't end at the microkernel.
Side by Side
The fastest way to keep these straight is to compare them on the two things that actually differ: how much code sits in kernel space, and what happens when part of the OS fails.
| In kernel space | Speed | If a service crashes | Example | |
|---|---|---|---|---|
| Simple | Everything, poorly separated | Fast | System is gone | MS-DOS |
| Monolithic | All OS services | Fastest | Whole system crashes | Traditional UNIX |
| Layered | All services, in strict tiers | Slower | Whole system crashes | THE OS |
| Microkernel | Bare minimum only | Slowest | Only that server dies | QNX, Minix 3 |
| Modular | Core plus loaded modules | Fast | Whole system crashes | Linux, Solaris |
| Hybrid | Core plus key services | Fast | Usually whole system | Windows NT, macOS |
“"The operating system and the kernel are the same thing."”
Q:Why do operating systems bother with different structures? Wouldn't the fastest one always win?
A: No, because speed is only one requirement. A phone switch or a medical device values never crashing over raw throughput, so it uses a microkernel like QNX where a failed driver can be restarted. A desktop or server values throughput, so it uses a monolithic or modular kernel where services call each other directly. The structure is chosen to match what the system is for — that's why several designs still coexist.
Quick Revision Cheat Sheet
OS structure: How the parts of an OS are organized and how much runs privileged
Kernel: The always-resident core with full hardware access
User space: Unprivileged memory where normal programs run
Kernel space: Privileged memory where kernel code runs
The only doorway: System calls — the controlled path from user space into the kernel
Core trade-off: More in the kernel = faster but more fragile
Five structures: Simple, monolithic, layered, microkernel, modular, hybrid
OS is not just the kernel: Kernel plus system programs makes a usable OS