gdb調試linux內核arm構架
阿新 • • 發佈:2019-04-28
src 內核 v2p 4.0 運行 etc http tar clip 視頻地址:
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 CROSS_COMPILE=arm-none-eabi-
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單步
gdb調試linux內核arm構架