Skip to content

Instantly share code, notes, and snippets.

View l-0-l's full-sized avatar
💭
Aggressively cheerful

l-0-l l-0-l

💭
Aggressively cheerful
View GitHub Profile
@l-0-l
l-0-l / 01_kernel_dev_setup.md
Last active May 14, 2024 16:53
Set up a Linux kernel development environment

Setup a Linux kernel development environment easily with virtme-ng.

The instructions cover cloning and building Linux kernel and the useful qemu wrapper virtme-ng. After performing these actions, a virtual machine is started with the newly built Linux kernel and the current local rootfs - same user and files. This allows building and testing kernel modules and user-space apps with a custom/specific kernel.

The kernel compilation phase can be made very simple with virtme-ng itself, so be sure to check out its capabilities by running vng --help after installing it. Here the kernel building instructions more manual and detailed to radically reduce the build time by removing certain features you normally don't care about in such a setup.

While virtme-ng makes it easy to run a kernel on the local root filesystem for debugging, it is not your original system. In most cases today your Linux runs with systemd init, which is quite a complex environment. The virtme-ng prroject relaces your init with a