tar -xvf qemu-5.1.0
./configure --target-list=aarch64-softmmu
make
生成qemu
tar -xvf crash-7.2.9
make target=ARM64
(如果编译报错 是环境问题)
编译生成 crash
编译:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j4 defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -j4
文件系统制作:
busybox- 网上教程就很多了,
静态编译, dev 需要添加
make defconfig
make CROSS_COMPILE=${CROSS_COMPILE}
make install CROSS_COMPILE=${CROSS_COMPILE}
运行:
./qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 512M -kernel arch/arm64/boot/Image -hda ../rootfs.ext3 -append "root=/dev/vda init=/linuxrc rw console=ttyAMA0"
要调试加 -S -s
qemu跑起来后,echo c > /proc/sysrq-triger
ctrl+a 和 z
dump-guest-memory -z xxxx(转存文件文件)
crash
crash vmlinux xxxx
接下来可以crash 了
gdb
运行:
./qemu-system-aarch64 -machine virt -cpu cortex-a57 -machine type=virt -nographic -smp 1 -m 512M -kernel arch/arm64/boot/Image -hda ../rootfs.ext3 -append "root=/dev/vda init=/linuxrc rw console=ttyAMA0"
要调试加 -S -s
arm-linux-gnueabihf-gdb
target remote:1234
b xxxxx(设置断点)
c
其他网友的可以参考 下
https://blog.csdn.net/weixin_33804582/article/details/94094521
https://blog.csdn.net/weijitao/article/details/79477792