Contributing¶
Chikuma takes only code that comes from the reverse. Every line of RetailOS behaviour has to trace back to the archive's records, the firmware's own code, or a measurement on it.
Code from elsewhere that works and looks right is hard to spot later, because it sits next to recovered work and looks exactly like it.
Where to start¶
Read these files, in this order:
| File | What it holds |
|---|---|
CLAUDE.md, at the repository root |
the method and the working agreement |
chikuma/ui/COMPONENTS.md |
every UI class, marked recovered, stand-in, or INVENTED |
chikuma/ROADMAP.md |
the plan, and what is done with the gate that proves it |
Then follow the loop. A finding that has not been through all six steps is not finished.
Before reversing anything, look first at what the tree knows already. The answer is often there:
Three things that get a change sent back¶
A constant chosen in code¶
If a value is about to be picked in code, the archive or the firmware already states it somewhere. Find where.
A stand-in that cites a function nobody opened¶
Stand-ins are allowed. A stand-in says it is one, in the file, at the place it stands in. It names the function that would answer it, and that function must have been read.
make gaps checks this mechanically. It pulls the addresses cited in every stand-in comment and asks
the symbol dump what they are called. A citation still reading FUN_xxxxxxxx points at a function
nobody has ever opened.
A test against a fixture you wrote¶
Tests run against the real volume image and the real archive blob. A fixture written to match the parser makes the test pass and proves nothing about the device.
Gates¶
Every milestone needs a gate the emulator can check.
| Command | What it runs |
|---|---|
make check |
the host tests, against the real volume and archive |
make verify |
a boot on QEMU that presses buttons on top of that, and a fault fails the gate |
Something that only the real iPod can show still owes a gate the emulator can run. Tighten the model until it fails the same way, then fix it.
Structure¶
Structure follows the firmware. If the layering you are adding differs from the image's, the new layering is wrong. HFS and HFS+ are one driver in the image, so they are one driver here.
Libraries¶
Use upstream where Apple used upstream: FreeType, SQLite, zlib and Vincent. The version is Chikuma's to choose and need not match the image's, and the file says which one it is.
For everything else, ask whether the line could have been different if Apple had chosen differently. If yes, it must be recovered. If it implements a public standard somebody already wrote, take theirs.
Reporting a finding¶
Report each pass as it lands, with hypothesis, evidence and verdict, rather than one summary at the end. Say when something you expected turns out not to be true. "I don't know yet" is a fine update.
Every report states what is measured, what is inferred and what is still open.
Hardware safety¶
Never write to a mount found by a glob. /Volumes/iPod is somebody's actual device.
Address volumes by the node the mount returned. Put test images through the repository's own mount tool, which mounts at a path of its own and refuses anything else.