This Space for Rent

Department of unintended consequences, Linux-style

About a decade ago, I contributed some enhanced memory detection code to the Linux kernel so that Linux on ia32 boxes could detect more than 64mb of installed memory. It worked well enough so that Linus sucked it into the mainline kernel, and there it sits, blatting out the same old stupid memory map every time a Linux box boots.

For some reason, I thought that displaying this memory map in hex was a good idea, so that's how it ended up in the kernel.

This year I'm playing around with Yet Another Linux Distribution (not Mastodon, alas, though I've actually got a large enough base of updates and patche that I should sit down with strong drink and start trying to decypher the asm() changes after gcc 2.7 so I can actually compile libc 4 with a modern gcc) and I'm trying to write a little script to compare the e820 output with what the system thinks it has for memory (on some of the IBM x servers, this can vary by up to several hundred megabytes, depending on memory model and kernel/userland split.) What's the ideal scripting language (preferably a scripting language that hasn't fallen prey to the language of the week club) for doing something like this?

How about awk?

Awk, um, er, doesn't do hex.

And it's about 10 years too late to send Linus a revised version of the patch that displays the memory blocks in decimal.

*sigh*