Monday, March 28, 2011

Computer Engineering

Though I walk through the valley of the shadow of hardware,
I shall fear no kernel.

And, y'know, I'll pwn the invading recognizers in hardware.

Saturday, March 12, 2011

I have amazing friends.

I'm grateful.

Linaro Start Line

So, for work I've been asked to get a hang of the Linaro (www.linaro.org) toolchain.

What the heck does that mean?

More importantly, how can they reorganize their website so one can rapidly get started?

Well, first off, Understand who they are. Get on their IRC channel and ask questions--especially about where to find information.

See, I'm to do some kernel work, so I need to cross compile things. I need a full operating system to drop them in. Every time I try to Google or navigate their pages to find the processes I just read about so clearly, I get confused.

Thus I'm posting a tentative index to the learning curve pages.

Linaro is a set of programs that make it easy to build a ground-up ARM-based system. Presently Angstrom and Ubuntu (and one other?) have prebuilt images made with the toolchain.

I found that the best place to start is an impossible-to-find wiki page that links to several of the many HowTo articles available elsewhere on the site:
https://wiki.linaro.org/Mentoring/HowTo

Process to install an image:
Get an OS-specific image (a pain, more on this later)
Get a hardware-specific "hardware pack" (Not so hard...I think)
Run "linaro-image-create" with a slew of (well documented) arguments (more on linaro-image-create in a moment)
Plug in card
Boot

This "linaro-image-create" tool has a forest of voodoo behind it, most of which is designed to be hidden. This, of course, means it has some dependencies. If you're running any of the supported boards (run it with only certain arguments and it'll dump a list), it's a matter of enabling the PPAs (more on that later) and installing two packages, gcc-gnueabi-*? and linaro-image-tools. I think. I'm doing this on my machine as we speak.

OK. So I need to find the images. This has been a pain. The "Images" link on the page above isn't helpful.

AHA!

So, from Mentoring/HowTo, go to "Booting Hardware with Linaro Tools." I have a Gumstix Overo board, so that's what I followed from there. (Note the link down below to generic instructions for linaro-media-create.)

Here is where we install linaro-image-create. Follow the instructions at "https://wiki.linaro.org/Boards/Overo/Setup". (This page is rendered partially redundant by this wiki page, but valuable things are said here if you're running any Ubuntu 10.10 or earlier.)

This next part takes a touch of magic for me, as I'm running Ubuntu 10.10. See, the linaro-image-create that is in the PPA is too old to support Overo boards. (This won't be the case in Ubuntu 11.04 come April or May.) This means I need the bleeding edge build of linaro-media-create. (4.3 worked fine for me.)

Bleeding edge comes with a price: Dependency Hell. No matter what we do to shrink it, this special place will forever haunt those who strive to wander far from the well-trodden paths of software usage. I kinda like it sometimes--it's a big puzzle game.

In our case, the README that comes with linaro-media-create specifies two dependencies that can't be satisfied by Ubuntu 10.10:
python-debian >= 0.1.16ubuntu1
qemu-kvm-extras-static >= 0.13.0

I found it trivial to find the prerelease package of python-debian of a high enough version and get it installed. (http://launchpadlibrarian.net/49675715/python-debian_0.1.16ubuntu1_all.deb) (note that I did this AFTER installing linaro-image-tools the ordinary way, thus establishing its dependencies.)

qemu-kvm-extras-static is another ball game. See, it doesn't actually exist in 11.04. The tinyurl addresses provided give you small 7kB packages that install seamlessly but do nothing. (They are meta packages that will make the upgrade smooth, but this idea breaks when we pull single .deb's at a time.) At the time of this writing, the package you need is actually qemu-user-static, 0.14 or newer. Without this step it will crash saying that certain instructions are not understood by the emulator.

Once you find THAT (wget http://launchpadlibrarian.net/65940960/qemu-user-static_0.14.50-2011.03-1-0ubuntu1_i386.deb), however, invoking linaro-media-create from the place it was untarred to should work.

You'll notice that the syntax of linaro-media-create is fairly straightforward, yet fairly involved. (I used "sudo ./linaro-image-tools-0.4.3/linaro-media-create --mmc /dev/sdf --hwpack hwpack_linaro-overo_20110202-0_armel_supported.tar.gz --dev overo --binary linaro-natty-headless-tar-20110203-1.tar.gz") It requires two files be handy: the system image and the hardware pack. The Overo/Setup page hard-codes some possibly outdated images into their command lines. Here is how to find your image:

Go to https://wiki.linaro.org/Releases#Obtaining%2520and%2520Testing%2520Linaro%2520Images
Scroll down. Some structural details are located here that are nice to read, but we're looking for the headers "Evaluation Builds" and "Developer Builds." (Here GUI/no GUI and system size are required decisions.)

Aw Crapola. It seems at the time of this writing that these links link fine...but the pages they link to are blank. Lovely.

I pulled mine from
http://releases.linaro.org/platform/linaro-m/hwpacks/final/hwpack_linaro-omap3_20101109-1_armel_supported
and
http://releases.linaro.org/platform/linaro-n/headless/alpha-2/linaro-natty-headless-tar-20110203-1.tar.gz
per my decisions earlier. (Use the root URLs to find the latest and greatest of these.)
I'm not sure why mine worked with the hwpack a different version from the build.



Plug in the card you just made and try to boot.

I have yet to need the "sleep hack" or to encounter the bug listed here: "https://bugs.launchpad.net/linaro/+bug/728734?comments=all".

TODO: prettify and integrate with wiki.

Saturday, February 26, 2011

Berry Punny

From time to time you will find items like this here.

Q: What do you get when Apple buys the capital of Libya?
A: IEEE!

(Edited 2-27-11. Original: What do you get when Apple buys Tripoli?)

Thursday, February 10, 2011

Electric Tomato Plant

I planted a plant a month or two ago. I knew the soil wasn't the greatest--sandy, loose, quick to drain--but I looked at the plot and said, "This is just what Here needs."

It was hard to get growing. The first week was painful.

It started to grow. Two friends of mine offered stakes to support it. With some twine and encouragement it started to rise to the challenge.

I'm still not sure what kind of plant it is. Were it woody, it would grow strong and tall with kind guidance. Were it weedy, it would use the stakes and twine as a scaffold to reach air and sunlight but never stand on its own.

Today is a day of decisions. My friends have asked for their stakes back.

I remember the first week--I never thought this little slip could even take root where I'm growing it. Now its nodding its feeble head towards the sun, and I have to decide what to do to help it grow.

What kind of plant do I want?

Crowbars

If you do something stupid with an electronic power supply, sometimes they are equipped to sense it and throw a crowbar across the output to protect the insides. Picture a Jacob's Ladder running, an evil scientist cackling maniacally, and a hero sneaking through the shadows carrying a crowbar--he then poises to cast his payload into the crackling storm of electricity--

If you're reading my blog, you probably know by now that something rather technical shows up once in a while. This is one of those posts.

I'm checking out a Con Avionics HS26-13.5 analog power supply. It weighs a good 30 lbs. and is rated at 24-28 VDC at 13.5 A. This particular unit has been dropped on its head. The front right top corner has been displaced a good inch into the volume of the machine.

I could tell the case would short a couple of contacts inside if it were powered up, so I resolved to get the cover off. Well, first thing to do is take an odd silver (matte aluminum) box off the back. It's a -Con Avionics OVH26-13.5. Google says "con avionics ovh26-13.5" doesn't exist. At the moment I think it's merely a sophisticated external overvoltage crowbar circuit.

It's connected across the output. It has large bolt-mounted diodes or SCRs of some kind and an MCR648-2 mounted on the outside on a moderate heat sink. The supply is "HS26-13.5" while the attachment is "OVH26-13.5," so it seems to me we have Over Voltage Handler or somesuch with a common voltage-current pair with the supply proper.

Wednesday, February 9, 2011

Solfeg

After listening to his music tutor sing a long and clear note, a novice innocently asked him, "is that so?"

"Nah," the Master replied, "It's just me."

Realizing his pun had not gone undetected, "D'oh!" slipped past the novice's filter.

The Master shook his head at what a ray of light this young whippersnapper was.

Notably, he thought, This is fa' better then being T'd off. Lahts bettah.

Does that bring us back to sew?

Not without a bit more doh.