Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QEMU with BeagleBone support

i would like to emulate BeagleBone Black. It seems that QEMU is the only emulator that supports Linux emulation for ARM. However i m having difficulty in getting the right emulator.

I tried using QEMU build from qemu.org but it seems that the machine "beagle" is not supported (also from the output of "qemu-system-arm -machine help" does not least beagle as supported machine). I found some posts saying that Linaro has a qemu builds with BeagleBone support and that it can be installed using apt-get on Ubuntu. There is also a youtube video with instructions:

https://www.youtube.com/watch?v=__6XmxOrL3o

It seems however that the instructions no longer work. I have Ubuntu 14.04. I tried the following:

1) sudo add-apt-repository ppa:linaro-maintainers/tools

This times out and reports an error wrong PPA format.

2) Then i followed instructions here:

https://wiki.linaro.org/Platform/Systems/Repository

However, after adding these repositories, no qemu was added, so in my apt repository i only had qemu from qemu.org (which does not support beaglebone)

3) Then i found this page:

https://launchpad.net/~linaro-maintainers/+archive/ubuntu/tools

So i tried the following:

sudo add-apt-repository http://ppa.launchpad.net/linaro-maintainers/tools/ubuntu

and then also downloaded and added the public key using "sudo apt-key add" command.

This seemed to work as after doing "sudo apt-get update" and "apt-cache show qemu-system" i get see the following:

Package: qemu-system Source: qemu-linaro Version: 2.2.0~rc3+git8+gdb12451-63linaro+trusty Architecture: amd64 Maintainer: Ubuntu Developers Installed-Size: 133812 Depends: qemu-linaro-keymaps, libasound2 (>= 1.0.16), libbluetooth3 (>= 4.91), libbrlapi0.6, libc6 (>= 2.15), libcurl3-gnutls (>= 7.16.3), libfdt1, libgcc1 (>= 1:4.7), libgl1-mesa-glx | libgl1, libglib2.0-0 (>= 2.24.0), libgnutls26 (>= 2.12.17-0), libncurses5 (>= 5.5-5~), libpixman-1-0 (>= 0.15.16), libpng12-0 (>= 1.2.13-4), libpulse0 (>= 1:0.99.1), libsasl2-2 (>= 2.1.24), libsdl1.2debian (>= 1.2.11), libstdc++6 (>= 4.6), libtinfo5, libuuid1 (>= 2.16), libvdeplug2, libx11-6, zlib1g (>= 1:1.2.0) Suggests: samba Breaks: qemu (<< 0.11.0-2), qemu-kvm-extras (<< 0.13.50-2011.02-0~rc1-0ubuntu1) Replaces: qemu (<< 0.11.0-2), qemu-kvm-extras (<< 0.13.50-2011.02-0~rc1-0ubuntu1) Homepage: https://launchpad.net/qemu-linaro/

(i only pasted the first few lines).

However, after installation of qemu-system (sudo apt-get install qemu-system), it still does not have BeagleBone support (qemu-system-arm -machine help does not show any beagle).

So i m wondering if anybody knows where to install QEMU from on Ubuntu that has BeagleBone support. Is there another repository i should be adding? I m new to Ubuntu, apt and Linaro, so i m out of ideas so far.

like image 577
Yevgeniy P Avatar asked Feb 17 '16 02:02

Yevgeniy P


1 Answers

I ran across your question because I was trying to do the same thing all day. I am also using (X)ubuntu 14.04.

The short answer is: there is no QEMU that supports the Beagle Bone out of the box.

You are correct about qemu-linaro having some support for OMAP3, including beagle and beaglexm. These are for the Beagle Board and Beagle Board xM. The Beagle Board series uses the OMAP 3530 while the Beagle Bone series (regular and black, like I have) uses the OMAP 335x.

In addition, I was unable to find a working PPA that contains binary qemu-linaro. An old version of the one you are trying to install used to contain QEMU, but doesn't anymore - even as of trusty (14.04).

According to the package list for Saucy (13.10) qemu-linaro was in that PPA.

But it is gone by Trusty (14.04). I don't know why your apt-cache shows anything at all - I wasn't even able to duplicate that.

You can build a version of QEMU that supports OMAP 3 and Beagle Board:

So what I did was to clone the git repo and compile qemu-linaro. This was straightforward, you might just need to add a few -dev packages for library dependencies. My machine already has most of what was required.

This version provides the -M beagle or -M beaglexm options.

I then spent all day trying to figure out why my Beagle Bone MDL and U-Boot kept crashing before figuring out that Bone != Board. Gah... They have slightly different memory maps and are not the same thing.

So for now I rebuilt my test images for the Beagle Board instead of Bone and it actually boots with the latest qemu-linaro!

It is unfortunate that OMAP 3 is not yet upstreamed into the main QEMU. There was some mailing list traffic about it a year ago, but it doesn't seem to have gone anywhere. It does not appear that it would be very difficult to add a Beagle Bone Black machine type, but that hasn't happened yet either.

like image 178
Anders Avatar answered Nov 25 '22 20:11

Anders