Showing posts with label RaspberryPi. Show all posts
Showing posts with label RaspberryPi. Show all posts

Tuesday, 3 September 2013

Running Raspbian image via qemu on x86_64

While testing some virtualisation configurations I came across mention that it is possible for qemu to run code compiled for different architectures. I was particularly interested in arm, as I could then run some quick testing of Raspberry Pi stuff from my laptop.

So here is how to get Raspbian OS running under qemu.

I needed to install the package containing qemu-system-arm to allow me to run software compiled for arm. I also needed a suitable kernel compiled for arm as well, there are some good instructions located at http://xecdesign.com/compiling-a-kernel/ .

The particular arm cpu I am going to use is arm1176, first double check that this is provided by qemu, it should show up in the list of cpus given by the command
qemu-system-arm -cpu ?

The particular arm machine I am going to use is versatilepb, for a full list of machines run
qemu-system-arm -M ?

Next I need a copy of Raspbian OS image from http://www.raspberrypi.org/downloads, extract from the archive.

To boot the OS I use the following command
qemu-system-arm -kernel <location of kernel for arm> -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" -hda 2013-07-26-wheezy-raspbian.img

This did not work upon first attempt, this is mentioned on the Raspberry Pi forums. I changed my command to include an additional kernel boot parameter init=/bin/sh, and once booted up I remounted the root filesystem rw and commented out the line in /etc/ld.so.preload.

I restarted the OS using the unmodified command above and it booted.

Monday, 24 June 2013

Early Birthday Present

For the last few days I have been playing with my early birthday present (thanks to my wife), a Raspberry Pi.
Bought the kit from Maplin so I did not have to buy extra pieces (with the exception of an HDMI to DVI adapter) and could just plug it in and power it up.
The aim is to use it to do some programming with it.

I know it is billed as a credit card sized computer, however I had the impression (not sure why as I have seen them before) it was a little bigger. It is tiny, see comparison photo.

RaspberryPi
Raspberry Pi next to ruler

















I have been messing round with using the pygame library that is built on top of SDL. Thinking of re-working some examples given to some of my university students using this library, should be fairly easy to convert from java.

Seemed to be a problem the other day with uploading photos to the blog so delay in posting this entry.