arm64 T8010 (iPad 6)
Darwin on Apple’s own hardware, the A10 in the iPad 6. The device is reached through checkm8, a flaw in its boot ROM that lets it load unsigned code. It booted to a shell on the device’s own display on PureDarwin’s older Darwin 20.5 tree, and support is being brought over to the current tree.
Building
nix build .#kernel.arm64.t8010.release # or .debug
nix build .#kc.arm64.t8010.release
nix build .#ramdisk-arm64-t8010
There’s no disk image. The root filesystem is a 160 MB ext4 RAM disk mounted as md0,
loaded together with the kernel collection.
Getting Code Onto the Device
checkm8 puts the device in a state where an unsigned image can be loaded, and a modified
PongoOS chainloads PureDarwin from there. The tooling lives in our
checkm8-tools (gaster plus PongoOS, both packaged with Nix), and the chainload itself
is a pdload/pdboot PongoOS module with a prejump hook.
PongoOS is a Mach-O ld64 preload, so it links with the same
native-ld the rest of we use. Its default 128 MB and 64 MB size caps had to
be raised to fit the collection and ramdisk.
Console
There’s no serial console on this device, and PureDarwin doesn’t need one. The console is the iPad’s own display: iBoot hands a live framebuffer to PongoOS, PongoOS passes it along, and the kernel inherits something already lit and already configured. Nothing in PureDarwin has to bring up the display hardware, work out its geometry, or know anything about it at all, which is why a target with five kexts and no graphics driver still puts a visible shell in front of you.
This display is borrowed from iBoot. Changing a mode, driving the panel directly or booting without iBoot all still need display work of our own.
Kexts
Five: corecrypto, pthread, PDArmPlatformExpert, ext4, Ext4FileSystemDriver.
Nothing else is needed to reach a shell, and everything else is future work.
Interrupts
PDAppleAIC implements the Apple Interrupt Controller as an IOInterruptController.
The bootloader also has to quiesce interrupts before jumping, or sleh_irq panics on a
NULL handler.
Build Notes
Five things in the kernel needed working around because Apple builds this with an
internal clang: -mcpu=hurricane, several unnamed HID, PMC and error registers, and
memmap_types.h.
The collection uses the MH_FILESET path, which sidesteps a non-fileset
__LASTDATA_CONST assert that would otherwise stop the build.
Ramdisk Pruning
A RAM disk has to fit in memory twice on the way in, so the T8010 image drops
System/Library/Kernels, every include tree, the pkgconfig directories and the guest
header staging before packing.