weekends are for leisure

Reading Embedded Linux Primer

Been powering through Embedded Linux Primer. A few high-level things I’ve learned:

  • initrd is old, initramfs is new
  • initramfs uses a CPIO image (a type of archive that was new to me) to hold the initial filesystem contents
  • Using TFTP to boot from a remote kernel and ramdisk sounds like fun, not to mention provides great flexibility for debugging.
  • It’s not so hard to add extra items to the kernel config menu
  • Learned some ins and outs of Das U-boot, and that support for using RAM has to be initialized by the bootloader otherwise you can only use stack memory.
  • JFFS2 can help increase the lifetime of flash memory
  • The kernel boot process … through hardware-specific assembly files, common files, to the kernel C code, kernel subsystems, init.
Continue reading

Some redis benching: intsets versus hash tables

My first motivation for investigating redis was due to an optimization challenge at work. Our network of websites covers track and field and cross-country. We have a database of 13 million performance records, and naturally our site provides visitors with the ability to view up-to-date rankings. Currently we use Sphinx for this, but Sphinx is geared for full-text search, and was quite slow (we’ve since optimized sphinx further, which I hope to write about later). However, being able to produce rankings per education level, gender, season, event doesn’t require full-text search. It doesn’t require any sort of search. Instead, I decided to partition our performance IDs across several (about 60) sets and use zsets to do ordering by performance score. More about the specifics at the end.

Continue reading

Carl Sagan on supressing uncomfortable ideas

The supression of uncomfortable ideas may be common in religion or in politics, but it is not the path to knowledge. There is no place for it in the endeavor of science.

– Carl Sagan (Cosmos Episode 4)

Continue reading

Embedded Linux Primer

Didn’t expect to find any books on our outing yesterday, but I had a pleasant surprise. Last week I finished my previous book on embedded Linux, which was a great case-study-esque intro, and Embedded Linux Primer will likely be a wonderful follow-up. Some of the chapters that caught my eye:

  • Storage Considerations
  • Systems on Chip
  • Bootloaders
  • Device driver basics
  • Filesystems
  • Busybox
  • Development tools beyond gdb: cscope, strace (and others)
  • Kernel Debugging Techniques
  • Open Source Build Systems
  • udev

Test-Driven Development for Embedded C was a surprise as well. To be honest, I’ve never done much unit-testing for PHP or other web apps. And I’m not sure of the best ways to perform testing for C apps given the added step of compilation, so this book should prove quite valuable. Even if my next job doesn’t require TDD experience, it should help me write better code.

Continue reading

That's Babies. Indeed.

… that continuous spiritual deadening that the chirp of a child who you’re legally obliged to look after, in your right ear, constantly, and not letting up, and not letting you sleep …

– From YLNT - That’s Babies

Continue reading

Reading a book on Embedded Linux

What follows are thoughts while reading Embedded Linux - Hardware, Software and Interfacing. Really enjoyed it.

It walks through planning for an automation system for a winter resort. Currently at chapter 6 and there’ve been a few things I’ve not done before.

Right away I discovered you could use gdb remotely with gdbremote. Great for remote debugging of cross-compiled applications.

I’ve done cross-compilation, albeit indirectly using buildroot, but I was still aware of what went on behind the scenes, aka: compiling gcc and glibc multiple times, the first being a way to bootstrap and create a more “pure” versions tailed specifically for the target platform.

Continue reading

Stop giving it away for free and start creating brand value

Read linked content

The article hits home (click the title). And when you’re a creative type giving things away for free it can make you feel run-down and used.

I’ve had a few thoughts for infusing my Flam Swiss “brand” with more value. Producing more content that teaches is one idea. Wish I could say I had others.

Continue reading

Coding to the Mastodon station on Pandora

Had the energy and focus to make more progress on my ideas for redis last night. See my previous post here if you don’t remember what those ideas were.

The only things left to do:

  • Fix freeSetObject() such that it frees intset and/or hash table memory that may have been allocated
  • Fix code in rdb.c that’s responsible for loading the data from disk and writing to it when redis is shut down.

So, it’s 95% working! Once I fix those things, “make test” should pass, and then I can get on with the task of benchmarking my changes against the main branch.

Continue reading

Indiana Jones and the Fate of Atlantis

Passed the most important milestone of my life last evening. I beat Indiana Jones and the Fate of Atlantis, the 1992 adventure game. Been playing it on my OLPC XO.

Not sure which game I’ll start next. Maybe Full Throttle, Sam n Max, or another. Probably just go in order by release date.

Continue reading

Redis sets - Always using the most efficient encoding

Had an idea for reducing the memory footprint of redis sets. A redis set may be encoded as an intset (if the set contains nothing but integers) or a hash table. But if a set contains integers and other values, you lose out on the benefit of intsets (speed and memory efficiency) and in some cases you have to wait while redis converts your intset to a hash table. This may not be a big penalty, but it all depends on the order in which you add items.

Continue reading