-
Notifications
You must be signed in to change notification settings - Fork 0
Qemu and GDB
Victor Correal Ramos edited this page May 2, 2020
·
2 revisions
The latest qemu version can emule a the behavior of a real Raspberry Pi but with some differences with the real Raspberry pi:
- Some peripherals don't exists (like the GPIO pins)
- The starting address for the boot section is the 0x80000 while the real hardware uses the 0x80000.
- The time is not quite realistic For this reason, there is conditional compilation in some regions of code and a specific linker for the Qemu. A script is in all the working folders for running the Qemu with the specific flags and emulate the Raspberry Pi. For run the kernel image the correct flags where:
qemu-system-aarch64 -M raspi3 -kernel kernel-qemu.img -serial stdioFor debug the qemu, is necessary to compile with the -g flag and run the qemu with some flags.
The qemu should use the -s -S flags to stop in the first instruction, and the gdb need the following sentences:
target remote localhost:1234
file build/kernel-qemu.elfHere, the .elf file (that contains the debugging symbols) is loaded and the debugger connects via localhost to the qemu. A script for a qemu debugging session (runDBG.sh) and a script for set the gdb debugger (gdbscript) with the qemu are written.
Powered by GreenTreeData