Linux kernel development using Qemu?

I want to work on developing the Linux kernel on Qemu. I want to modify several kernel files as part of my project. I can only find ISO files from Linux distributions which I think we cannot edit. Can someone point me in the right direction regarding this?

+4
source share
4 answers

Download the Linux kernel source code from kernel.org, then modify, configure, create the kernel. Once created, you will get a kernel image, usually located in arch / x86 / boot / bzImage (if your arch is x86, look at a suitable place for your arch), and this is what you need to test the modified kernel on Qemu. You will also need rootfs (use busybox) to work properly. Use the qemu '-kernel' parameter to pass bzImage. Example:

 `qemu-system-x86_64 -m 1024 -smp 4 -kernel arch/x86/boot/bzImage -initrd initramfs.gz -append "rdinit=/ root=/dev/ram`

it tells qemu to use 1024 RAM, use 4 processors.

+1
source

If you want to change the Linux kernel, you can download the kernel source from https://www.kernel.org/ . Install on a Linux system after changing the code.

0
source

, , - ubuntu-vm-builder.

sudo ubuntu-vm-builder qemu precise --arch 'amd64'  --mem '1024'  --rootsize '4096'  --swapsize '1024'  --kernel-flavour 'generic'  --hostname 'ubuntu'  --components 'main'  --name 'Srikanth'  --user 'ubuntu'  --pass 'ubuntu' --bridge 'br0'  --libvirt 'qemu:///system'

qemu.

qcow2, , .

0

Buildroot - , rootfs 10MiB.

, . BR2_GLOBAL_PATCH_DIR https://buildroot.org/downloads/manual/manual.html#customize-patches

, userland, .

I created this installation to automate the work as much as possible: https://github.com/cirosantilli/linux-kernel-module-cheat

This setting is also great for ARM: How to use QEMU to learn ARM Linux kernel development?

0
source

All Articles