【问题标题】:QEMU build fails to run aarch64 and arm imagesQEMU 构建无法运行 aarch64 和 arm 映像
【发布时间】:2016-10-29 06:37:30
【问题描述】:

在 x86_64 Ubuntu 14.04 上构建 qemu 2.7.0。运行 aarch64arm 来宾失败并出现以下错误,

qemu/build/aarch64-softmmu$ ./qemu-system-aarch64 -M virt -boot d -cdrom ~/debian-8.6.0-arm64-netinst.iso  
VNC server running on 127.0.0.1:5900
qemu-system-aarch64: Trying to execute code outside RAM or ROM at 0x0000000008000000
This usually means one of the following happened:

(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

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; in particular -d guest_errors will cause the log to include a dump of the guest register state at this point.

Execution cannot continue; stopping here.

VNC 服务器几乎立即启动,单个 CPU 活动在访客 tries to execute code outside RAM or ROM at ... 之前大约 7 秒出现峰值。 来宾包括 Debian 8.0 和 CentOS 7。

请求解决此问题的建议。

【问题讨论】:

    标签: arm virtual-machine qemu arm64


    【解决方案1】:

    此问题的答案在您引用的错误消息中。您处于情况 (2) - 您没有提供内核或 BIOS 文件名。

    您的命令行的另一个问题是您已经向它传递了一个 64 位 ARM 磁盘映像,但您没有使用 -cpu 来指定您想要一个 64 位 CPU。 'virt' 板的默认值是 'cortex-a15',它是一个 32 位 CPU。

    【讨论】:

    • 谢谢@Peter。但是,如果使用 Debian 8.0 armhf 和 qemu-system-arm 也是一样的
    • 这将避免 CPU 问题,但您仍然需要为其提供 BIOS 或内核。用于 ARM 目标的 QEMU(与 qemu-system-x86 不同)默认情况下不会运行 BIOS 映像,因此默认情况下无法为您从磁盘映像中提取内核。您必须提供 BIOS 映像(通常是 UEFI)或直接将内核传递给 QEMU。
    • 你能给我指出一些有助于为 qemu 指定 BIOS 的资源吗?我在看一个非 UEFI 环境
    • 如果您不使用 UEFI,那么您不想指定 BIOS(UEFI 是唯一有效的 BIOS)。因此,您需要从磁盘映像中提取 kernel/initrd/commandline 并将它们传递给 QEMU。
    • @kesari:如果你想启动那个 .iso,你当然需要 UEFI。虽然对于 Debian 8,它仍然无法在 armhf 上工作(缺乏内核支持)——当前的“测试”图像应该可以工作,但我还没有验证它。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-01-26
    • 2021-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-05
    • 2021-09-04
    相关资源
    最近更新 更多