This repository provides scripts and Makefile targets to configure, build, and run the Linux kernel using QEMU for debugging purposes. The setup includes support for kernel debugging with GDB.
linux-6.10.2/
: Directory containing the Linux kernel source code.rootfs_alpine.img
: Root filesystem image (Alpine Linux).
- QEMU
- GDB (multiarch)
- Cross-compiler for ARM64 (
aarch64-linux-gnu-
) - Make
Starts GDB, connects to the QEMU instance, and prepares for debugging.
Builds the Linux kernel with the specified architecture and cross-compiler.
Builds all steps and run qemu for debug
Create rootfs image using Alpine Linux (aarch64)
Starts QEMU with the built Linux kernel and the provided root filesystem image, enabling GDB server on port 1234.
Clean all
- use
make run_qemu
to launch in debug mode (in one terminal) - Debug in VScode: press debug and select 'Attach to QEMU' configuration
- Debug the code as required
- GDB in terminal (refer gdb_commands.txt)