Qemu + virt (cortex-a53或cortex-a57)
4GB
物理内存地址空间:0x40000000~0x13fffffff
https://github.com/qemu/qemu/blob/master/hw/arm/virt.c
https://developer.arm.com/architectures/learn-the-architecture
https://developer.arm.com/architectures/learn-the-architecture/generic-timer/before-you-begin
undefined reference to `__stack_chk_guard' .. undefined reference to `__stack_chk_fail'
增加gcc编译参数 CFLAGS
-fno-stack-protector
qemu-system-aarch64 -machine virt -cpu cortex-a57 -smp 4 -kernel kernel.elf -nographic -S -s
编译器
https://www.jianshu.com/p/6909615d7529
GDB
gdb-multiarch
https://zhuanlan.zhihu.com/p/47783910
https://github.com/NienfengYao/armv8-bare-metal
https://github.com/NienfengYao/port_freertos_to_qemu_a57_virt
https://github.com/FreeRTOS/FreeRTOS-Kernel
How to use GDB to debug QEMU with SMP (symmetric multiple processors)?
Each qemu CPU is visible as a separate thread within gdb. To inspect the state of another CPU, use the thread
command to switch CPUs.
(gdb) info thread Id Target Id Frame * 1 Thread 1 (CPU#0 [running]) 0x80105163 in stosl (addr=0x89c3e000, data=16843009, cnt=1024) at x86.h:44 2 Thread 2 (CPU#1 [halted ]) halt () at x86.h:127 3 Thread 3 (CPU#2 [halted ]) halt () at x86.h:127 4 Thread 4 (CPU#3 [halted ]) halt () at x86.h:127 (gdb) where #0 0x80105163 in stosl (addr=0x89c3e000, data=16843009, cnt=1024) at x86.h:44 #1 0x801051bf in memset (dst=0x89c3e000, c=1, n=4096) at string.c:8 #2 0x80102b5a in kfree (v=0x89c3e000 "