dhruvvyas90 / qemu-rpi-kernel

Qemu kernel for emulating Rpi on QEMU
2.05k stars 362 forks source link

How to use it with the latest RaspiOS Lite (2020-12-02)? #119

Open josephernest opened 3 years ago

josephernest commented 3 years ago

I'm using:

Then

qemu-system-arm.exe -kernel kernel-qemu-5.4.51-buster -cpu arm1176 -m 256 -M versatilepb -serial stdio 
          -append "root=/dev/sda2 panic=1 rootfstype=ext4 rw" 
          -drive "file=2020-12-02-raspios-buster-armhf-lite.img,index=0,media=disk,format=raw" 
          -dtb versatile-pb-buster-5.4.51.dtb

gives an endless reboot:

image

Any idea?


PS: is it also possible to test RPi4 specific distributions? Or is only Raspi 2 / 3 supported in this repo?

dhruvvyas90 commented 3 years ago

Try native emulation as this guide --> (Wiki link) You may need qemu 5.1.0+ for it though for functioning keyboard and mouse.

josephernest commented 3 years ago

@dhruvvyas90 This worked indeed:

qemu-5.2.0\qemu-img.exe resize 2020-12-02-raspios-buster-armhf-lite.img 4G
qemu-5.2.0\qemu-system-aarch64.exe -M raspi3 -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200 dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootdelay=1" -dtb bcm2710-rpi-3-b.dtb -sd 2020-12-02-raspios-buster-armhf-lite.img -kernel kernel8.img -m 1G -smp 4 -serial stdio -usb -device usb-mouse -device usb-kbd

Thank you very much :)

Little questions:

MrDiagnose commented 3 years ago

i think native emulation is emulation of the actual raspberry pi and the other is just emulation of a generic board to run raspberry pi os

MrDiagnose commented 3 years ago

@josephernest Try this for non-native emulation: qemu-system-arm.exe -M versatilepb -cpu arm1176 -m 256 -drive "file=2021-01-11-raspios-buster-armhf.img,if=none,index=0,media=disk,format=raw,id=disk0" -device "virtio-blk-pci,drive=disk0,disable-modern=on,disable-legacy=off" -net nic -net "user,hostfwd=tcp::5022-:22" -kernel kernel-qemu-5.4.51-buster -dtb versatile-pb-buster-5.4.51.dtb -append "root=/dev/vda2 panic=1"