mohitmishra786/low-level-dev-skills

qemu-for-kernel-development

QEMU kernel development skill for driver and kernel testing.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill qemu-for-kernel-development

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

QEMU for Kernel Development

Purpose

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.

When to Use

  • Test kernel patch without bare metal
  • Develop driver against virtio or emulated DT platform
  • CI kernel boot smoke test
  • NFS or 9p root for fast edit-compile-test

Workflow

1. Minimal direct kernel boot (arm64 virt)

bash
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:

bash
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

2. Buildroot rootfs loop

bash
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.

3. Out-of-tree module test

bash
# 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:

bash
-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

4. GDB stub for kernel

bash
qemu-system-aarch64 ... -s -S
gdb vmlinux
(gdb) target remote :1234
(gdb) break start_kernel

Use CONFIG_KGDB for live kernel debugging after boot.

5. Device tree overrides

bash
qemu-system-aarch64 -machine virt -dtb myboard.dtb ...

virt machine provides virtio devices; platform drivers can target QEMU -device models.

6. Agent usage

/qemu-for-kernel-development Boot arm64 virt with custom Image and virtio rootfs for driver CI

Common Problems

SymptomCauseFix
Kernel panic no rootWrong root=root=/dev/vda for virtio blk
No console outputMissing console= on cmdlineconsole=ttyAMA0 / ttyS0
Module vermagic errorBuilt against wrong treeSame KERNEL_SRC as booted image
Slow without KVMTCG emulation-enable-kvm on x86 host
DTB mismatchWrong machineUse virt DTB from kernel make dtbs

Related Skills

  • skills/virtualization/qemu-kvm — KVM, VFIO, libvirt
  • skills/qemu/qemu-embedded-simulation — bare-metal MCU QEMU
  • skills/kernel/kernel-testing — KUnit, kselftest
  • skills/kernel-dev/device-tree — DT for virt/platform
  • skills/debuggers/gdb — remote GDB basics

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
mohitmishra786
커뮤니티

low-power-embedded

Low-power embedded skill for sleep modes and energy optimization. Use when configuring MCU sleep/stop/standby, peripheral clock gating, wake-up sources, or measuring firmware current draw. Activates on queries about WFI, STOP mode, STM32 PWR, nRF sleep, wake-up EXTI, or reducing embedded power consumption.

1시간 설치 수
1
GitHub Stars
296
업데이트
11월 20일
mohitmishra786
커뮤니티

core-dumps

Core dump analysis skill for production crash triage. Use when loading core files in GDB or LLDB, enabling core dump generation on Linux/macOS, mapping symbols with debuginfo or debuginfod, or extracting backtraces from crashes without re-running the program. Activates on queries about core files, ulimit, coredumpctl, debuginfod, crash triage, or analyzing segfaults from production binaries.

1시간 설치 수
2
GitHub Stars
267
업데이트
6월 27일
mohitmishra786
커뮤니티

custom-allocators

Custom allocator skill for memory allocation strategies. Use when implementing pool/slab/arena allocators, tuning jemalloc/mimalloc, writing Rust GlobalAlloc, or benchmarking allocator performance. Activates on queries about jemalloc, mimalloc, tcmalloc, arena allocator, GlobalAlloc, or fragmentation.

1시간 설치 수
2
GitHub Stars
267
업데이트
6월 27일
mohitmishra786
커뮤니티

ebpf

eBPF skill for Linux observability and networking. Use when writing eBPF programs with libbpf or bpftrace, attaching kprobes/tracepoints/XDP hooks, debugging verifier errors, working with eBPF maps, or achieving CO-RE portability across kernel versions. Activates on queries about eBPF, bpftool, bpftrace, XDP programs, libbpf, verifier errors, eBPF maps, or kernel tracing with BPF.

1시간 설치 수
2
GitHub Stars
267
업데이트
6월 27일