1

I am designing a custom OS for the RPi Zero W for an embedded application. The idea is to use Buildroot to strip the Linux Kernel right down to it's bones using a custom bootloader, static device nodes, etc. I'm hoping to achieve the 2-3 second boot time I've seen on some Youtube videos, which hopefully should be achievable seeing I don't need any GUI.

Anyway, to make development a bit easier I'm hoping to test the builds using QEMU or something similar. I'm wondering - how faithful is emulation of the RPi going to be? Will all devices be emulated at the hardware level or does QEMU merely emulate the ARM processor? Will the speed be comparable to a real RPi or will it be faster or slower?

  • 2
    It's going to be easier to use a Zero, 3A+ or 3B+ as you'll get a guaranteed emulation of any Raspberry on any other Raspberry. – Dougie May 22 at 9:47
  • Yes, it's looking like that's the best way to go. – Jeremiah Rose May 23 at 3:48
3

Will all devices be emulated at the hardware level or does QEMU merely emulate the ARM processor?

Rasbpian kernel expects some devices to be present at boot time, so QEMU will have to emulate those. The exact list of emulated devices will depend on the QEMU settings, device tree file and the kernel image you will use. For instance, these kernel images are modified to run on the emulated version of Versatile PB, which is quite different board compared to the RPi (e.g. it only has 256 MB of RAM). Another (recently added) option is to run vanilla images with raspi2 virtual machine which, as its name suggests, emulates something close to an RPiv2. AFAIK it still has problems with networking and GUI, and it will of course still be different from RPi Zero W.

Will the speed be comparable to a real RPi or will it be faster or slower?

This depends solely on your host machine. Given a fast enough computer, you can outrun an actual RPi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.