简体   繁体   English

Qemu-Arm卡在黑屏上 - 运行香草内核

[英]Qemu-Arm Is stuck with black screen - running vanilla kernel

I have tried to run qemu-arm with a complied linux kernel (Version 4.9) and with an initfs that i have created with a sample program. 我试图用一个编译好的Linux内核(版本4.9)和一个用示例程序创建的initfs来运行qemu-arm。

This is was based on an excellent post from here . 这是基于这里的优秀帖子。

This is the command that i have executed: 这是我执行的命令:

qemu-system-arm -M vexpress-a9 -kernel linux-4.9/arch/arm/boot/zImage -initrd initramfs -append "console=tty1"

then, qemu shows me these errors and its graphical window is getting stuck: 然后,qemu向我展示了这些错误,其图形窗口卡住了:

pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument

Even when I run it without the -initrd parameter, for just loading the kernel - nothing happens. 即使我在没有-initrd参数的情况下运行它,只是加载内核 - 没有任何反应。

When I tried run it with a vmlinuz-3.2.0-4-vexpress image in this example, it worked for me. 当我在这个例子中尝试用vmlinuz-3.2.0-4-vexpress图像运行它时,它对我有用。

Does someone have clue what may be the problem? 有人知道可能是什么问题吗? Something with the fact that it is a zImage? 有什么事实它是一个zImage? Is there a way to debug it? 有没有办法调试它?

Thanks! 谢谢!

"QEMU sits there and prints nothing" is quite a common symptom, and it almost always means "the guest kernel crashed before being able to print anything, because it wasn't configured correctly". “QEMU坐在那里并且什么都不打印”是一个非常常见的症​​状,它几乎总是意味着“客户内核在能够打印任何内容之前崩溃,因为它没有正确配置”。 This is pretty much the same effect you get if you try to boot a wrongly configured kernel on real hardware, and the process for debugging it is about the same: 如果您尝试在真实硬件上启动错误配置的内核,这与您获得的效果几乎相同,并且调试它的过程大致相同:

  • check the obvious kernel config options are set correctly: in particular, that you have built it to support the ARM board and CPU that you're trying to run it on, and that you've enabled support for whatever devices you're trying to use for console output 检查明显的内核配置选项是否设置正确:特别是,您已经构建它以支持您尝试运行它的ARM板和CPU,并且您已启用对您尝试的任何设备的支持用于控制台输出
  • give yourself the maximum chance of being able to see something, by configuring QEMU to output serial port information, and configuring the guest to send its console output to serial, and enabling any earlycon/earlyprintk options you can (serial output happens much earlier than graphics output, and the Linux kernel earlycon/earlyprintk options mean the kernel will start printing output earlier than it defaults to) 通过配置QEMU输出串口信息,配置guest虚拟机将其控制台输出发送到串口,并启用任何earlycon / earlyprintk选项,可以给自己最大的机会看到一些东西(串行输出比图形更早出现)输出,Linux内核earlycon / earlyprintk选项意味着内核将比默认值更早开始打印输出
  • if you have a kernel that works, and one that doesn't, look at the differences between the kernel configs to see if one is missing something 如果你有一个有效的内核,而有一个没有的内核,请查看内核配置之间的差异,看看是否有遗漏
  • if all else fails, you have to break out the debugger to find out what's going on 如果所有其他方法都失败了,你必须打破调试器才能找出发生了什么

Nothing about this is particularly QEMU specific -- it's the same sort of pain you have to go through if you're trying to do kernel bringup on hardware. 没有任何关于这一点特别是QEMU特定的 - 如果你试图在硬件上进行内核启动,那么你必须经历同样的痛苦。

PS: my first guess is that the kernel is crashing because it doesn't have enough memory -- you haven't passed QEMU a '-m' option, so it is defaulting to 128MB; PS:我的第一个猜测是内核崩溃,因为它没有足够的内存 - 你没有通过QEMU'-m'选项,所以它默认为128MB; the vexpress-a9 board can handle up to 1GB. vexpress-a9主板最高可处理1GB。 earlycon would probably be sufficient debug output to identify this issue. earlycon可能是足够的调试输出来识别这个问题。 You also aren't passing a device tree blob via -dtb, which may be an issue for newer kernels (older kernels would happily boot without one). 您也没有通过-dtb传递设备树blob,这可能是较新内核的问题(较旧的内核很乐意在没有内核的情况下启动)。

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

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