视频地址:
https://www.bilibili.com/video/av47411075
安装依赖
sudo apt-get install qemu libncurses5-dev gcc-arm-linux-gnueabi build-essential gdb-arm-none-eabi synaptic gcc-aarch64-linux-gnu eclipse-cdt git
下载源码:
git init
git fetch https://github.com/figozhang/runninglinuxkernel_4.0.git
git checkout FETCH_HEAD
设置构架:
export ARCH=arm
设置工具链
export CROSS_COMPILE=arm-none-eabi-
make vexpress_defconfig
进程arm32下创建
cd _install_arm32/
mkdir dev
输入
sudo mknod console c 5 1
然后编译
make bzImage -j 4
输入
make dtbs
qemu-system-arm -nographic -M vexpress-a9 -m 1024M -kernel arch/arm/boot/zImage -append "rdinit=/linuxrc console=ttyAMA0 loglevel=8" -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb
qemu-system-arm -nographic -M vexpress-a9 -m 1024M -kernel arch/arm/boot/zImage -append "rdinit=/linuxrc console=ttyAMA0 loglevel=8" -dtb arch/arm/boot/dts/vexpress-v2p-ca9.dtb -S -s
arm-none-eabi-gdb --tui vmlinux
连接下断
target remote localhost:1234
b do_fork
然后 c 运行
s单步
原文地址:https://blog.51cto.com/haidragon/2385703
时间: 2024-10-10 08:42:45