Kernel

Schedulers, memory management, syscalls and loadable modules — how the OS core really works.

3 min read 3 lesson sections
  • #scheduler
  • #syscalls
  • #memory
  • #modules
Kernel: Schedulers, memory management, syscalls and loadable modules — how the OS core really works.
Concept map

The kernel is the privileged core of an operating system. It mediates access to processors, memory, storage, and devices so ordinary applications do not control hardware directly. Applications request services through system calls, the interface between user-space programs and kernel functions.

Simple analogy: An application is a customer at a service desk. It asks the kernel for a resource; the kernel checks the request and coordinates access safely.

What the kernel manages

  • Processes and scheduling: decides which runnable task gets CPU time and handles context switches.
  • Memory: gives processes virtual address spaces, maps physical memory, and reclaims pages when needed.
  • Devices and filesystems: drivers communicate with hardware, while filesystem code presents stored data through a consistent interface.
  • Networking: implements protocol stacks and moves packets between applications and network devices.
  • Isolation and permissions: enforces boundaries between processes and users.

On many Linux systems, drivers and other features can be loaded as kernel modules. The /proc and /sys filesystems expose live information and selected controls; they are interfaces to kernel state, not ordinary disk-backed directories. Containers rely on kernel features such as namespaces to isolate views of resources and cgroups to account for and limit resource use.

Observe without changing the system

Start with read-only inspection tools. uname -r shows the running kernel release, free -h summarizes memory, and dmesg or journalctl -k can show kernel messages where permissions allow. The ps and top tools help connect system load to processes. Prefer documented monitoring tools before considering kernel tuning.

When a machine is slow, separate symptoms: high CPU use, memory pressure, storage latency, or network issues suggest different causes. Kernel tracing and performance tools can provide deeper evidence, but they require care because some probes add overhead and system interfaces vary by kernel version.

Kernel updates and troubleshooting

Kernel updates can include security fixes, new drivers, and behavior changes. Use the distribution’s supported update mechanism, keep a known-good recovery option where practical, and review release notes for systems with specialized hardware or workloads. If a device fails after an update, collect the kernel version and relevant logs before changing configuration.

Understanding the kernel helps explain how processes, memory, filesystems, and containers work. Most administrators do not need to modify kernel code; a solid mental model and careful use of observable system data are valuable on their own.