The Story of Linux · #1 of 19

What is an Operating System?

Kernel, Userspace & Hardware

The Big Picture

An operating system is the middleman between you and the raw hardware. Without it, you’d have to manually manage memory addresses, CPU cycles, and disk sectors. The OS abstracts all that complexity away.


The Kernel: Heart of the System

The kernel is the core of any operating system. It’s the only software that talks directly to hardware.

What the Kernel Does:

Linux Kernel Architecture:

┌─────────────────────────────────────────────┐
│              USER SPACE                      │
│  ┌─────────┐ ┌─────────┐ ┌─────────┐        │
│  │ Firefox │ │ VS Code │ │ Terminal│  ...   │
│  └────┬────┘ └────┬────┘ └────┬────┘        │
│       │           │           │              │
│  ═════╧═══════════╧═══════════╧═════════════│
│           System Call Interface              │
│  ═══════════════════════════════════════════│
│              KERNEL SPACE                    │
│  ┌──────────┬──────────┬──────────┐         │
│  │ Process  │  Memory  │   VFS    │         │
│  │ Scheduler│ Manager  │(Filesys) │         │
│  └──────────┴──────────┴──────────┘         │
│  ┌──────────────────────────────────┐       │
│  │         Device Drivers           │       │
│  │   (disk, network, GPU, USB...)   │       │
│  └──────────────────────────────────┘       │
└─────────────────────────────────────────────┘

            ┌───────┴───────┐
            │   HARDWARE    │
            │ CPU RAM DISK  │
            └───────────────┘

User Space: Where You Live

Everything above the kernel is user space:

User programs can’t touch hardware directly. They make system calls to ask the kernel nicely.


Monolithic vs Microkernel

Linux uses a monolithic kernel: drivers run inside kernel space for performance.

Microkernels (like MINIX, Mach) run drivers in user space — more stable but slower.

MONOLITHIC (Linux)          MICROKERNEL (Mach)
┌────────────────┐          ┌────────────────┐
│   User Space   │          │   User Space   │
├────────────────┤          │  ┌──────────┐  │
│                │          │  │ Drivers  │  │
│     Kernel     │          │  └────┬─────┘  │
│   + Drivers    │          ├───────┼────────┤
│                │          │  Microkernel   │
└────────────────┘          └────────────────┘
     Faster                    More Stable

Systems Engineering Perspective

Think of your computer as a bustling city, and the OS as its government:

The OS as Resource Manager

CPU Scheduling → Air Traffic Controller

Memory Management → Librarian

Device Drivers → Translators

Abstraction Layers

Each layer hides complexity from the layer above:

┌──────────────────────────────┐
│   Applications               │ → "Save this file"
├──────────────────────────────┤
│   System Libraries (glibc)   │ → "Write bytes to fd 3"
├──────────────────────────────┤
│   System Calls               │ → write(3, buffer, size)
├──────────────────────────────┤
│   Kernel (VFS Layer)         │ → Translate to filesystem ops
├──────────────────────────────┤
│   Filesystem Driver (ext4)   │ → Translate to block writes
├──────────────────────────────┤
│   Block Device Driver        │ → Send SATA commands
├──────────────────────────────┤
│   Hardware Controller        │ → Physical disk write
└──────────────────────────────┘

Each layer knows nothing about the layers below — that’s abstraction.

Trade-offs Everywhere

Performance vs Safety

Flexibility vs Complexity

Isolation vs Efficiency

The OS is basically a very sophisticated referee that keeps your programs from fighting over resources like toddlers over toys. It enforces fair sharing, prevents bullying, and sends troublemakers to timeout (kills crashed processes).


“Everything is a File”

This is Linux’s most powerful idea. Almost everything is represented as a file:

PathWhat It Represents
/dev/sdaFirst hard disk
/dev/nullBlack hole (discards data)
/dev/randomRandom number generator
/proc/cpuinfoCPU information
/sys/class/net/Network interfaces

You can read CPU temperature, control LED brightness, or check battery status — all by reading/writing files.


Why This Matters

Understanding the OS architecture helps you: