使用 QEMU 测试 U-BOOT
来源:互联网 发布:网络买卖 编辑:程序博客网 时间:2024/06/15 17:47
还是模拟 VEXPRESS-A9.
起初,我用的还是qemu官网里的最新代码编出的qemu程序。
u-boot从下面的网址获得:
http://ftp.denx.de/pub/u-boot/
取得是最新的代码。解压后,配置,编译:
make vexpress_ca9x4_configexport ARCH=armexport CROSS_COMPILE=arm-linux-gnueabi-make vexpress_ca9x4_configmake
然后,用 qemu运行 u-boot:
qemu-system-arm -M vexpress-a9 -serial stdio -kernel u-boot结果,qemu的窗口出来了,但却没有任何输出,程序好像是deadlock 在某一个地方了。
根据http://balau82.wordpress.com/2012/03/31/compile-linux-kernel-3-2-for-arm-and-emulate-with-qemu/
建议的方法调试如下:
1. 先运行
qemu-system-arm -M vexpress-a9 -serial stdio -kernel u-boot -s -S然后,在另一个虚拟终端窗口执行:
arm-linux-gnueabi-gdb u-boot...(gdb) target remote localhost:1234最终发现,程序执行了下面的汇编执行后就 stuck 那里了
mcrp15, 0, r0, c12, c0, 0@Set VBAR(在文件 u-boot-2013.10/arch/arm/cpu/armv7/start.S里)
现在对arm的汇编还不熟悉,这个错误不知道如何解决。。
所以,就换了另一个对arm支持较好的qemu版本: qemu-linaro。可以用git拿到源码。
git clone git://git.linaro.org/qemu/qemu-linaro.git用编译 qemu一样的方法编译 qemu-linaro.
然后,再尝试运行u-boot:
~/code/u-boot-2013.10$ qemu-system-arm -M vexpress-a9 -serial stdio -kernel u-bootoss: Could not initialize DACoss: Failed to open `/dev/dsp'oss: Reason: No such file or directoryoss: Could not initialize DACoss: Failed to open `/dev/dsp'oss: Reason: No such file or directoryaudio: Failed to create voice `lm4549.out'U-Boot 2013.10 (Oct 24 2013 - 00:04:17)DRAM: 128 MiBWARNING: Caches not enabledFlash: 128 MiBMMC: MMC: 0*** Warning - bad CRC, using default environmentIn: serialOut: serialErr: serialNet: smc911x-0Warning: smc911x-0 using MAC address from net deviceHit any key to stop autoboot: 0 Wrong Image Format for bootm commandERROR: can't get kernel image!VExpress# VExpress# VExpress# help? - alias for 'help'base - print or set address offsetbdinfo - print Board Info structurebootelf - Boot from an ELF image in memorybootm - boot application image from memorybootp - boot image via network using BOOTP/TFTP protocolbootvx - Boot vxWorks from an ELF imagebootz - boot Linux zImage image from memorycmp - memory comparecp - memory copy
这次能看到u-boot的输出了。看来还是 linaro的qemu对arm的支持比较好啊。
- 使用 QEMU 测试 U-BOOT
- 使用Qemu模拟Cortex-A9运行U-boot和Linux
- 使用Qemu模拟Cortex-A9运行U-boot和Linux
- ubuntu下使用qemu模拟ARM(二)-------编译u-boot
- 使用Qemu模拟Cortex-A9运行U-boot和Linux
- mini2440 qemu 用u-boot 加载 RTEMS
- u-boot-2013.07在mini2440上的移植(一):使用默认测试u-boot.bin
- Qemu下u-Boot + Kernel + rootfs完整启动移植
- U-boot移植及测试
- u-boot 使用
- U-Boot 使用
- u-boot的使用
- u-boot的使用
- 使用skyeye编译u-boot
- U-boot的使用(四)
- 使用CodeWarrior调试U-Boot
- 使用AXD调试u-boot
- 为什么要使用u-boot
- 互联网投资大会的见闻 --2013/9/9
- 粘包问题
- 产品与符号
- 基于TCP的socket编程网络掉线重连
- WTL for MFC Programmers, Chinese Version Prologue
- 使用 QEMU 测试 U-BOOT
- WTL for MFC Programmers, Part I - ATL GUI Classes
- 笔试锤子产品经理
- 解决TCP网络传输“粘包”问题
- 细说Servlet Servlet细节
- c/c++通过socket发送结构体
- 经过一年时间的沉淀 再次回首 TCP Socket服务器编程
- 拼包函数及网络封包的异常处理(含代码)
- 从Eclipse转移到IntelliJ IDEA一点心得