Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux kernel development using Qemu?

I want to work on linux kernel development on Qemu. I want to modify few kernel files as part of my project. I am only able to find ISO files of the linux distros online which I think we cannot edit. Could anyone please point me in the right direction regarding this?

like image 937
Srikanth Kandalam Avatar asked Nov 11 '22 19:11

Srikanth Kandalam


1 Answers

Buildroot to the rescue

Buildroot is a set of scripts that generates tiny distros with rootfs images smaller than 10MiB.

It downloads everything from source and compiles it, so it is trivial to patch packages up. There is a supported patching mechanism with BR2_GLOBAL_PATCH_DIR https://buildroot.org/downloads/manual/manual.html#customize-patches

The generated images are so tiny, that it becomes possible to understand the entire userland setup, which will make it easier to focus on the kernel.

I have created this setup to automate things as much as possible: https://github.com/cirosantilli/linux-kernel-module-cheat

This setup also works great for ARM: How to use QEMU for learning ARM Linux kernel development?