Search Knowledge

© 2026 LIBREUNI PROJECT

Operating Systems Internals / Major Systems Deep Dive

Linux Kernel and Distributions

Linux Kernel and Distributions

The Linux kernel is the most flexible operating system ever built. It can run on a $5 microcontroller or a million-dollar supercomputer. This flexibility comes from its modular architecture and two key technologies that have revolutionized modern computing: Cgroups and Namespaces.

The Core Kernel Components

1. The CFS Scheduler

The Completely Fair Scheduler (CFS) is the heart of Linux multitasking. Unlike older schedulers that used complex heuristics to guess which task was “interactive,” CFS uses a simple mathematical model: it tries to give every process a “fair” share of the CPU over a period of time.

  • It uses a Red-Black Tree to keep track of processes.
  • The process that has had the least amount of CPU time is always at the “left” of the tree and gets to run next.

2. The VFS (Virtual File System)

The VFS is what allows Linux to support hundreds of different file systems (Ext4, Btrfs, XFS, FAT32) simultaneously. It provides a common interface for all file-related system calls.

  • Everything is a File: Because of VFS, the kernel treats a network socket, a physical disk sector, and a piece of RAM as the same type of object.

The Secret Sauce: Isolation

Why is Linux so dominant in the cloud? Because it invented the building blocks for Containers (like Docker).

Namespaces

Namespaces allow the OS to “lie” to a process.

  • PID Namespace: A process thinks it is “PID 1” (the initial process), even though it is actually PID 5000 in the real system.
  • Net Namespace: A process thinks it has its own private network card and IP address.
  • Mount Namespace: A process sees its own private set of folders and disks.

Cgroups (Control Groups)

While Namespaces provide isolation (hiding things), Cgroups provide resource limits.

  • You can tell the OS: “This group of processes can never use more than 1GB of RAM and 10% of the CPU.”
  • If the processes try to use more, the kernel will physically block them or kill the offending process (the OOM Killer).
Physical ServerContainer A (Namespace 1)Container B (Namespace 2)Linux KernelProcess 1Local IP 10.0.0.1Local IP 10.0.0.2Cgroups (Limits CPU/RAM)

The Distribution Family Tree

A “Linux Distribution” is the combination of the kernel, a package manager, and a set of default tools.

1. The Debian Family (Ubuntu, Mint, Kali)

  • Focus: Stability and ease of use.
  • Package Manager: apt (using .deb files).
  • Philosophy: “It just works.” Ubuntu is the gateway drug for Linux users.

2. The Red Hat Family (RHEL, Fedora, CentOS)

  • Focus: Enterprise, security, and long-term support.
  • Package Manager: dnf / yum (using .rpm files).
  • Philosophy: Hardened and standardized. This is what you’ll find in bank data centers.

3. The Arch Family (Arch, Manjaro)

  • Focus: “KISS” (Keep It Simple, Stupid) and user control.
  • Package Manager: pacman.
  • Philosophy: “Rolling Release.” There are no versions (like Arch 2024); you just update, and you always have the latest software. You build the OS yourself, command by command.

4. Special Purpose Distros

  • Alpine: Tiny (5MB!). Used for Docker containers.
  • Android: Uses the Linux kernel but replaces the windowing system and libraries with Google’s custom stack.
  • Tails: Forces all traffic through Tor. If you pull out the USB drive, it wipes the RAM instantly.

The Monolithic vs Microkernel Debate Revisited

Linux is monolithic, but it is highly programmable. Technologies like eBPF (Extended Berkeley Packet Filter) allow developers to inject small bits of code into the kernel while it’s running—without recompiling it and without crashing it. This effectively gives Linux the modularity of a microkernel with the performance of a monolithic one.

Understanding Linux is about understanding that the “OS” is just a platform. You choose the kernel features you want, you choose the distribution that fits your needs, and you build exactly the system you require. In the next module, we’ll look at the “alternative” Unix family: the rock-stable and secure BSD distributions.