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启动成功
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
源码
参考
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