Skip to content

formats: Extract the H4 ISP firmware and set-files for the iPhone 5 cameras - #169

Merged
henrikklee merged 1 commit into
OrchardLinux:mainfrom
brkosebay:submit/n42-h4isp
Dec 4, 2026
Merged

henrikklee merged 1 commit into
OrchardLinux:mainfrom
brkosebay:submit/n42-h4isp

Conversation

@brkosebay

Copy link
Copy Markdown
Contributor

Add h4isp-from-services@1, which extracts the iPhone 5 (N42) camera ISP firmware and its sensor-module set-files from H4ISPServices in the iOS 8.4.1 armv7s dyld shared cache.

  • Without module, the step returns the H4ISPFIRMWARE section (h4isp-firmware.bin).
  • With module (e.g. 8111_01XX), it returns that set-file from H4ISPSETFILE and checks its header and size.
  • The two sections are read once and shared by all 32 outputs.

Neither existing step fits: gunzip@1 expects gzip input, and isp-setfiles-from-dyld-cache@1 (#155) reads the arm64 H6 ISP selector, not these H4 sections. The set-file names follow the module choice iOS makes, which the A6 variant of the kernel's apple-h4isp driver also uses (OrchardLinux/linux#66).

The test in crates/formats/tests/steps.rs uses a synthetic cache, so the repo contains no Apple bytes.

Testing:

  • cargo test -p orchard-formats -p orchard-boards --offline: 266 passed, 1 ignored.
  • On the real 12H321 armv7s cache, all 32 outputs (firmware plus 31 set-files, 2,224,260 bytes) match byte for byte the files the iPhone 5 cameras stream with on Linux.

The device recipe that uses this step is in OrchardLinux/orchard (linked below).

🤖 Generated with Claude Code

…ameras

Read the two raw sections of H4ISPServices in the armv7s dyld cache.
gunzip@1 expects gzip input. isp-setfiles-from-dyld-cache@1 interprets
the ARM64 H6ISP selector and cannot read these H4 sections.

The set-files are named by the iOS module choice used by the A6 variant of apple-h4isp.
Keep the two sections in memory so all 32 outputs share one cache read.

Assisted-by: LLM
Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
@henrikklee
henrikklee merged commit 1aa7d47 into OrchardLinux:main Dec 4, 2026
11 checks passed
@henrikklee

Copy link
Copy Markdown
Contributor

Merged, thank you @brkosebay! Reading the H4 ISP firmware and all 31 set-files straight out of iOS 8.4.1's armv7s cache, matched byte for byte against what the iPhone 5 cameras stream with on Linux, is a great result, and the synthetic test cache keeps Apple bytes out of the repo.

What changed on the branch: I rebased it onto main after #155 (Jeroen's A9 set-file step) landed, since both added a step to the same plan. The resolution keeps both steps side by side: the plan now carries both shared readers, and yours reads the cache with the existing dyld-cache size limit (1 GiB) instead of its own 512 MiB literal. Your commit and authorship are unchanged otherwise.

Next steps:

@henrikklee henrikklee mentioned this pull request Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants