A minimal and sleek daily developer productivity tracker.
Linux follows a layered architecture model where each layer provides specific services to the layer above it and uses services from the layer below.
┌─────────────────────────────────────────────────────────────┐
│ USER APPLICATIONS │
│ (Web Browsers, Text Editors, Games, Office Applications) │
├─────────────────────────────────────────────────────────────┤
│ SYSTEM LIBRARIES │
│ (glibc, pthread, OpenSSL) │
├─────────────────────────────────────────────────────────────┤
│ SYSTEM CALLS │
│ (Interface between User & Kernel Space) │
├─────────────────────────────────────────────────────────────┤
│ LINUX KERNEL │
│ ┌─────────────┬─────────────┬─────────────┬─────────────┐ │
│ │ Process │ Memory │ File │ Device │ │
│ │ Management │ Management │ System │ Drivers │ │
│ └─────────────┴─────────────┴─────────────┴─────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ HARDWARE │
│ (CPU, RAM, Storage, Network, Input/Output Devices) │
└─────────────────────────────────────────────────────────────┘
Components:
Key Points:
The kernel is the core of the operating system that manages system resources.
Process Management:
Memory Management:
File System Management:
Device Drivers:
Bridge between user space and kernel space.
Common System Calls:
System Call Mechanism:
User Application
↓
System Call Interface
↓
Kernel Mode Switch
↓
Kernel Function Execution
↓
Return to User Mode
Provides high-level programming interfaces.
Key Libraries:
Applications that end users interact with.
Categories:
┌─────────────────────────────────────┐
│ USER SPACE │
├─────────────────────────────────────┤
│ │
│ ┌─────┬─────┬─────┬─────┬─────┐ │
│ │ FS │ Net │ Mem │Proc │Dev │ │ KERNEL
│ │ │ │ Mgmt│Mgmt │Drv │ │ SPACE
│ └─────┴─────┴─────┴─────┴─────┘ │
│ │
├─────────────────────────────────────┤
│ HARDWARE │
└─────────────────────────────────────┘
Advantages:
Disadvantages:
┌─────────────────────────────────────┐ ← 0xFFFFFFFF (4GB)
│ KERNEL SPACE │
│ ┌─────────────────────────────┐ │
│ │ Kernel Code & Data │ │
│ ├─────────────────────────────┤ │
│ │ Device Drivers │ │
│ ├─────────────────────────────┤ │
│ │ Kernel Stack/Heap │ │
│ └─────────────────────────────┘ │
├─────────────────────────────────────┤ ← 0xC0000000 (3GB)
│ USER SPACE │
│ ┌─────────────────────────────┐ │
│ │ Stack │ │ ← High Addresses
│ │ ↓ │ │
│ │ │ │
│ │ ↑ │ │
│ │ Heap │ │
│ ├─────────────────────────────┤ │
│ │ Uninitialized Data │ │
│ │ (BSS) │ │
│ ├─────────────────────────────┤ │
│ │ Initialized Data │ │
│ ├─────────────────────────────┤ │
│ │ Program Code │ │ ← Low Addresses
│ │ (Text) │ │
│ └─────────────────────────────┘ │
└─────────────────────────────────────┘ ← 0x00000000
Process of saving current process state and loading another process:
Process A Running → Save State → Load Process B State → Process B Running
┌─────────────────────────────────────┐
│ Desktop Environment │
│ (GNOME, KDE, XFCE, etc.) │
├─────────────────────────────────────┤
│ Display Server │
│ (X11, Wayland) │
├─────────────────────────────────────┤
│ Init System │
│ (systemd, SysV, OpenRC) │
├─────────────────────────────────────┤
│ System Libraries │
│ (glibc, etc.) │
├─────────────────────────────────────┤
│ Linux Kernel │
├─────────────────────────────────────┤
│ Hardware │
└─────────────────────────────────────┘