qemu&uboot启动

arm架构

apt-get install bison flex libncurses-dev
apt install libssl-dev

 安装

apt install build-essential

编译u-boot

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- vexpress_ca9x4_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j8

 qemu启动成功

使用QEMU模拟启动uboot

ARM架构qemu启动 

QEMU-从uboot启动(4)_qemu u盘启动-CSDN博客

06步:使用u-boot加载内核 - QEMU教程 | 宅学部落

uboot下载地址

https://ftp.denx.de/pub/u-boot/

git clone https://gitlab.denx.de/u-boot/u-boot.git && cd u-boot
make distclean
make slimbootloader_defconfig
make all

gdb

qemu-system-arm    -M vexpress-a9                      -kernel u-boot
          -nographic                           -m 512M -s -S
gdb-multiarch --tui u-boot
set architecture arm
target remote localhost:1234
b relocate_code
c
info register r0  #查看r0信息
symbol-file #删除符号表
add-symbol-file u-boot r0地址 #重新添加符号表
b board_init_r

源码

参考

u-boot启动流程分析-史上最全最详细 - 知乎

slimbootloader

https://github.com/slimbootloader/slimbootloader.git

 ubuntu需要安装以下安装包

sudo apt-get install -y build-essential iasl python uuid-dev nasm openssl gcc-multilib qemu git

 生成密钥

export SBL_KEY_DIR=<path to SblKeys directory>
python3 BootloaderCorePkg/Tools/GenerateKeys.py -k $SBL_KEY_DIR

不然会报错

!!! ERROR: SBL_KEY_DIR is set to directory slimbootloader-master/../SblKeys does not exist!!!

 最后执行 会clone GitHub - tianocore/edk2: EDK II

python3 BuildLoader.py build qemu -p "OsLoader.efi:LLDR:Lz4;u-boot-dtb.bin:U-BT:Lzma"

别的环境需要编译,可能还需要编译上面的安装包

https://github.com/acpica/acpica.git

参考

Boot Linux with U-Boot Payload — Slim Bootloader 1.0 documentation

 Build Environment — Slim Bootloader 1.0 documentation

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

chenxuezhou

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值