qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Booting Raspbian on RPi emulation


From: Ben Hekster
Subject: Re: [Qemu-devel] Booting Raspbian on RPi emulation
Date: Tue, 18 Dec 2018 13:53:51 -0800

Hi, Zoltan—

> On Thu, 29 Nov 2018, Guenter Roeck wrote:
> On 11/29/18 6:42 PM, BALATON Zoltan wrote:
> On Thu, 29 Nov 2018, Guenter Roeck wrote:
> On 11/29/18 4:43 PM, Philippe Mathieu-Daudé wrote:
> Hi Zoltan,
> 
> On 29/11/18 21:29, BALATON Zoltan wrote:
> Hello,
> 
> I could not boot Raspbian on QEMU's raspi emulation and I'm not sure why
> it fails. So question is if this is supposed to work or am I doing
> something wrong or any clues what may be missing? I'm trying with this
> command line with v3.1.0-rc3:
> 
> qemu-system-arm -M raspi2 -serial stdio \
> -kernel rpi-kernel7.img -dtb bcm2709-rpi-2-b.dtb \
> -append "rw earlyprintk loglevel=8 console=ttyAMA0,115200
> dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2" \
> -drive file=2018-10-09-raspbian-stretch-lite.img,format=raw,if=sd
> 
> Kernel starts to boot, I see raspberries on the guest screen and log
> output to serial:
> 
> Booting Linux on physical CPU 0xf00
> Linux version 4.14.71-v7+ (address@hidden) (gcc version 4.9.3
> (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1145 SMP Fri Sep 21
> 15:38:35 BST 2018
> CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
> [...]
> 
> My version (https://github.com/groeck/qemu <https://github.com/groeck/qemu>) 
> seems to work, using
> Tried with your v3.1.0-local branch but got same results (does not find 
> mmcblk0 on raspi2, nothing on raspi3) so probably it's not one of the patches 
> in your tree that's missing.
> multi_v7_defconfig.
> Then maybe it's your kernel config that's different? Do you have compiled 
> kernels available that I could try?
> Shouldn't be, but I attached my configuration. This time with v4.14.84 and
> "make ARCH-arm savedefconfig" after building the image. The output is 
> identical
> to "make ARCH=arm multi_v7_defconfig; make ARCH=arm savedefconfig".
> 
> Oh, and here is my qemu configuration.
> 
> --disable-user --disable-gnutls --disable-docs \
>        --disable-nettle --disable-gcrypt --disable-vnc-png \
>        --disable-xen --disable-xen-pci-passthrough \
>        --enable-debug --disable-strip
> 
> That should not make a difference either, but who knows.
> Just to be sure, I copied a kernel and a root file system
> to http://server.roeck-us.net/qemu/arm-raspi2/ 
> <http://server.roeck-us.net/qemu/arm-raspi2/>
> It boots with your kernel (also the raspbian-lite image) so it's likely that 
> the config of the Raspbian kernel is different and that causes the problem. 
> Unfortunately I don't know what config their kernels use. If I'm not mistaken 
> this is the raspbian kernel repo:
> https://github.com/raspberrypi/linux/ <https://github.com/raspberrypi/linux/>
> 
> My guesses would be bcm2835_defconfig or some other bcm*config? Or something 
> completely different?
> Regards,
> BALATON Zoltan

I had the exact same issue; for me it was just the addition of Günther's 
"rootwait" option that resolved it, so:

$ qemu-system-arm \
        -m 256m \
        -M raspi2 \
        -cpu cortex-a7 \
        -append "console=ttyAMA0,115200 root=/dev/mmcblk0p2 rootwait rw" \
        -dtb bcm2709-rpi-2-b.dtb \
        -drive file=2018-11-13-raspbian-stretch-lite.img,if=sd,format=raw \
        -kernel kernel7.img \
        -nographic

Did it for me using stock QEMU 3.1.0.  (I need "-nographic" because the OS X 
port crashes without it)

Ben



reply via email to

[Prev in Thread] Current Thread [Next in Thread]