简体   繁体   English

运行我的引导时出现qemu错误

[英]qemu error while running my boot

I wrote a short boot code and tried to run it with Qemu with: 我编写了一个简短的启动代码,并尝试通过以下命令与Qemu一起运行:

qemu-system-arm.exe -M versatilepb -cpu cortex-a9 -kernel boot.bin qemu-system-arm.exe -M多用途pb -cpu cortex-a9-内核boot.bin

I expected the code to be loaded to address 0x8400000 but qemu returned me the error 我希望代码可以加载到地址0x8400000,但是qemu向我返回了错误

Trying to execute code outside RAM or ROM at 0x84000000 This usually means one of the following happened: 尝试在RAM或ROM外部以0x84000000执行代码,这通常意味着发生以下情况之一:

(1) You told QEMU to execute a kernel for the wrong machine type, and it crashed on startup (eg trying to run a raspberry pi kernel on a versatilepb QEMU machine) (2) You didn't give QEMU a kernel or BIOS filename at all, and QEMU executed a ROM full of no-op instructions until it fell off the end (3) Your guest kernel has a bug and crashed by jumping off into nowhere (1)您告诉QEMU为错误的机器类型执行内核,并且在启动时崩溃(例如,尝试在多功能pb QEMU计算机上运行树莓派内核)(2)您没有给QEMU提供内核或BIOS文件名QEMU完全执行了一个无操作指令的ROM,直到它掉到最后为止(3)您的来宾内核有一个错误,并跳到无处崩溃

This is almost always one of the first two, so check your command line and that you are using the right type of kernel for this machine. 这几乎总是前两个之一,因此请检查命令行,并为该计算机使用正确的内核类型。 If you think option (3) is likely then you can try debugging your guest with the -d debug options; 如果您认为选项(3)很有可能,则可以尝试使用-d调试选项调试客户机; in particular -d guest_errors will cause the log to include a dump of the guest register state at this point. 特别是,-d guest_errors将导致日志此时包括来宾寄存器状态的转储。

Execution cannot continue; 执行无法继续; stopping here. 在这里停止。

So I guess my code has not yet started running because it is not loaded into the right place 所以我想我的代码尚未开始运行,因为它没有加载到正确的位置

What am I wrong about? 我怎么了

Thanks 谢谢

You say "I expected the code to be loaded to address 0x8400000" but QEMU's error message says "0x84000000" which is not the same number (it has an extra 0). 您说“我希望代码被加载到地址0x8400000”,但是QEMU的错误消息显示“ 0x84000000”,它不是相同的数字(它有一个额外的0)。 This suggests that you have a typo in your linker script or whatever is creating your boot.bin file. 这表明您在链接描述文件中有错字,或者正在创建boot.bin文件的内容有错。 (I am assuming that boot.bin is an ELF file, which QEMU loads at the addresses the ELF file specifies, because otherwise it will be loaded into RAM anyhow on the assumption that it's a Linux kernel image capable of self-relocation.) (我假设boot.bin是一个ELF文件,QEMU会在ELF文件指定的地址上加载该文件,因为否则,它将假定它是一个能够自我重定位的Linux内核映像,否则将被加载到RAM中。)

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

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