Repository navigation
Extract the SGX543 microkernel from the A6 GPU kext - #95
Merged
Merged
Conversation
brkosebay
force-pushed
the
submit/n42-sgx
branch
from
December 1, 2026 17:34
22a91fd to
d94fa0f
Compare
brkosebay
marked this pull request as draft
December 1, 2026 17:48
The iPhone 5's kernelcache (S5L8950X, 12H321) holds the SGX543MP3's kext under another driver class, SGXDriver543RC2, and no string "SGXDriver543" alone, so sgx543-from-kernelcache@1 found no kext in it. Match either class. The A6's kext is another build: its __data is 0x14eb4 bytes and its __const 0x300, and the container carries them the same way. The P105 container comes out byte for byte as before (5f929f35...). Assisted-by: LLM Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com>
The iPhone 5's peripheral recipe in orchard takes Mesa's graphics event template, 168 bytes, out of the A6's dyld shared cache with a new key on the input: "range": [offset, bytes]. The tools ignored the key and handed over the whole cache, whose hash then did not match, so the firmware build for the N42 stopped there. Read the key: a range needs a rootfs path and a pinned sha256, is not empty and does not run past the end of a 64-bit offset. The file is read from the system volume (at most 512 MiB) and the range cut out of it. Assisted-by: LLM Signed-off-by: Berkay Kösebay <brkosebay@users.noreply.github.com> [Orchard: rebased onto main next to MemberOf; dropped the ORCHARD_FIRMWARE_ROOT and ORCHARD_FIRMWARE_KERNELCACHE inputs from a local folder or kernelcache, which this recipe does not need; added a test for the range key, the changelog line and the commit message.]
henrikklee
force-pushed
the
submit/n42-sgx
branch
from
December 5, 2026 01:14
733a6c1 to
76dfa0d
Compare
henrikklee
marked this pull request as ready for review
December 5, 2026 01:14
Contributor
|
Thank you, Berkay! This is merged: the iPhone 5's GPU firmware and the graphics event template for Mesa now build from Apple's files, which orchard's N42 recipe has been waiting for. What we changed on your branch before merging:
One thing we left as it was: the range read still loads the system file (up to 512 MiB) into memory to cut out its 168 bytes. Reading just the range would mean a range reader through the APFS extents, which isn't worth it while the same recipe reads the whole dyld cache anyway. It reaches people with the next tools release. |
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accept the A6 SGXDriver543RC2 class alongside the A5 class when extracting the firmware from a locally supplied kernelcache. This enables the iPhone 5 recipe. The PR contains Rust source only. The workspace passed cargo build and cargo test.