Kernel
The core of an operating system that runs with full hardware privileges, managing processes, memory, devices, and files on behalf of every other program.
The kernel is the core of an operating system. It runs with full control of the hardware and manages everything that programs share: processor time, memory, storage, network interfaces, and devices. Everything else, from the shell to the desktop to a web browser, runs as an ordinary Process that must ask the kernel for anything privileged, through a System Call.
Its main jobs:
- Process management. Creating and ending processes, and deciding which runs on which core and when, the work of the CPU Scheduler.
- Memory management. Giving each process its own address space through Virtual Memory, moving pages to swap under pressure, and keeping recently read file data in the Page Cache.
- Files and storage. Implementing file systems that turn blocks on a disk into files and directories, with permissions and metadata tracked in structures such as the Inode.
- Devices. Device drivers translate generic requests into the specific commands each piece of hardware understands. Drivers make up the majority of the Linux source code.
- Networking. Running the protocol stack that turns packets into connections, such as TCP and UDP.
- Isolation and limits. Enforcing File Permissions and providing the Linux Namespaces and Control Groups that containers are built from.
Kernel designs differ in how much runs with full privilege. A monolithic kernel, like Linux and the BSDs, puts drivers, file systems, and networking in kernel space together. That is fast, since components call each other directly, but a bug in any driver can crash the whole system. A microkernel keeps only the essentials, such as scheduling, memory, and message passing, in the kernel and runs everything else as separate processes. That is more robust, since a crashed driver can be restarted, but messages between components add overhead. The trade-off was famously argued in 1992 between Andrew Tanenbaum, author of the MINIX microkernel, and Linus Torvalds. Windows and macOS use hybrid designs that sit between the two.
Linux began in 1991 as Torvalds's hobby project and now runs on most servers, all Android phones, and the vast majority of supercomputers. Loadable kernel modules let drivers and features be added to a running kernel without rebuilding it.
Because the kernel controls everything, its bugs are severe. A crash brings down the whole machine, and a security flaw can give an attacker complete control. Kernel code is held to strict review, and recent Linux versions accept drivers written in Rust to reduce memory-safety bugs. Systems also stack further boundaries: a Hypervisor runs several kernels on one machine, each believing it owns the hardware.
The kernel starts first at boot, hands control to the Init System as process 1, and remains underneath every other program for as long as the machine runs.
See also2
Graphics Driver
The software that translates a program's drawing commands into instructions a particular graphics card can execute, split between a kernel part that manages memory and displays and a large user-space part that compiles shaders and implements graphics interfaces.
Systems & Tooling17 connections
Boot Process
The chain of handoffs from power button to login screen, firmware to bootloader to kernel to init, and where each link can break or be verified.
Systems & Tooling13 connections
Linked from16
- Application Binary InterfaceSystems & Tooling
The binary-level contract that lets separately compiled code work together, covering registers, data layout, and symbol names, and why breaking it forces everything to be rebuilt.
- Boot ProcessSystems & Tooling
The chain of handoffs from power button to login screen, firmware to bootloader to kernel to init, and where each link can break or be verified.
- Core DumpSystems & Tooling
A snapshot of a crashed program's memory saved for later inspection, how to get one, how to read one, and why it can leak secrets.
- Device FileSystems & Tooling
Special files that represent hardware and kernel services, letting programs read a disk, a mouse, or a stream of random bytes with the same calls they use on ordinary files.
- File PermissionsSystems & Tooling
The Unix scheme of read, write, and execute rights for a file's owner, group, and everyone else, and the extensions that patch its gaps.
- Init SystemSystems & Tooling
The first userspace process a kernel starts, and the ancestor of every other process on the machine.
- Inter-Process CommunicationSystems & Tooling
The channels separate processes use to exchange data and signals, from pipes and sockets to shared memory, a necessity because each process is walled off in its own memory and a frequent route for sandbox escapes.
- Kernel PanicSystems & Tooling
The operating system kernel deliberately halting when it detects an error it can't safely recover from, the Unix version of the Blue Screen of Death, and how crash dumps and watchdogs turn it into a fast reboot.
- Linux DistributionSystems & Tooling
A complete operating system assembled around the Linux kernel, combining it with system tools, a package manager, and a set of opinions about release cadence, defaults, and freedom, with hundreds in active use.
- MicrocodeSystems & Tooling
The updatable firmware inside a processor that controls how it executes instructions, how operating systems load patches into it at every boot, and the hardware bugs it has been used to fix.
- Page CacheSystems & Tooling
The operating system's use of spare memory to hold recently read and written file data, which makes repeated disk access fast and makes "free memory" look alarmingly low.
- Ring BufferComputation & Algorithms
A fixed-size array treated as a loop, with read and write positions chasing each other around it, the standard way to pass a stream of data between a producer and a consumer.
- ShebangSystems & Tooling
The "#!" line at the top of a script that tells the kernel which interpreter should run it, so a text file can be executed like a compiled program, and the portability traps around it.
- System CallSystems & Tooling
The doorway through which a program asks the operating system kernel to do anything privileged, from reading a file to starting a process.
- Universal Serial BusSystems & Tooling
The connector standard that replaced a drawer of serial, parallel, and keyboard ports in the late 1990s, built around a host that polls every device, and later a single reversible plug for data, video, and power.
- Virtual MemorySystems & Tooling
Giving every process its own private address space that the kernel maps onto physical memory page by page, on demand.