Loading...
Loading...
QEMU kernel development skill for driver and kernel testing. Use when booting custom kernels in QEMU, Buildroot/Yocto rootfs, virtio devices, or NFS root for driver iteration. Activates on queries about QEMU kernel dev, Buildroot QEMU, virtio block, kernel module test QEMU, or -append root=
npx skill4agent add mohitmishra786/low-level-dev-skills qemu-for-kernel-developmentskills/virtualization/qemu-kvmqemu-system-aarch64 \
-machine virt -cpu cortex-a57 -smp 4 -m 2G \
-kernel arch/arm64/boot/Image \
-append "console=ttyAMA0 root=/dev/vda rw" \
-drive if=virtio,file=rootfs.ext4,format=raw \
-netdev user,id=net0 -device virtio-net-device,netdev=net0 \
-nographicqemu-system-x86_64 -enable-kvm -m 4G -smp 4 \
-kernel arch/x86/boot/bzImage \
-append "console=ttyS0 root=/dev/vda rw" \
-drive file=rootfs.img,format=raw,if=virtio \
-nographiccd buildroot
make qemu_aarch64_virt_defconfig
make
# output/images/Image, rootfs.ext4BR2_LINUX_KERNEL_CUSTOM_VERSION# on host — cross build
make -C $KERNEL_SRC M=$PWD modules
# in guest or via initramfs
insmod mydriver.ko
dmesg | tail-fsdev local,id=dev,path=$PWD,security_model=none \
-device virtio-9p-pci,fsdev=dev,mount_tag=hostshare
# guest: mount -t 9p -o trans=virtio hostshare /mntqemu-system-aarch64 ... -s -S
gdb vmlinux
(gdb) target remote :1234
(gdb) break start_kernelCONFIG_KGDBqemu-system-aarch64 -machine virt -dtb myboard.dtb ...-device/qemu-for-kernel-development Boot arm64 virt with custom Image and virtio rootfs for driver CI| Symptom | Cause | Fix |
|---|---|---|
| Kernel panic no root | Wrong | |
| No console output | Missing | |
| Module vermagic error | Built against wrong tree | Same |
| Slow without KVM | TCG emulation | |
| DTB mismatch | Wrong machine | Use |
skills/virtualization/qemu-kvmskills/qemu/qemu-embedded-simulationskills/kernel/kernel-testingskills/kernel-dev/device-treeskills/debuggers/gdb