Live data from Hacker News

How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

gist.github.com

21–27 of 27 posts

Re: How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

#21
post #8
post #2

I think it's worth noting that this isn't actually emulating a Raspberry Pi. The option "-M versatilepb" to QEMU tells it to emulate a VersatilePB, which is an Arm development board that's now a decade or more old. It happens that this can be set up to use an ARM1176 CPU, which is the same as the one in the RPi. So you can run a kernel built for the VersatilePB on a VersatilePB model, and use the same userspace/files…

Also (and I know you know this, pm215) you can actually emulate a Raspberry Pi 2 machine (i.e. the bcm2836 SoC) in recent versions of QEMU with the "raspi2" machine type. There are instructions that worked for me here: https://raspberrypi.stackexchange.com/a/71172

I never got this working myself, do you get 4 cores that run the native cores ?

Running raspbian in Qemu seems slower than running on a real Pi, multicore would definitely help.

Re: How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

#22
post #21
post #8

Earlier quoted context omitted.

Also (and I know you know this, pm215) you can actually emulate a Raspberry Pi 2 machine (i.e. the bcm2836 SoC) in recent versions of QEMU with the "raspi2" machine type. There are instructions that worked for me here: https://raspberrypi.stackexchange.com/a/71172

I never got this working myself, do you get 4 cores that run the native cores ? Running raspbian in Qemu seems slower than running on a real Pi, multicore would definitely help.

Last I checked, QEMU does not run multiple cores concurrently. Similar to Python, it has a big lock that serializes execution (known as the "Big QEMU Lock", or BQL). So you should not expect speedups...

However, there is an effort to change this:

https://lwn.net/Articles/697265/

But I don't know if it has been merged yet.

Re: How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

#23
post #22
post #21

Earlier quoted context omitted.

I never got this working myself, do you get 4 cores that run the native cores ? Running raspbian in Qemu seems slower than running on a real Pi, multicore would definitely help.

Last I checked, QEMU does not run multiple cores concurrently. Similar to Python, it has a big lock that serializes execution (known as the "Big QEMU Lock", or BQL). So you should not expect speedups... However, there is an effort to change this: https://lwn.net/Articles/697265/ But I don't know if it has been merged yet.

Yeah, that has hit upstream now. It needs support in both the frontend and the backend so only some host/guest combos will enable it, but arm-on-x86 should now multithread by default for smp guests.

Re: How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

#24
post #17

I've looked in to this before to build rPi binaries on a more powerful x86 machine, but i've never been able to get Jenkins/Java running under QEMU

Why do you need Jenkins running in QEMU? Just use this: https://hub.docker.com/r/sdthirlwall/raspberry-pi-cross-comp...

Re: How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

#25
post #4

On Linux, it's even easier (lol, who would have guessed?). I recently had the need to compile quite a bit of software to run on the Pi zero, and the ability to be able to "chroot" to the Pi on my PC has made the experience so much more pleasant. Everything compiles ten times faster! I also noticed that none of the available guides work well with Ubuntu 17.04 (and possibly newer/older), so I put together a simple scri…

I had this problem with my similar script until I added 'sync; sleep 1; partprobe' after the writing the new partition information (before running e2fsck).

Great, I will check it out :)

Re: How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

#26
post #17

I've looked in to this before to build rPi binaries on a more powerful x86 machine, but i've never been able to get Jenkins/Java running under QEMU

Why do you need Jenkins running in QEMU? Just use this: https://hub.docker.com/r/sdthirlwall/raspberry-pi-cross-comp...

[deleted]

Re: How to Emulate a Raspberry Pi (Raspbian Jessie) on Mac OS X

#27
post #22
post #21

Earlier quoted context omitted.

I never got this working myself, do you get 4 cores that run the native cores ? Running raspbian in Qemu seems slower than running on a real Pi, multicore would definitely help.

Last I checked, QEMU does not run multiple cores concurrently. Similar to Python, it has a big lock that serializes execution (known as the "Big QEMU Lock", or BQL). So you should not expect speedups... However, there is an effort to change this: https://lwn.net/Articles/697265/ But I don't know if it has been merged yet.

[deleted]
Post reply on HN