The Kernel

Last edited

Pithy

The kernel a layer between the user space and hardware.
It has an API (syscalls) that provide useful facilities for interacting with the hardware.

The kernel API interface provides five basic features:

  • Management and abstraction of hardware devices
  • Processes and threads (and ways to communicate among them)
  • Management of memory (virtual memory and memory-space protection)
  • I/O facilities (filesystems, network interfaces, serial interfaces, etc.)
  • Housekeeping functions (startup, shutdown, timers, multitasking, etc.)

Note

Kernel is mostly C, with assembly sprinkled in where C can’t reach low-level CPU features (like atomic read-modify-write instructions).

Kernel versioning

Some distributions choose to emphasize stability and so run the older, more tested kernels.
Other distributions try to offer the most recent device support and features but might be a bit less stable as a result.
Select among these options in a manner that accommodates your users’ needs. No single solution is appropriate for every context.

Linux kernels use semantic versioning: major, minor and patch level

uname # = unix name, prints os name, kernel version, hw, etc.)

# Ubuntu machine
uname -r # see what kerenal the system is running
6.8.0-117-generic
6 # major
8 # mintor
0 # patch
-177-generic # ubuntu specific build number and flavor

# Debian machine
6.12.90+deb13.1-amd64

Tip

If you need a more recent kernel, install a distribution that’s designed around that kernel rather than trying to shoehorn the new kernel into an existing system.

As an example Debian 13 ships with 6.12.X and will stay on that through it’s lifecycle, they won’t change minors or majors for all of Debian 13 Source.

Kernel LTS versions are released around every year: https://www.kernel.org/category/releases.html Your distribution handles kernel updates for you, you just get whatever they ship.

DistributionReleaseKernel SeriesType
Arch LinuxRollingLatestMainline
Debian 13 (Trixie)Testing6.12Longterm
Ubuntu 24.10Regular6.11Stable
Fedora 41Regular6.11Stable
Ubuntu 24.04 LTSStable6.8Longterm
Debian 12 (Bookworm)Stable6.1Longterm
RHEL 9Stable5.14Longterm

Kernel maintainers actively back port security and bug fixes from mainline to each long term series. Which is why Ubuntu is 177, all of the patches they’ve had provided by upstream kernel maintainers. Ubuntu just packages, the kernel maintainers do the hard work.

How to get the latest patch of your kernel

apt list --upgradable
sudo apt update
sudo apt upgrade

Branches

Users: don’t care. Your distribution handles it.

  • Prepatch/RC - test new features kernel developers
  • Mainline - new features released every 9-10 weeks kernel developers
  • Stable - bug fixes from mainline, weekly releases distro maintainers
  • Longterm - backported security fixes for 2+ years distro maintainers & enterprises