【问题标题】:Booting u-boot in Mac OS X's qemu在 Mac OS X 的 qemu 中引导 u-boot
【发布时间】:2014-12-01 03:13:25
【问题描述】:

我正在尝试构建 u-boot,并在 Mac OS X 上的 qemu 中运行它。 我找到了这个网站,并按照说明进行操作: http://imvoid.wordpress.com/2013/05/17/booting-uboot-in-qemu/

对于 Mac OS X 上的交叉编译,我可以构建工具 - How to make ARM cross compilation on Mac OS X (error: invalid listing option `r' - cross compiling error)

对于 u-boot,我尝试了导致核心转储的最新版本 (2014),以及一些无法编译的早期版本 (2010),因此我使用了 2013/10 版本 (https://dl.dropboxusercontent.com/u/1234/2014/u-boot-2013.10.tar.bz2) 来获取uboot.bin。

但是,当我使用qemu-system-arm -M versatilepb -m 128M -nographic -kernel u-boot.bin; 运行二进制文件时,没有崩溃,但我从屏幕上看不到任何东西。

可能出了什么问题?我上传了二进制文件。

https://dl.dropboxusercontent.com/u/1234/2014/u-boot.bin

还有崩溃的 2014 版本。

https://dl.dropboxusercontent.com/u/1234/2014/u-boot_2014.bin

【问题讨论】:

  • 没有-nographic 也能工作吗?
  • 无论有无 -nographic,它都不起作用。

标签: gcc arm qemu u-boot


【解决方案1】:

尝试使用 ELF 格式文件 u-boot,而不是 u-boot.bin

$ qemu-system-arm -M versatilepb -m 128M -nographic -kernel u-boot


U-Boot 2014.10-rc2-00312-g9169305 (Oct 06 2014 - 20:43:26)

DRAM:  128 MiB
WARNING: Caches not enabled
Flash: Flash protect error at address 37ec0000
Flash protect error at address 37fc0000
64 MiB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   SMC91111-0
Warning: SMC91111-0 using MAC address from net device

Warning: Your board does not use generic board. Please read
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed.
VersatilePB #

我在我的OS X 10.9.5 系统上构建了u-boot 提交91693055995733e268874ae75568ae316233e116。我使用了可用的 ARM 工具链二进制文件 here。在任何地方解压gcc-arm-none-eabi-4_8-2014q3-20140805-mac.tar.bz2(例如$HOME

$ git clone http://git.denx.de/u-boot.git
$ cd u-boot
$ make versatilepb_config
$ make CROSS_COMPILE=~/gcc-arm-none-eabi-4_8-2014q3/bin/arm-none-eabi-

我从Homebrew使用Qemu

$ qemu-system-arm --version
QEMU emulator version 2.1.2, Copyright (c) 2003-2008 Fabrice Bellard

【讨论】:

  • 您能解释一下为什么 ELF 版本可以工作,而二进制不能吗?另一篇文章 (balau82.wordpress.com/2010/02/28/…) 有一个示例,说明二进制方法仅适用于 -kernel 参数。
  • 我不知道,恐怕。您引用的博客文章来自 2010 年。Qemu 和 u-boot 开发进展非常快。如果您搜索 Qemu 和/或 u-boot 邮件列表,您可能会找到一些信息。
  • 看起来 qemu 有特殊的代码来加载 u-boot 映像 tinyurl.com/mq6w8p3 。这可能是 Qemu 或 u-boot 中的错误。也许不再支持加载二进制图像。如果您决定深入研究并找到一些东西,请在此处回信 :)
  • wiki.qemu.org/download/qemu-doc.html has "'-kernel bzImage' 使用 bzImage 作为内核映像。内核可以是 Linux 内核或多引导格式。";我想知道 ELF 格式可能与这种多引导格式有关。
  • 我相信 bzImage 和 multiboot 是两种特定于 x86 的图像格式。 -kernel 随附的文档不是最新的,并且对于多种体系结构可能不准确。例如,我之前指出的 arm_load_kernel() 代码与本文档不匹配。
猜你喜欢
  • 1970-01-01
  • 2020-05-30
  • 1970-01-01
  • 1970-01-01
  • 2016-07-19
  • 1970-01-01
  • 1970-01-01
  • 2020-05-03
  • 1970-01-01
相关资源
最近更新 更多