Complete beginner question: why do I have to pass an extra kernel binary when running e.g. a Debian image on an emulated Raspberry Pi? So far all the documentations state that the image files are the equivalent of a mass storage device, so if not the bootloader but at least a kernel should be present in them, no? If Qemu simulates a CPU, shouldn't this somehow even require a start from the very beginning, i.e. from the Reset Vector?
Asked
Active
Viewed 3,056 times
7
-
1I don't use QEMU but I think the reason here is that QEMU can't actually use the normal kernel, i.e., one that would be contained in a pi distro image for use on a real pi, so you need to use a different one instead, and that is probably what you are specifying. Presumably this is because QEMU is not really emulating a BCM2835/6, it's emulating some generic ARMv6/7 device, and there are some discrepancies to do with the role of the GPU in the SoC? Or something along these lines... – goldilocks May 10 '16 at 11:58
-
@goldilocks : does that mean, that the peripherals of e.g. the Raspberry Pi are not really emulated? How does the X server or any other program that accesses the framebuffer do its job then? The framebuffer memory surely is specific (different) for every GPU out there? Or is this really encapsulated cleanly in the kernel? – Vroomfondel May 10 '16 at 13:19
-
Are you running Qemu on the RPi, or on an x86 device? – Jacobm001 May 10 '16 at 14:51
-
@Jacobm001 I want to emulate the Pi (and also other ARM boards like the RIoTboard) on my x86-64 Ubuntu. – Vroomfondel May 11 '16 at 10:10
-
Note that QEMU is supposed to emulate the BCM2835 and BCM2836 in newer releases "correctly" and should not need custom kernels , build from source. – flakeshake May 11 '16 at 15:09
-
Can you post what command or script you are using to run QEMU? Are you following some published blog posting that explains how to do this? – HeatfanJohn May 11 '16 at 18:08
-
@flakeshake which "machine" is that? I compiled Qemu 2.5 but the ARMs that are listed don't mention the BCM28xx nor the Pi. – Vroomfondel May 12 '16 at 13:06
-
@Vroomfondel Apparently *-M raspi2* – flakeshake May 20 '16 at 11:20
1 Answers
3
Older versions of QEMU did not emulate the Raspberry Pi but a "Versatile PB" board.
Therefore a custom "Versatile" kernel is running inside QEMU , the userland of Raspberry Pi images works somewhat fine on top of it (YMMV) - as the whole point of the Linux kernel is to provide this very abstraction.
See here on how to really emulate the Raspberry Pi 2 with QEMU built from source.

flakeshake
- 6,235
- 1
- 14
- 33