A hands-on environment for learning Linux kernel development. Build, run, and hack on the kernel inside QEMU — no risk to your host system.
- Automated kernel build — fetches kernel source and builds a QEMU-bootable image with one command
- QEMU runner — boots the kernel with networking, SSH, and module loading pre-configured
- Example modules — annotated kernel modules to learn from and extend
- Scaffolding — quickly create new modules based on a working template
Install dependencies for your distro:
make installSupports apt, dnf, pacman, and zypper. You'll also need clang, lld, and llvm installed separately.
make clone # clones linux-stable at the pinned versionThe default is Linux 6.18.6. Override with:
make clone KERNEL_VERSION=6.12.0./tools/build.sh -d linux-6.18.6This produces a bootable image at linux-6.18.6/arch/x86/boot/bzImage.
make runConnect via SSH on port 52222. Override CPU count and memory:
NRCPU=4 MEMORY=8192 make runmake mod -E M_DIR=modules/process-times/| Module | Description |
|---|---|
bare-module |
Minimal loadable module — a clean starting point |
process-times |
Captures per-process CPU times via a kernel module |
kernel-dojo/
├── modules/ # Kernel modules
│ ├── bare-module/ # Template module
│ └── process-times/ # Example: process CPU time tracking
├── tools/
│ ├── build.sh # Kernel build script (clang/LLVM)
│ ├── start_qemu.sh # QEMU launcher with networking
│ ├── genmake.sh # Makefile generator for modules
│ └── host_lib.sh # Shared shell utilities
├── readings/ # Notes and references
├── linux-6.18.6/ # Kernel source (after make clone)
└── Makefile
| Target | Description |
|---|---|
make install |
Install build dependencies |
make clone |
Clone the kernel source |
make run |
Boot the kernel in QEMU |
make scope |
Build and open a cscope index of the kernel |
make clean |
Clean the kernel build |
