繁体   English   中英

U-boot、Qemu 和裸机

[英]U-boot, Qemu and baremetal

我在读这个:
https://balau82.wordpress.com/2010/03/10/u-boot-for-arm-on-qemu/

语境:

Baremtal 编程

前言:

  • OSX El Capitan、Qemu 2.2.1、U-boot 2016-07
  • 我们不能使用 uboot.bin(没有正确加载和崩溃。更不用说没有 Uboot 提示)。 我认为旧的 uboot 版本没问题。
  • 我创建了一个裸机汇编程序,它单独在 qemu 中执行得很好(将寄存器设置为一些值,qemu 监视器确认这些值)
  • 与UBoot混用时执行失败
  • 我需要 uboot 来测试 UART,有一个合适的 DRAM 等等。 我不想为那些部分未记录的东西编写新的引导加载程序。

过程:

  • QEMU + 裸机应用程序(下面的 Makefile):

     prepimg: ~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-as -g comm.ml -o comm.o ~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-ld -T test.ld comm.o -o test.elf ~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-objcopy -O binary test.elf test.bin mkimg: mkimage -A arm -C none -T kernel -O linux -d test.bin -a 0x0010000 -e 0x0010000 test.uimg launch_test: qemu-system-arm -m 128M -M vexpress-a9 -nographic -monitor telnet:127.0.0.1:1234,server,nowait -kernel test.uimg

有用。 代码在正确的地址执行(r15 证明了这一点)。

  • QEMU + 裸机 + U-boot

     prepimg: ~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-as -g comm.ml -o comm.o ~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-ld -T test.ld comm.o -o test.elf ~/Downloads/gcc-arm-none-eabi-5_4-2016q3/bin/arm-none-eabi-objcopy -O binary test.elf test.bin mkimg: mkimage -A arm -C none -T kernel -O linux -d test.bin -a 0x0010000 -e 0x0010000 test.uimg cat_them: cat u-boot-2016.07/u-boot test.uimg > u-boot-2016.07/flash.bin launch_qemu: qemu-system-arm -m 128M -M vexpress-a9 -nographic -monitor telnet:127.0.0.1:1234,server,nowait -kernel u-boot-2016.07/flash.bin

然后,我得到:

Wrong Image Format for bootm command
ERROR: can't get kernel image!

试炼:

  • 我试图将我的代码的入口点和加载地址修改为 0x80008000、0x8000 但仍然是同样的事情。
  • 我花了几个小时试图显示内存的不同区域(使用 u-boot md 工具),寻找我的代码,但没有运气。

我不知道发生了什么。

最后,

我通过 tftp d/l 我的文件并完成了工作。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM