【发布时间】:2017-01-08 10:36:45
【问题描述】:
我在读这个:
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命令如何解决您的所有问题?例如。请参阅stackoverflow.com/questions/35362242/… BTW 学习 U-Boot 的正确拼写;你至少使用了 4 个拼写变体,都是不正确的。 (至少你没有使用极其无知的“uBoot”。)
标签: qemu u-boot bare-metal