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.
source
share