Use the Rapsberry Pi with QEmu on Mac OS X
Warning : This article has been automatically translated by Bing Translate
Danger : This article has been automatically translated by Bing Translate
Caveat : This article has been automatically translated by Bing Translate
You may want to do tests with a Raspberry but without a handy. In another article, I had mentioned the ability to virtualize via VirtualBox. Today, It is to directly use Qemu on Mac OS.
What do we need to get there ?
- Xcode. You will need to download it from the AppStore
- Xcode command-line tools. Go into Preferences, and in the download tab, install the tools from the command line. If you do not find the option, installation of HomeBrew will offer you.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
Now it is time to move on to the configuration and installation !
- Install packages needed for compiling
brew install pkg-config brew install glib brew link glib brew install apple-gcc42
- Start the installation of Qemu
brew install qemu --env=std --use-gcc
- Contrôler le support du CPU
qemu-system-arm -cpu ?
There must be arm1176 in the list
- Retrieve a kernel suitable for emulation. You can download a sample here. You will need to unpack it first.
For this first boot, You must configure the image to not load some libraries at boot. For this, you are going to start Qemu with the following command :
QEMU-system-arm - kernel zImage - cpu arm1176 m 256 -M versatilepb -no-reboot -serial stdio -append "root = / dev/sda2 rootfstype = ext4 elevator = deadline rw panic = 1 init = / bin/bash" -hda 2013-09-25-wheezy - raspbian.img
With this command, asked 256Mb memory, to load the image (the file IMG) as a device hda and start /bin/bash to have a shell without starting different services.
Once you have the hand, you need to put a # before each line (in principle it is a) file /etc/ld.so.preload. You save and you stop Qemu.
You will now use a classic boot, that is to say without asking a shell in the phase init :
QEMU-system-arm - kernel zImage - cpu arm1176 m 256 -M versatilepb -no-reboot -serial stdio -append "root = / dev/sda2 rootfstype = ext4 elevator = deadline rw panic = 1" -hda 2013-09-25-wheezy - raspbian.img
You will arrive after several (long) minutes, on the command screen raspi-config :
At the exit you can shut down the system.
Third start-up (and the following)
You always use the same command. And according to your settings, You can arrive on the GUI, ready to make your project !
Limitations, There are ofcourse. The most important for me is the non emulation of the GPIO. So if your project contains electronics, vous devrez toujours utiliser l’original 😉
Have fun !