andreiw / RaspberryPiPkg

DEPRECATED - DO NOT USE | Go here instead ->
https://github.com/tianocore/edk2-platforms/tree/master/Platform/RaspberryPi/RPi3
744 stars 143 forks source link

Booting UEFI on Qemu? #22

Closed falkor2k15 closed 5 years ago

falkor2k15 commented 5 years ago

Has anyone managed to get this to work? I am trying to find out how to get a display on the latest Qemu-System-Aarch64 and machine type Raspi3:

qemu-system-aarch64 -M raspi3 -m 1G -kernel kernel8.img

I tried adding a 100 MB FAT32 disk image with the UEFI files from May 13th, but something seems fundamentally wrong; I just get a black screen regardless of what I try to boot up in Qemu when emulating the pi3 machine type.

thchi12 commented 5 years ago

Try -bios kernel8.img

andreiw commented 5 years ago

QEMU has UEFI support for Arm64. What would (sort of) emulating an RPi3 get you?

falkor2k15 commented 5 years ago

Just curiosity mainly: to check out the state of Pi3 virtualization with UEFI firmware, and see if we can re-produce all the peculiarities from testing WoA on a real physical Pi3 - in the virtual world.

I'm waiting to hear back from the maintainer of this Qemu machine type code. I'm still getting a black screen, but I saw that they had a display when they used Qemu-System-Arm for the Pi1.

YuzukiTsuru commented 5 years ago

I can use Other Uefi to boot it from QEMU VM

thchi12 commented 5 years ago

I'm also getting a black screen. But pi2 works and can start Windows IoT(Though it seems lots of drivers don't work properly.

andreiw commented 5 years ago

If you run the DEBUG variant of UEFI and get me a serial log, that would help figure out what isn’t working.

thchi12 commented 5 years ago

-m 1024 -M raspi3 -bios /sdcard/APQ/RPI_EFI.fd -smp 4 -vnc :0 -serial file:/sdcard/APQ/output.txt -global bcm2835-fb.pixo=0 Running this on my phone. Only a black screen and there's nothing in output.txt, Weird (Debug Build May18th)

andreiw commented 5 years ago

What serial is qemu modeling? the microUART or PL011?

YuzukiTsuru commented 5 years ago

You Should Use a VGA device

thchi12 commented 5 years ago

I don't know exactly. Using rpi2 emulation and MS's UEFI and it's output says UART.. To 740291272 when emulating rpis -device VGA doesn't work.

andreiw commented 5 years ago

So PL011 then...

thchi12 commented 5 years ago

UART0 UEFI firmware (version built at 09:28:57 on Oct 16 2015) [=3h[=3h Output when emulating rpi2, Firmware extracted from iot 10586. -M raspi2 -m 512 -bios /sdcard/APQ/kernel.img -smp 4 -vnc :0 -serial file:/sdcard/APQ/output.txt -global bcm2835-fb.pixo=0

YuzukiTsuru commented 5 years ago

-M raspi3 -cpu cortex-a57

thchi12 commented 5 years ago

I think cpu is unrelated... BTW rpi3 use a53...

YuzukiTsuru commented 5 years ago

Fine XD

thchi12 commented 5 years ago

Tried setting higher resolutions and it doen't work.

falkor2k15 commented 5 years ago

It seems the project started out using a modified version of Qemu before recently having the code passed to Qemu proper, but I don't think there's been much testing done since then: https://www.raspberrypi.org/forums/viewtopic.php?f=72&t=195565

andreiw commented 5 years ago

Until either the Qemu port supports the microUART (or ATF+ UEFI can use PL011), I don't think there's anything to do here.