- Compile
# -g: reserve debugging information. aarch64-linux-gnu-gcc -Wall -g -c src/main.s -o build/main.o - Run code in qemu
# -s: set gdb server on 1234 port # -S: freeze CPU at startup qemu-system-aarch64 -M raspi3b -kernel build/kernel8.img -display none -d in_asm -s -S
- Debugger
# use the following command in gdb-multiarch # load debugging information file kernel8.elf # connect to qemu target remote 127.0.0.1:1234