macOS 27 (“Golden Gate”) x86_64 Bring-Up

Darwin 27.2.0 · Test 18 KVM

Experimental Darwin 27.2.0 (26B131, xnu-13432.41.4~25/RELEASE_X86_64) compatibility research and live kernel bring-up in cook0001/OpenCore-Legacy-Patcher (rd/goldengate).

Current milestone (Test 18 KVM, 2026-11-16): Active R&D only — no end-user installer exists yet. On the read-only USB overlay under Linux KVM (MacPro6,1 SMBIOS), OpenCore 1.0.6 applied all 7 Golden Gate kernel/Image4 patches, cleared _scale_setup commpage initialization, reached DSMOS has arrived, initialized AppleCredentialManager, AppleKeyStore, AppleIntelCPUPowerManagement, and AppleUSBXHCI, entered bsd_init, MAC Framework, dlil_init, and AMFI, resolved rooting via boot-uuid, and started APFS nx_mount.

Verified Kernel Bring-Up Fixes (GG T12-Fix1 – GG T18-Fix5)

Fix 1 — GG T12-Fix1: _vm_map_steal_memory

kernel · Verified Test 12–18
  • Cause: Golden Gate XNU steals 0x7000 bytes across three early chunks (0x4000, 0x2000, 0x1000) relative to _virtual_space_start while _virtual_space_start == 0, before _pmap_steal_memory(0, 0) has initialized it.
  • Effect: Early steals return low unmapped addresses near 0x0, faulting _vm_page_bootstrap and _vm_map_init.
  • Fix: Replaced the 74-byte _vm_map_steal_memory body in place to record the three chunk sizes, invoke _pmap_steal_memory(0, 0), set _virtual_space_start = %rax + 0x7000, and return %rax.

Fix 2 — GG T14-Fix2: _kmem_init Bounds Arguments

kernel · Verified Test 14–18
  • Cause: When trunc_page(start) != VM_MIN_KERNEL_ADDRESS (%rbx != %r14), _kmem_init calls helper 0xffffff800035fe90(kernel_map, min, max, 0x81) with %rsi and %rdx swapped (movq %rbx, %rsi; movq %r14, %rdx).
  • Effect: Passing min > max causes the helper to fail and return 0, trapping immediately on ud1l at 0xffffff8000afe63a.
  • Fix: Swapped the register moves (48 89 de 4c 89 f2 → 4c 89 f6 48 89 da) so min = VM_MIN_KERNEL_ADDRESS (%r14) and max = trunc_page(start) (%rbx).

Fix 3 — GG T15-Fix3: _pmap_init PV Backfill Bound

kernel · Verified Test 15–18
  • Cause: Loop 1 in _pmap_init backfills _pv_head_table entries up to 0xffffff8000000000 + trunc_page(_avail_start) even though early vm_map_init and zone allocations already mapped pages up to trunc_page(_virtual_space_start).
  • Effect: Pages mapped between _avail_start and _virtual_space_start lack initialized PV state and panic when zone relocation unmaps them.
  • Fix: Rebuilt the upper-bound comparison (andq _avail_start(%rip), %r15; addq %rbx, %r15 → andq _virtual_space_start(%rip), %r15; nop; nop; nop).

Fix 4 — GG T17-Fix4: _image4KernelBoot DeviceTree Checks

com.apple.security.Image4 · Verified Test 17–18
  • Cause: Image4.kext looks up Apple Silicon iBoot nodes /product, /defaults, and /chosen/manifest-properties via IORegistryEntry::fromPath and branches to panic on NULL, whereas x86_64 UEFI does not populate those nodes.
  • Effect: Kernel panics during Image4 init before reaching _scale_setup.
  • Fix: NOPed out the three je panic branches so missing DT nodes are tolerated just like /chosen/asmb.

Fix 5 — GG T18-Fix5a / 5b / 5c: Commpage Submaps & _vm_map_exec

kernel · Verified Test 18
  • Cause: Apple stubbed out _vm_commpage_text_init, _vm_commpage_init, and _vm_commpage_enter on x86_64 and removed the commpage mapping call from _vm_map_exec. Meanwhile, k27 dropped vmkf_beyond_max checks above user_map->max_offset (0x7fffffe00000) and enforces submap flags (flags & 0x600000) == 0x200000.
  • Effect: Test 17 panicked at _scale_setup + 0x6bd with commpage submap is null @commpage.c:135.
  • Fix: Three coordinated patches verified unique across the KDK and three KCs: (5a) dynamically resolve __DATA_CONST commpage globals via _commpage_populate %rip-relative offsets and allocate 32/64-bit data and text submaps; (5b) repurpose the skipped _vm_map_exec trace block to temporarily raise user_map->max_offset to 0x800000000000 and map data/text submaps directly via _vm_map_enter_impl; (5c) hook _vm_map_exec ahead of _vm_shared_region_enter.

Phase 2A Binary & Linking Findings (26B131)

XNU Kernel, KPI Compatibility & Hybrid KC Link

26B131 KDK + 25G342 Donors
  • x86_64 Kernel Present: 26B131 retains System/Library/Kernels/kernel (21,128,776 B, RELEASE_X86_64) alongside matching System.kext OSBundleCompatibleVersion KPIs; 0 of 37 tested Tahoe donor kexts and 0 of 75 OCLP kexts import any of the 141 removed exports.
  • Driver Removal vs. Offline Link: 61 x86_64 chipset, GPU, and T2 kexts plus 22 third-party userspace GPU .bundle drivers were removed from 26B131. Linking Tahoe 25G342 donors against Golden Gate's kernel produced a clean 33.72 MiB BootKernelExtensions.kc (41 slices, rc=0).
  • IOUSBHostFamily PlugIns: Top-level IOUSBHostFamily keeps x86_64, but 4 embedded ARM64-only PlugIns must be excluded when invoking kmutil create.

Userspace & Cryptex1,RosettaOS

AVX1 Baseline Verified
  • AVX1-Clean Shared Cache: Cryptex1,RosettaOS (141-12278-177.dmg) contains baseline dyld_shared_cache_x86_64 (dyld_v1  x86_64\0, not x86_64h), DriverKit caches, and universal AppOS apps.
  • No BaseSystem-x86_64 Asset: AssetData metadata omits cryptex-system-x86_64 and BaseSystem-x86_64, requiring custom APFS USB provisioning and userspace bridging rather than standard createinstallmedia.
python3 -m unittest tests/test_goldengate_plumbing.py -v

Target Architecture Matrix & Next Steps

Hardware Target AVX2 KDK / GPU Donor Profile Current Status
MacPro6,1 (2013) No (AVX1) 25G342 ACPI/platform + AMDRadeonX4000/AMDSupport + baseline RosettaOS x86_64 cache Lead bring-up target (Test 18 KVM cleared kernel init → APFS nx_mount)
Non-T2 Late Intel (iMac19,1/2) Yes 25G342 Intel CFL + AMD Polaris stack + Tahoe/OCLP audio Queued after MacPro6,1 userspace validation
2018–2020 T2 Macs Yes 25G342 AppleUSBiBridge + BridgeAudio* + KBL/CFL/ICL/Navi donors Offline link verified (rc=0); awaits bare-metal T2 test after Test 18+