Tag Archives: arm

qemu-user: Turning your dual-core 2.6GHz processor into a dual-core 500MHz processor

I just discovered qemu-user, thanks to lu_zero on #gentoo-embedded. It’s brilliant. They took QEMU’s ability to simulate an entire processor, tossed out the other hardware emulation, and packaged it up. qemu-user’s primary use is for running foreign binaries.

So far, I’ve been running all my stage generation for Neuvoo on the BeagleBoard, which has a 500MHz armv7a processor. Everything compiles very slowly, but at least it’s native and stable.

There’s a couple problems with that setup. First, everything is running off an SDHC card. We’re talking slow. Second, the beagle has 128M of RAM, and after that it’s using the swapfile. Which is on the SDHC card. Now we’re really talking slow.

qemu-user deftly solves these problems. Of course, running stage generation on my hefty 2.6GHz Core2 Duo processor is going to slightly speed up compiling, just because of the dual cores. But not only that: now I have a huge, fast 7200rpm hard-drive to run everything off of, and 4G of RAM (2 of which is almost always cache) to run it all within.

Think of it like this: qemu-user enables you to run a chroot (and possibly other things) for almost any processor on a system of your choice, as though it were running natively.

Setting up qemu-user is a piece of cake, so I won’t go into details here. Just follow these instructions. One thing I didn’t get at first was why they use “USE=static”. The reason is this: if you’re going to be running an armv7a chroot, you need something inside the chroot to be translating (qemu-user). The problem is, that something can’t link dynamically against any libraries, because they’ll all be armv7a libraries. Static linking means the binary is self-contained and portable.

Let me know if there are other cool uses for qemu-user. I’m all ears. 🙂

Gentoo for Pandora

I have a new project now. It’s called Gentoo for Pandora. It’s pretty easy to figure out what it’s all about, but I’ll summarize for those who don’t know:

Gentoo is a distributon of Linux, and it features a very flexible, very powerful package system called portage (though some would say otherwise). Gentoo’s recommended installation media doesn’t actually install anything for you, either. The entire system is all about customizing everything to your needs, which means you can leave out extra junk you know you’ll never use. Gentoo also practices “rolling updates”, which means there’s no “Gentoo v1” or “Gentoo v2”. There’s just “Gentoo”, and whether or not you’re behind is determined by whether or not you’ve updated recently. This means that you’re always up-to-date, and never have to do a time-consuming upgrade that Ubuntu requires every six months.

Now, there are problems with using Gentoo on a handheld. Continue reading