Linux Kernel Modules That Expl... Note

Linux Kernel Modules That Explain How Podman Really Works

This guide demonstrates building and running three Linux kernel modules to illustrate core operating system concepts using a Killercoda Ubuntu playground and Podman. The first step involves preparing the environment by cloning a GitHub repository and installing essential build dependencies for kernel modules. Subsequently, Podman is installed on Ubuntu for managing containerized workloads. Module 1, a basic "Hello World" example, shows how to compile, load, and unload a kernel module, with its debug messages visible via dmesg. Module 2 expands on this by creating a character device, demonstrating how user-space processes interact with kernel functionality through familiar file operations. This module highlights how the kernel acts as an intermediary between user applications and hardware or kernel services. Module 3 explores the relationship between kernel process information and user-space tools like podman ps. It explains that containers are essentially Linux processes running in isolated namespaces. By examining the kernel's internal task list, module 3 reveals the underlying data structures that power both user-space process commands and container management tools like Podman. The guide concludes by emphasizing that container runtimes leverage fundamental kernel primitives, reinforcing the idea that containers are built upon standard Linux processes.