Qemu showing as black screen for ARM (VM)

旧巷老猫 提交于 2021-02-10 14:25:48

问题


So I'm using this site to setup Qemu on my Lubuntu VM.

https://azeria-labs.com/emulate-raspberry-pi-with-qemu/

My errors happen when im trying to run the Qemu but the screen appears as black and it says "Guest has not initialized the display (yet)."

Looking at the error it says:

Error: invalid dtb and unrecognized/unsupported machine ID

r1=0x00000183 r2=0x00000100

r2[]=05 00 00 00 01 00 41 54 01 00 00 00 00 10 00 00

Available machine support:

ID (hex) NAME

ffffffff Generic DT based system

ffffffff ARM-Versatile (Device Tree Support)

Please check your kernel config and/or bootloader.

As you can see I used the latest kernel and raspberry image (Buster), so I'm not exactly sure if that's contributing to the error, because the source im using is pretty outdated.

$ qemu-system-arm -kernel ~/qemu_vms/kernel-qemu4.19.50-buster -cpu arm1176 -m 256 -M versatilepb -serial stdio -append "root=/dev/sda2 rootfstype=ext4 rw" -hda ~/qemu_vms/2019-09-26-raspbian-buster.img

I couldn't do the redir part from the online example because for some reason it kept saying -redir: invalid option

Here is the visual output that it's giving me:

https://ibb.co/xDmj7D7 https://ibb.co/9YrmD2M

If anyone can tell me what I did wrong, the output should be something similar to the source im using thanks! : https://azeria-labs.com/emulate-raspberry-pi-with-qemu/

EDIT: Alright i've made some progress since the last time. So i forgot to include the dtb because buster needs this as well.

-dtb /.../versatile-pb.dtb \

https://github.com/dhruvvyas90/qemu-rpi-kernel Used the command format from there, but i encountered that my file was raw so i did a drive command to format=raw

Then another error popped up: vpb_sic_write: Bad register offset 0x2c

Solved with adding: -serial stdio source: https://github.com/dhruvvyas90/qemu-rpi-kernel/issues/75

It looks like im in the raspberry, but my Qemu still has a black screen saying: Guest has not initialized the display (yet)


回答1:


I had the same situation as described above with Raspbian Buster image and kernel. But when I switched to 2019-04-08-raspbian-stretch-full.img and kernel-qemu-4.14.79-stretch without any other changes, then I was able to get graphics (I mean mouse cursor, desktop, etc.) in QEMU. Looks like versatile-pb.dtb has to be corrected for Raspbian Buster.

Raspbian Stretch in QEMU




回答2:


I use the buster img and with the parameter -dtb versatile-pb-buster.dtb(you can download it from https://github.com/dhruvvyas90/qemu-rpi-kernel), then it works.



来源:https://stackoverflow.com/questions/58641518/qemu-showing-as-black-screen-for-arm-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!