You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

x86_64平台下QEMU加载U-Boot启动失败问题求助

x86_64平台U-Boot编译后QEMU启动失败问题

编译步骤

已完成x86_64平台U-Boot源码编译,步骤如下:

git clone https://source.denx.de/u-boot/u-boot.git
cd u-boot
make qemu-x86_64_defconfig
make

成功生成u-boot.bin二进制文件。

启动失败情况

尝试用QEMU加载启动时失败,执行命令及错误信息:

$ qemu-system-x86_64 -nographic -bios u-boot.bin -M q35
qemu: could not load PC BIOS 'u-boot.bin'

替换为u-boot.com尝试,仍报相同错误。

ARM平台正常运行对比

采用类似步骤编译ARM平台U-Boot,可正常启动,执行命令及输出:

$ qemu-system-aarch64 -M virt -cpu cortex-a53 -nographic -bios u-boot.bin
U-Boot 2019.01 (Mar 06 2025 - 12:20:02 +0530)

DRAM:  128 MiB
Flash: 128 MiB
*** Warning - bad CRC, using default environment

In:    pl011@9000000
Out:   pl011@9000000
Err:   pl011@9000000
Net:   No ethernet found.
Hit any key to stop autoboot:  0
=>

解决方法

x86_64平台的U-Boot编译产物并非PC BIOS格式镜像,而是Linux内核格式的可执行文件,因此不能用-bios参数加载,需改用-kernel参数:

# 加载u-boot.bin启动
qemu-system-x86_64 -nographic -kernel u-boot.bin -M q35

# 若编译生成了u-boot.elf,也可使用该文件启动
qemu-system-x86_64 -nographic -kernel u-boot.elf -M q35

原因说明

x86架构下,U-Boot编译输出的是符合Linux内核协议的可执行镜像,QEMU需要通过-kernel参数识别加载;而ARM virt平台的U-Boot编译产物是适配该机器的BIOS格式镜像,因此可以直接用-bios参数启动。

内容的提问来源于stack exchange,提问作者user2679476

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.13 11:14:58