skills/kernel-dev/qemu-for-kernel-development/SKILL.md
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 skillsauth add mohitmishra786/low-level-dev-skills qemu-for-kernel-developmentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guide agents through QEMU-based kernel and driver development workflows: building/booting custom kernels, attaching virtio block/network, using Buildroot or minimal initramfs, and rapid module test cycles — focused on kernel dev vs general skills/virtualization/qemu-kvm.
qemu-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 \
-nographic
x86_64:
qemu-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 \
-nographic
cd buildroot
make qemu_aarch64_virt_defconfig
make
# output/images/Image, rootfs.ext4
Integrate custom kernel: set BR2_LINUX_KERNEL_CUSTOM_VERSION or external tree.
# on host — cross build
make -C $KERNEL_SRC M=$PWD modules
# in guest or via initramfs
insmod mydriver.ko
dmesg | tail
Share tree with 9p:
-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 /mnt
qemu-system-aarch64 ... -s -S
gdb vmlinux
(gdb) target remote :1234
(gdb) break start_kernel
Use CONFIG_KGDB for live kernel debugging after boot.
qemu-system-aarch64 -machine virt -dtb myboard.dtb ...
virt machine provides virtio devices; platform drivers can target QEMU -device models.
/qemu-for-kernel-development Boot arm64 virt with custom Image and virtio rootfs for driver CI
| Symptom | Cause | Fix |
|---------|-------|-----|
| Kernel panic no root | Wrong root= | root=/dev/vda for virtio blk |
| No console output | Missing console= on cmdline | console=ttyAMA0 / ttyS0 |
| Module vermagic error | Built against wrong tree | Same KERNEL_SRC as booted image |
| Slow without KVM | TCG emulation | -enable-kvm on x86 host |
| DTB mismatch | Wrong machine | Use virt DTB from kernel make dtbs |
skills/virtualization/qemu-kvm — KVM, VFIO, libvirtskills/qemu/qemu-embedded-simulation — bare-metal MCU QEMUskills/kernel/kernel-testing — KUnit, kselftestskills/kernel-dev/device-tree — DT for virt/platformskills/debuggers/gdb — remote GDB basicsdevelopment
QEMU/KVM skill for virtualization and kernel development. Use when running qemu-system-x86_64 with KVM, configuring virtio devices, VFIO passthrough, QMP monitor, libvirt, or booting custom kernels. Activates on queries about QEMU, KVM, virtio, VFIO, virsh, virt-install, or -kernel -append.
development
Hardware virtualization internals skill for Intel VT-x and AMD-V. Use when studying VMCS/VMCB, EPT/NPT page tables, VMEXIT handling, APIC virtualization, or building minimal hypervisors. Activates on queries about VMX, SVM, VMCS, EPT, NPT, VMEXIT, or type-1 hypervisor.
testing
Linux containers internals skill for namespaces, cgroups, and OCI. Use when understanding clone/unshare namespaces, cgroups v2 limits, overlayfs, runc, seccomp profiles, capabilities, or escape mitigations. Activates on queries about namespaces, cgroups, overlayfs, runc, seccomp-bpf, OCI spec, or container escape.
tools
Reverse engineering skill for binary analysis. Use when decompiling with Ghidra, analyzing with radare2, scripting RE tools, triaging with strings/file/xxd, or diffing binaries. Activates on queries about Ghidra, radare2, r2, decompiler, Binary Ninja, Diaphora, or stripped binary analysis.