Chikuma
ipod classic · firmware · in development
I'm rebuilding the iPod Classic firmware in modules I can recompile and hack on. I want it to behave like the original, matching the compiler's output byte for byte, I don't care. It came after Tunes, and it grew out of my earlier attempts at understanding how LBA48 kept my 120 GB Classic from taking a bigger disk. The other annoyance was the remote on the headphone jack not working.
The reverse engineering for Chikuma happens over here: chikuma.ringum.net.

How I check it¶
It runs on a QEMU model of the iPod Classic. The original firmware boots on the same machine with the same disk, so I can drive both through the same screens and compare screenshots pixel by pixel.
Each time something new works, I add a check that runs in the emulator. When I had to invent some code instead of finding it in the original, I mark it.
What works¶
- It boots from reset, through the mask boot ROM and Apple's EFI bootloader, both reproduced.
- The real-time kernel, disk, filesystems, display, click wheel, and power management.
- Music plays, and the SM1 runs my own codec programs instead of the original firmware's.
- The menus come out of the firmware's own UI archive, you can drill down through Artists, Albums and Songs, and it works in all twenty languages Apple shipped.
- iAP2 over USB, talking to iAPCenter: play and pause, Now Playing with cover art, playlists, and remote keys.

Where I'm at¶
All of this, I checked it in QEMU. On my iPod, I debugged a good while by ear with the piezo beeps. ONB, the rebuilt EFI bootloader, now brings up the hardware and chainloads disk mode, osos or Chikuma, and it can trigger WTF, which gives me a loop to try the next build.
After a long fight against my own wrong assumptions about the hardware, Chikuma boots on it and draws the language picker in Helvetica. Now it plays a video there, the picture goes through a hardware block and the sound through my own codec program on the SM1, not Apple's. Inside it I shoved the 160 GB drive from my 7G, which went to flash, and it shows in full, 159.84 GB. The rest, iAP2 among others, I still have to check it on the iPod.
In QEMU I had modelled the SM1 as a hardware decoder, when it's a generic DSP with one program per codec. I reversed its instruction set from the drivers and made x17, an assembler and emulator for the SM1. With it I wrote sosumi, my own AAC, MP3 and ALAC decoders, from zero out of each format's public reference, nothing copied from Apple's programs. They run in real time on the iPod.
