40 KiB
Xiaomi 12 (cupid)
Xiaomi 12 (cupid, SM8450) running iOS 27.0.1 (24A446, arm64e) under an iPhone17,2 / D94AP identity. The kernel reaches BSD init; the active milestone is SM8450 UFS storage and the root volume.
Source record: porting.toml, ab8d7e9e7e93aa05febc059a6916cbdfbfcab5cb.
This page is generated from the device record.
| Area | Status |
|---|---|
| Configuration | implemented |
| Firmware and boot | host-verified |
| CPU and interrupts | implemented |
| Memory and DMA | implemented |
| Storage and root | device-verified |
| Display | planned |
| Input | planned |
| GPU | planned |
| Network | planned |
| Audio | planned |
| Power | planned |
| Image assembly | host-verified |
| Diagnostics | planned |
Configuration
implemented
Hardware and dependencies
- SM8450 SoC source pin; iPhone-flavoured iOS 27.0.1 build 24A446 profile; cupid defconfig and device tree.
- UniXNU main does not ship an iPhone OS profile: this repository carries profiles/os/ios-27.0.1-24A446 and installs it into the checkout.
Configuration
- board.os_profile = ios-27.0.1-24A446; board.soc = SM8450; board.soc_source = sm8450; schema_version = 2.
- profiles/os/ios-27.0.1-24A446 is the iPhone17,2 (D94AP) 24A446 profile with the upstream XnuPrelink 24A446 fixture retargeted to the iPhone collection. It is the only OS profile in this repository.
- NOT the shipped ipados-27.0.1-24A446 profile: different IPSW, original kexts and ADT identity.
Procedure
- Read https://unixnu.com/porting/device-repository and https://unixnu.com/porting/records.
- Run scripts/install-os-profile.sh ../UniXNU to install the iPhone 27 profile into the UniXNU checkout.
- Run ./unixnu defconfig cupid_ios27_defconfig -D ../UniXNU-cupid, ./unixnu fetch -D ../UniXNU-cupid, ./unixnu status --json -D ../UniXNU-cupid.
- Run .github/workflows/userdata.yml on a macOS runner to build the iOS 27 userdata image; download the chunks and flash it with fastboot flash userdata.
Development findings
- feeds.toml pins refer/IOStorageFamily at 7edb88fb: build-sheng-source-storage.py hardcodes that public-headers revision and prepare-storage-headers.py refuses any other checkout, while UniXNU main moved the base feed to e45fbe3. The source is only used for the storage ABI headers, not a binary.
- board.kit is sheng, not cupid: build-sheng-source-storage.py looks for the device package at kits/sheng when it runs from the assembled tree (its --device default is the tree). The kit is only the package folder; board.name and all output paths stay cupid.
- The upstream 24A446 fixture's data entries: the 13 vnodeop_desc descriptors are retargeted to the iPhone 27 collection by their unique vnop_* name strings and vdesc_name slots; the 8 metaclass slots and _gIODTPHandleKey, _audio_active, _tk_rawcc, _tk_nin and _gPESerialBaud remain to be retargeted by the reference data map/source consumers. notes/IOS27-SHENG.md records the fixture/recipe, the generic sheng 24A446 bring-up hunks and the relevant 4 KiB/arm64e/prelink/security/bring-up docs.
- An iPhone profile is required for a phone: iPadOS presents iPad product identity, idiom and display assumptions that SpringBoard and UIKit read from /product.
- Arrays replace inherited arrays: board.toml repeats every selected component, configuration fragment and patch series entry.
- The macOS workflow repairs two stale UniXNU submodule gitlinks before fetch: ArmCpu 2e11cda/16040839 to the existing 93a5030, and AppleKeyStoreState 6ff4f11 (gone from the remote) to main 58e5461. The latter blocked build 42779052201 in the resolve step. The macOS workflow builds the EDK II package (UniXNU.efi) after the kernel, so a push that changes board.toml, profiles, configs or the workflow itself exercises image assembly without the phone.
- scripts/build-cupid-dtb.sh builds the firmware DTB from the LineageOS waipio-v2 + cupid overlay (cpp + dtc + fdtoverlay), sha256 6246e11cc2867946183b7e453797d5ec0fb3c49c6297115f2605a7bf8c0e0b50. It is not byte-identical to the stock vendor_boot base+dtbo merge (956745 bytes, sha256 ea574733...): the stock base is a larger vendor tree. The device reports dtb_idx 10 (Waipio v2) and revision 2.2. The live ABL FDT was pulled from the phone (sha256 3d669081f48c6a810f0d95f7c5fa37d62dcb1c40a9d6fe4eb8b79bc24bebf7f0, 773371 bytes, model 'Cupid based on Qualcomm Technologies, Inc SM8450') and scripts/build-cupid-dtb.sh accepts it with UNIXNU_CUPID_LIVE_FDT; the compiled tree now patches the cupid root identity and measures 451042 bytes (sha256 7604f605...).
- macOS cpp mis-parses -x assembler-with-cpp (cc: no input files); the DTB script now defaults to clang -E and the workflow builds cupid.dtb before the kernel so a tree failure is not hidden behind a 19-minute kernel step.
- notes/FASTBOOT.md records the one-boot procedure: fastboot boot loads the image into RAM, nothing is flashed, and the unlocked state must be confirmed before the Gunyah PAC test.
- The workflow applies patches/unixnu/*.patch to the UniXNU checkout before building; patches/unixnu/0001-patch-xnu-entry-probe-skip-nm-headers.patch makes the entry-probe parser skip non-hex nm header lines.
- The payload step passes --uefi ../uefi-cupid: panic_screen=true needs Mu-Silicium FrameBufferSerialPortLib/Font.h; without it patch-xnu-entry-probe.py aborts before writing the volume.
- notes/first-boot-2026-11-07.md is the first device boot result: fastboot accepted the image but the screen stayed black, traced to the FD base 0xA7100000 versus the stock UEFI ELF window at 0xA7000000 size 0x2A2000.
- notes/first-uefi-boot-2026-11-07.md records the first successful UEFI boot: header v4 reaches BootShim and the UniXNU menu on cupid; the payload volume is not published (no SimpleFileSystem), so the menu falls back to BDS.
- The workflow applies patches/darwinboot/0001 inside the DarwinBoot submodule after the kernel step has fetched it, so the firmware build sees the window diagnostics.
- notes/pac-trap-2026-11-07.md records the first XNU start and the Gunyah trap on the EL1 PAC key write; the next image disables the key-programming block.
- The panic instruction was decoded as 0xd51be228 (msr CNTP_CTL_EL0), not PAC: the screen wrapped instr=d5 onto the next line. The timer is the current blocker; the record was corrected.
- The macOS workflow uploads cupid-native-symbols (unstripped native kernel, kernel.json and kernel.map.json) so an unmatched target can be reviewed against real symbols offline.
- The iOS 27 kernel passes every remaining import stub and reaches BSD init. It now panics in IOKitBSDInit.cpp "Failed to mount root device": no IOMedia carries the iOS 27 OS volume UUID. CONFIG_XNU_NATIVE_UFS is not set, package/Sm8450Ufs is only headers plus a host test, and the iOS 27 SHNGROOT userdata image is not installed. notes/ROOT-UFS.md records the milestone; patches/xnu/ufs-probe.patch reports the SM8450 GCC/UFSHCI state read-only.
Completion criteria
- status resolves ios-27.0.1-24A446 with arch arm64e, the sm8450 SoC source and the cupid_ios27 defconfig; the iPhone17,2 24A446 kernelcache prelinks with the retargeted fixture and the kernel reaches BSD init.
Current limits
- The iPhone17,2 identity advertises a 1320x2868 display; cupid is 1080x2400. Display identity is corrected with the panel milestone.
Next action
- Boot the unixnu-ufs-probe build, record the GCC/UFSHCI values, then implement and enable the SM8450 UFS block driver and flash the iOS 27 userdata image.
Evidence
source: Resolve, arm64e kernel build, iPhone17,2 prelink and EDK II package steps used by the host-verified runs.device: ro.board.platform=taro, ro.boot.hardware.sku=cupid, dtb_idx=10 (Waipio v2), dtbo_idx=19, cpuid=0x0000043252a25a21, serialno=1cb22738; /sys/devices/soc0 revision 2.2. Command:adb shell su -c 'getprop | grep ro.boot'. Revision:4730e3b1fb52e1238a5d370bdc1f381622033de9.
Firmware and boot
host-verified
Components: DarwinBoot.
Hardware and dependencies
- A Mu-Silicium UEFI fork for cupid (uefi-cupid), cupid's stock UEFI/ABL firmware and the live ABL device tree.
- PSCI SMC entry, GOP framebuffer handoff and the memory map UniXNU may own.
Configuration
- board.toml [firmware] names config cupid, dsc Platforms/Xiaomi/cupidPkg/cupid.dsc and the SILICIUM_UEFI.fd path.
- Firmware DSC/FDF must embed UniXNU, UniXNUDxe, DarwinBoot, UniXNURamDiskDxe, DiskIoDxe and FAT support.
Procedure
- Fork uefi-sheng into uefi-cupid, add cupidPkg and its Binaries/cupid module from the stock UEFI image.
- Build with ./unixnu build firmware -D ../UniXNU-cupid --uefi ../uefi-cupid.
- Record the firmware revision, FD size and the handoff memory map.
Development findings
- uefi-cupid is forked from UniXNU/uefi-sheng and carries Platforms/Xiaomi/cupidPkg: CUPID_VENDOR_HW = 0, USE_CUSTOM_DISPLAY_DRIVER = 0, WaipioPkg.dsc.inc (SM8450, 8 cores, GIC 0x17100000), SimpleFbDxe on ABL's 1080x2400 scan-out, and UniXNUPkg + DarwinBoot + UniXNURamDiskDxe.
- The memory and configuration maps are copied from the SM8450 ingres platform (same DRAM base, FD window and SoC carveouts) and are REQUIRED to be replaced with cupid's stock uefiplat.cfg.
- The minimal configuration deliberately omits Binaries/cupid, so no stock vendor module is needed to build the firmware volume; vendor clocks, UFS, USB, charger and the stock display chain are a later CUPID_VENDOR_HW = 1 step.
- The stock splash_region (0xb8000000 + 0x2b00000) is present in waipio display DTSI and is assumed in the payload and boot image.
Completion criteria
- Firmware image builds, enters UniXNU, publishes the framebuffer and preserves documented reservations.
Current limits
- cupidPkg builds and produces SILICIUM_UEFI.fd, but the memory map and FD base are still the ingres SM8450 values and vendor hardware is off; neither is device-verified.
Next action
- Build firmware with ./unixnu build firmware --uefi ../uefi-cupid and record the FD size; then import Binaries/cupid from the HyperOS archive for CUPID_VENDOR_HW = 1.
Evidence
source: cupidPkg platform definition: WaipioPkg include, 1080x2400 frame buffer, UniXNU/DarwinBoot/UniXNURamDiskDxe components, CUPID_VENDOR_HW = 0.host: Corrected FD window: firmware built with FD_BASE=0xa7000000, FD_SIZE=0x2a2000, FD_BLOCKS=674; BootShim decompresses to 0x2a2000 with text_offset 0xa7000000, image_size 0x2a20c0 and the ARM64 magic; boot.img sha256 4b9643054648573c93fba74a8ae97e06bd39be3b789744cd4b92b7c14125f1d7 (186036224 bytes) and payload.img sha256 8792987fde257e3707530328756a17daf00b6f46687b68ebed31126e40971536 (184549376 bytes). Command:./unixnu build firmware -D ../device --uefi ../uefi-cupid && ./unixnu build payload ... && ./unixnu bootimg .... Revision:b83e634bd63489b7c7ff3f976ca732ea80c98c03.host: payload.img 184549376 bytes sha256 f9daa8c8e136321ffe65f1f968284c58318f81751804f1ce7c9778a5f1e271ab; boot.img 186036224 bytes sha256 65cfa2fbe4c396f19ce19f58953c144e56240cd9e1c8fb01d9f5b50423c8f9a8. ANDROID! header v0, pagesize 4096, kernel_addr 0x8000, tags 0x1e00000, ramdisk equals payload, kernel region is gzip(1028417) plus cupid DTB(451126, ends exactly at kernel_size). Payload FAT contains EFI/UniXNU/unixnu.toml with an iOS 27 entry and Payloads/kernel.macho 93667328 bytes plus kernel.macho.adt. Command:./unixnu build payload -D ../device --uefi ../uefi-cupid --unique-chip-id <seed> && ./unixnu bootimg -D ../device --uefi ../uefi-cupid --dtb ../device/build/cupid/cupid.dtb. Revision:50a8c5d2998cec423adc356e824e8f2faba0a50c.host: macOS 26 DEBUG/CLANGPDB build of Platforms/Xiaomi/cupidPkg/cupid.dsc with FD_BASE=0xa7100000 FD_SIZE=0x300000 FD_BLOCKS=768; output uefi-cupid/Build/cupidPkg/DEBUG_CLANGPDB/FV/SILICIUM_UEFI.fd. The Gic-Spurious edk2 patch applied. Command:./unixnu build firmware -D ../device --uefi ../uefi-cupid. Revision:14ab2c0527b2b808ac94afd66025fa56238b9168.source: Documents the ingres-derived memory map, the missing stock uefiplat.cfg replacement, and the vendor-hardware import that Binaries/cupid needs.device: The live memory map and /sys/hypervisor (gunyah, api 1, variant 81) were read on the phone; the firmware has not been booted yet. Command:adb shell su -c 'cat /proc/iomem'. Revision:4730e3b1fb52e1238a5d370bdc1f381622033de9.device: fastboot OKAY: Sending 181676 KiB in 4.2 s, Booting OKAY. Black screen, no text or colour, device stayed in fastboot; fastboot reboot returned to PixelOS. Header, ramdisk and payload verified; pstore empty and no last_kmsg. cupid stock uefi.img is an ELF with PT_LOAD 0xA7000000 memsz 0x2A0000, while the FD was based at 0xA7100000 with size 0x300000, i.e. 1 MiB past the window. Command:fastboot boot boot.img. Revision:b83e634bd63489b7c7ff3f976ca732ea80c98c03.device: BootShim and the cupidPkg UEFI run on the phone: console shows loading drivers and memory allocation, Project Silicium logo, then the UniXNU menu with four options. Header v4 was required; the v0 image stayed in fastboot. Payload missing, see packaging. Command:fastboot boot boot-v4.img. Revision:34134f4d1ee7a80cc67f940a08ae363b3904bce7.
CPU and interrupts
implemented
Components: ArmCpu, ArmDTPlatform.
Hardware and dependencies
- SM8450 CPU topology, MPIDR numbering, GICv3 windows and 19.2 MHz timebase from mainline Linux sm8450.dtsi.
- PSCI 1.0 over SMC.
Configuration
- dts/sm8450.dtsi: 8 CPUs at MPIDR Affinity1 0x000-0x700; 4x Cortex-A510, 3x Cortex-A710, 1x Cortex-X2.
- GIC distributor 0x17100000 (0x10000), redistributors 0x17180000 (0x200000), 0x40000 stride, interrupt cells 4.
- dts/cupid.dts marks cpu0-3 as the E cluster and cpu4-7 as the P cluster.
- soc:patches/xnu/series raises MAX_CPUS to 8 and reads the core number from Affinity0/Affinity1 for BCM2837 targets.
Procedure
- Compile the board DTS and inspect enabled CPUs, GIC ranges and timebase in the ADT.
- Record per-CPU entry, timer interrupts and IPI delivery on the phone.
Development findings
- SM8450 numbers cores in MPIDR Affinity1 exactly like SM8550, so the shared native-smp-secondary patch context applies unchanged.
- SM8450 UFS PHY is at 0x1d87000, not SM8550's 0x1d80000; SoC values cannot be copied across without checking.
Completion criteria
- Every enabled CPU reaches its entry checkpoint; timer and IPI handling work on each enabled CPU.
Current limits
- No CPU has entered XNU on this board yet; the topology is host-verified only.
Next action
- After the first boot, record each CPU's MPIDR and entry checkpoint.
Evidence
source: Board CPU clusters and memory/splash regions.source: Mainline CPU nodes, GIC windows, UFS host and PHY addresses used by dts/sm8450.dtsi.device: 8 cores online; Features include paca and pacg on every core (FEAT_PAuth address and generic keys); parts 0xd46/0xd47/0xd48. Command:adb shell su -c 'grep -E "Features|CPU part" /proc/cpuinfo'. Revision:4730e3b1fb52e1238a5d370bdc1f381622033de9.device: XNU started on cupid for the first time and panicked on msr CNTP_CTL_EL0 (word 0xd51be228 at pc=0xfffffff00ad881c0): Gunyah leaves CNTHCTL_EL2.EL1PCEN clear, so the EL1 physical-timer write traps. The earlier PAC-instr=d5 reading was a wrapped line; see the CORRECTION in notes/pac-trap-2026-11-07.md. Command:fastboot boot boot-v4-win2g.img. Revision:d093c5c1292400209634b7b82c78cd39fd9faa98.
Memory and DMA
implemented
Hardware and dependencies
- cupid UEFI memory map (largest contiguous run), reserved regions, SMMU stream IDs and DMA widths.
Configuration
- board.toml [payload.adt] owned_memory_size = 0x80000000 (2 GiB) matches the measured run.
- dts/cupid.dts memory@80000000 describes a 2 GiB nominal handoff range.
Procedure
- Dump the live ABL/UEFI memory map over UART or fastboot oem command.
- Set owned_memory_size to the largest run the firmware can hand over.
Development findings
- The stock bootloader memory layout has not been measured on cupid; the sheng/ishtar windows are 4.75 GiB and 9 GiB on different boards and are not evidence for this one.
Completion criteria
- Every handoff region is accounted for and DMA engines access only allocated ranges with the documented cache policy.
Current limits
- No memory-map measurement from the phone.
Next action
- Capture the cupid memory map before the first payload boot.
Evidence
device: System RAM runs measured; largest contiguous 0x840000000-0x97fffffff (5 GiB) with the reserved tail from 0x96ef68000; owned_memory_size set to 0x12e000000. Command:adb shell su -c 'cat /proc/iomem'. Revision:4730e3b1fb52e1238a5d370bdc1f381622033de9.
Storage and root
device-verified
Components: ShengUfs, RamBlock, VirtioMmioBlock, VerifiedRoot.
Hardware and dependencies
- SM8450 UFS host 0x1d84000 (SPI 265) and QMP PHY 0x1d87000; SM8450 GCC UFS clock/reset offsets; LUN 0 GPT geometry.
Configuration
- SoC DTSI publishes ufshc/ufsphy disabled; the cupid defconfig leaves CONFIG_XNU_NATIVE_UFS unset.
Procedure
- Add an SM8450 UFS component (or parameterise ShengUfs by SoC compatible and GCC offsets).
- Enable ufs/ufsphy in the board DTS, then record capacity, GPT and userdata window.
Development findings
- ShengUfs matches only qcom,sm8550-ufshc and hardcodes SM8550 GCC UFS registers, so it cannot drive cupid as-is.
- SM8450 UFS PHY is at 0x1d87000; SM8550 is at 0x1d80000.
- Measured from gcc-sm8450.c against ShengUfs/GccUfs.h: SM8450 branches are ufs_phy_axi 0x87018, ahb 0x87020, tx_symbol_0 0x87024, rx_symbol_0 0x87028, unipro_core 0x87064, ice_core 0x8706c, phy_aux 0x870a4, rx_symbol_1 0x870c0, aggre_ufs_phy_axi 0x870d4, ufs_phy_gdsc 0x87004. SM8450 has no separate UFS_MEM_PHY_GDSC, so a per-SoC table is required.
- package/Sm8450Ufs/Sm8450UfsRegs.h is the first SM8450 UFS component: nine 0x87xxx branch offsets, GDSC 0x87004, HC 0x1d84000, PHY 0x1d87000 and a read-only probe; .github/workflows/ufs-regs.yml compiles it with a host test.
- package/Sm8450Ufs/Sm8450UfsHci.h adds the UFSHCI command path: HCE 0x34, IS 0x20, UIC 0x90, doorbell 0x58, controller enable/disable, UIC DME_GET/link-startup, UTRD and command-UPIU layouts (READ CAPACITY(10)), transfer-list base and doorbell ring/clear, exercised against a fake controller.
- The UTRD keeps DW0-3 as raw words: the C bitfield header pads to 40 bytes, so the static asserts pin 32 bytes with the UCD base at 16 and PRDT at 28; the fake-controller test caught the padded layout.
- Fixed the UPIU header field order (LUN b1, task tag b2, IID/CS b3, CDB b12) and added ResponseUpiu (52 bytes, residual and sense fields), PrdtEntry (16 bytes), 4-byte PRDT padding and the UCD layout at 0/512/1024; the host test pins every offset.
- drivers/ShengUfs is the sheng UFS transport adapted to waipio: DT compatible qcom,sm8450-ufshc (plus qcom,ufshc), GCC window 0x87000, no SM8550 UFS_MEM_PHY_GDSC at 0x9e000, and the SM8450 apps-SMMU stream 0xe0 (mainline sm8450.dtsi; iommus <&apps_smmu 0xe0>). The controller is adopted live: the firmware leaves GDSCR/AXI/AHB/UNIPRO on, HCE=1 and UTRLRSR=1, so the driver stops the firmware list, installs its own UTRD and never resets the link.
- The device read test (patches/xnu/ufs-probe.patch, ufs-smmu.patch, ufs-read.patch) reports SSU/TUR ocs=0 with the 0xe0 stream; READ(10) of LUN 0 LBA 1 returns the GPT header (sig 20494645 54524150, 64 entries, cur=1 ent=2) and a userdata read at LBA 3170304 returns ocs=0. Block DMA is verified on the phone; the stream-0x60 attempt SErrors, so 0xe0 is required.
- The window-publication runtime is sheng SourceStorage.cpp/SourceRootPolicies.cpp/SourceRootBinding.cpp plus BootLog/BootReset/BootProcess*/BootDiagExport/WifiFirmware/BluetoothFirmware, built into libShengSourceStorage.a by build-sheng-source-storage.py. The kernel calls a weak native_source_storage_start() from bsd_init after vfsinit(); patches/xnu-12377/source-storage-runtime.patch supplies that one hunk and must keep the context vfsinit(); followed by #if DEVELOPMENT || DEBUG.
- The cupid source-storage archive is minimal: package/sheng-full keeps the full sheng BootLog/BootUiTraceProbe/BootDiagExport/BootProcess*/Wifi/Bluetooth sources, and the top-level package files are stubs because those objects take addresses of weak imports from sheng components cupid does not select (armcpu_spi_*, sheng_pmu_fixup, native_adreno_*, native_gop_*, native_legacy_*, native_touch_*, cs_*, vt_*, sheng_idle_*, ml_static_mfree_prepare). On arm64e an address of a weak import is a hard authenticated-pointer link error, so SourceStorage.cpp supplies a refusing armcpu_spi_mask (the base ArmCpu already defines armcpu_spi_attach) and ml_static_mfree_prepare definitions and NativeUfs defines native_ufs_block_authenticates for the unverified build. log=1 is unavailable until the log window and board pages are ported.
- The first cupid root bring-up is unverified: scripts/policies/ipados-27.0.1-24A446/{OS,SystemOS} are dummy 544-byte manifests with the real image digest and a placeholder 395-byte anchor, only to satisfy the builder's digest/volume checks. NativeUfs.cpp and SourceRootPolicies.cpp force NATIVE_VERIFIED_BLOCK=0, so the signatures are never read and source windows publish without owner policy tables. Replace them with real owner-signed policies before treating verification as a security boundary.
- Archive wiring: CONFIG_XNU_NATIVE_UFS=y force-loads build/sheng-ufs/libShengUfs.a (the source-storage script writes that path); the board archives list needs component:ShengUfs and component:RamBlock (the runtime compiles drivers/RamBlock/NativeRamBlock.cpp, so RamBlock must be selected for its tree link); CONFIG_XNU_EXTRA_LD_ARCHIVES must stay unset or the same objects link twice. The policy directory is named ipados-27.0.1-24A446 because the builder globs scripts/policies/*24A446 and the assembled tree already has UniXNU's own directory of that name; a second name would make the component build ambiguous. Boot args are native-source-storage=1 native-ufs-root=1.
Completion criteria
- Device: GCC and UFSHCI adopt the firmware state, SSU/TUR and READ(10) succeed with the 0xe0 SMMU stream, and the GPT/userdata LBA 3170304 is readable. Root: the SHNGROOT windows publish and the APFS OS volume mounts.
Current limits
- The userdata partition still holds Android /data; SourceStorage reports no valid SHNGROOT manifest until build/userdata-root.img is flashed (owner-run fastboot, destroys Android data).
- Root policies are forced unverified for the first bring-up; the dummy manifests are not a security boundary.
Next action
- Boot boot-v4-ios27-ufsroot.img; expect GPT/read success and a manifest refusal with the current Android userdata. Then flash build/userdata-root.img and boot again to mount the OS volume UUID E3F4AED0-4454-4D5B-833C-E27E99C4F67B.
Evidence
source: SM8450 UFS GCC branch table (0x87018..0x870d4), GDSC 0x87004, host 0x1d84000 and PHY 0x1d87000, with a read-only probe; no SM8550 0x77xxx/0x9e000 values.device: iomem confirms ufshc 0x1d84000 (ufs_mem, ufs_ice 0x1d88000, ufs_ice_hwkm 0x1d90000) and PHY 0x1d87000; userdata is sda38, start512 25362432, size512 466862040 (LBA 3170304..61528058 at 4096 bytes). Command:adb shell su -c 'sh /data/local/tmp/collect2.sh'. Revision:4730e3b1fb52e1238a5d370bdc1f381622033de9.device: boot-v4-ios27-ufsread.img on cupid: with SMMU stream 0xe0, SSU/TUR complete ocs=0 resp=00 scsi=00; READ(10) LBA 1 returns the GPT header (sig 20494645 54524150, 64 entries), hcs=0x10f, rsr=1, UTRLBA=0xff130000; READ(10) at userdata LBA 3170304 returns ocs=0. The stream-0x60 build SErrors. Command:fastboot boot boot-v4-ios27-ufsread.img (panic-screen report). Revision:484b9524a210075aac59aef81b17af231a1e0957.
Display
planned
Hardware and dependencies
- Panel: Xiaomi L3 42 02 0a, 1080x2400, DSI command mode with DSC, 60/90/120 Hz timings.
- Cont splash framebuffer 0xb8000000 + 0x2b00000; backlight and panel supplies L7C (AVDD) and L2C (VDD).
Configuration
- [payload] does not yet bind a display component; CONFIG_XNU_NATIVE_LEGACY_DISPLAY stays unset.
- The iPhone17,2 profile advertises 1320x2868; it must be corrected for 1080x2400 when the panel binds.
Procedure
- Port build-gop-legacy-display-26.py to the iPhone17,2 (d94ap) ABI record.
- Bind the panel timings and backlight, then verify geometry, colors and refresh.
Development findings
- cupid's panel is 1080x2400 and 120 Hz-capable; the iPad and iPhone 16 Pro Max profiles describe different sizes.
- Framebuffer handoff and splash region are shared with the waipio platform DTSI.
Completion criteria
- A known frame appears with correct geometry and colors; userland presentation and backlight control work.
Current limits
- No display ABI record for d94ap and no panel driver.
Next action
- Produce abi/legacy-display-23F84-d94ap.json and bind the L3 panel timing set.
Evidence
device: The firmware console and the UniXNU menu render on the 1080x2400 panel through SimpleFbDxe, so ABL scan-out and GOP handoff work on cupid. XNU display is still untested. Command:fastboot boot boot-v4.img. Revision:34134f4d1ee7a80cc67f940a08ae363b3904bce7.
Input
planned
Hardware and dependencies
- STMicroelectronics FTS touch over QUPv3 SE4 SPI, IRQ TLMM GPIO 21, reset GPIO 20, firmware st_fts_l3.ftb.
- Power/volume keys on PM8550/PMK8550.
Configuration
- No input component is selected; the SoC DTSI does not model SPI or TLMM yet.
Procedure
- Add SPI/TLMM resources to the SoC layer, then port an FTS HID input component with the 1080x2400 coordinate map.
- Record contact IDs, release events and button reports.
Development findings
- cupid uses FTS (st,spi), not the Novatek NT36532 of sheng, so ShengNovatekTouch is not reusable.
- The vendor DTS gives fts,x-max 10800 and y-max 24000 (12x scaling) and FOD coordinates.
Completion criteria
- Touches map to the display, simultaneous contacts keep stable IDs, release events arrive, buttons produce HID reports.
Current limits
- No FTS component and no SPI/TLMM nodes in the SoC DTSI.
Next action
- Model QUPv3 SE4 SPI and TLMM in sm8450.dtsi, then write the FTS transport.
Evidence
Collect evidence using the next action.
GPU
planned
Hardware and dependencies
- Adreno 730 at 0x3d00000, GMU 730.1 at 0x3d6a000, GPU SMMU 0x3da0000, signed ZAP firmware and GPU votes.
- iPhone17,2 ioaccelerator ABI record.
Configuration
- sm8450.dtsi describes GPU/GMU/SMMU; all nodes are disabled.
- CONFIG_XNU_NATIVE_ADRENO must stay unset: the catalog's Adreno740 driver targets a different generation.
Procedure
- Add an Adreno730 component (or parametrise Adreno740 by GPU id), its GMU command database and votes.
- Port the accelerator ABI to d94ap, then enable the nodes and verify submissions and presentation.
Development findings
- Adreno740/AdrenoMetal are the only GPU components and carry Adreno 740 register layouts; pointing them at a 730 is not a supported configuration.
- SM8450 GMU PDC window is 0xb290000; SM8550 uses 0xb280000.
Completion criteria
- GPU submissions complete, fences are correct, a known image renders and Metal presents it.
Current limits
- No Adreno 730 driver and no d94ap GPU ABI record.
Next action
- Inventory the Adreno 730 firmware and GMU register map from the vendor kernel, then scope an Adreno730 component.
Evidence
Collect evidence using the next action.
Network
planned
Hardware and dependencies
- cupid WLAN/BT combo: confirm WCN6750 or WCN6855 from vendor firmware (both qca6490 and qca6750 configs ship in the device tree).
- PCIe or MHI transport, firmware, NVM and MAC address.
Configuration
- No network component is selected; no wlan node is exported in the board DTS.
Procedure
- Confirm the chipset from vendor/etc/wifi and the stock DTB.
- Select a matching UniXNU Wi-Fi component, add bus resources and stage firmware.
Development findings
- The LineageOS sm8450-common package ships both qca6490 and qca6750 WCNSS configuration files, so the chipset cannot be inferred from the package list alone.
Completion criteria
- Scanning, association, address configuration and sustained traffic pass.
Current limits
- Chipset unconfirmed; no component selected.
Next action
- Read the stock DTB and vendor Wi-Fi firmware names to identify the chipset.
Evidence
Collect evidence using the next action.
Audio
planned
Hardware and dependencies
- ADSP firmware, LPASS macro codecs, Cirrus CS35L41 speakers (from the vendor DTS), audio routes.
Configuration
- No audio component is selected and no DSP firmware is staged.
Procedure
- Add ADSP boot, GPR/GLINK transport and the codec routes from the vendor DTS.
- Verify playback and capture per declared route.
Development findings
- The vendor cupid DTS declares CS35L41 speaker amplifiers; the sheng audio HAL is a different board and cannot be copied.
Completion criteria
- Each declared route carries the selected format through playback or capture and handles start/stop.
Current limits
- Not started; blocked behind storage and power bring-up.
Next action
- Inventory ADSP firmware and codec wiring after stage 0 boots.
Evidence
Collect evidence using the next action.
Power
planned
Hardware and dependencies
- PM8550/PMK8550 PMIC set, RPMh regulators, battery profile, charging and thermal limits.
Configuration
- No power component is selected; the board relies on firmware-provided regulators for stage 0.
Procedure
- Add RPMh/PMIC access, battery readings and the supported sleep/resume transitions.
- Record each transition and its dependent peripherals.
Development findings
- cupid uses PM8550/PMK8550; sheng's sheng_pmgr code is board-specific and is not selected.
Completion criteria
- Power controls and battery readings match observations; sleep/resume restores dependent peripherals.
Current limits
- Not started.
Next action
- Inventory PMIC rails and the battery profile from the vendor DTS.
Evidence
Collect evidence using the next action.
Image assembly
host-verified
Components: XnuPrelink.
Hardware and dependencies
- iPhone17,2 26.5.2 kernelcache for prelink, the OS/SystemOS images for userdata, Data seed and the platform seed (UNIXNU_UNIQUE_CHIP_ID).
Configuration
- board.toml [payload] builds a 176 MiB CUPIDESP FAT volume; [bootimg] packs header v0 at 4096-byte pages.
- scripts/package.sh is the standard UniXNU packaging script and reads [package] unixnu and [package.defconfig].
Procedure
- Install the OS profile, then run scripts/package.sh --os ios-27.0.1-24A446 --uefi ../uefi-cupid once the firmware exists.
- Run the macOS workflow for kernel-only builds until then.
Development findings
- patches/xnuprelink/fileset-cupid-23F84-symbols.json is a reviewed fixture for the iPhone17,2 26.5.2 kernelcache. It binds sixteen kernel functions/thunks by string/call evidence, including the lck_mtx_gate open/steal/alloc/free family and the pmap PPL functions. The first batch paired the lck_mtx_gate allocator (alloc_init) with the native destroy, and the native gate check panicked: 'Trying to destroy a gate that was allocated by gate_alloc_init; gate_free should be used'. The corrected deallocator is _lck_mtx_gate_free. fileset-register-report.patch replaces the simple stub with a register-saving report (x0-x30, x16/x17, data-slot candidates) so any remaining stub names its slot instead of relying on the stale tail-branch return address.
- build-fileset-release-reference.py --tree . --lto is required for iOS 26: the stripped native kernel cannot shape-match the kernel-function imports of the original kexts, so without the symbol-bearing reference prelink left 1668 targets / 18367 sites. The reference cut that to 92 owner-site pairs / 766 sites; the sixteen-binding batch and --allow-missing write the candidate, and the register report names any remaining slot.
- The iPhone 26 prelink layout leaves only 0x119f40 before AppleARMPlatform __DATA_CONST; the DEVELOPMENT native __DATA_CONST plus __LASTDATA_CONST exceed it. patches/xnu/no-assert-strings.patch removes most of the __assert strings so the native constants fit. MACH_ASSERT stays defined: the ipc_port ABI is 160 bytes, and a MACH_ASSERT=0 build failed the genassym static assertion at 144. DTrace/LOCK_STATS also stay on.
- Kernel and package steps do not need the firmware checkout; payload and boot image do because they embed the firmware volume.
- package/Sm8450Ufs is board-owned host-tested code, not yet part of the kernel archive: ufs-regs compiles Sm8450UfsRegs.h and Sm8450UfsHci.h with c++ -Werror on every change, and the package step continues to build only the EDK II drivers.
- The board package still carries the host-tested UFS transport model (Sm8450UfsHci.h); it does not enter the kernel archive, so the EDK II package step is unchanged.
- patches/unixnu/0001-patch-xnu-entry-probe-skip-nm-headers.patch is required for payload: the upstream parser crashed on a three-token nm header line (int(Symbols)) while reading the prelinked kernel.
- patches/unixnu/0002-ramdisk-find-fat-in-initrd.patch makes UniXNURamDiskDxe scan up to 256 MiB of the initrd, log the first two words at every 16 MiB boundary, and, if the 512-byte walk finds no boot sector, search byte-wise for the CUPIDESP volume label and derive the FAT start from offset 71. cupid v4 ABL publishes 0xBC8BE00 bytes starting with an LZ4 vendor ramdisk; 64 MiB and 256 MiB sector walks found no FAT although the bulk data is present.
- patches/darwinboot/0001-darwinboot-log-window-failure.patch prints NO WINDOW and the FREE runs to the console; owned_memory_size was lowered to 0x80000000 so a 2 GiB run can satisfy the kernel window while the log reports the real largest run.
- patches/xnu/timers-avoid-trapped-physical-timer.patch removes the precautionary CNTP_CTL_EL0 write in _enable_virtual_timer; Gunyah traps EL1 physical-timer access. It is the only device XNU series entry after the pivot.
- The iOS 27 reviewed-symbol fixture (30 shims), the PAC key-write skip and the report-registers probe were removed: the iPhone 26 kernel is the same XNU major/minor as the source, so prelink must pair natively and --allow-missing/--fileset-reference are gone.
- The 13432-only shims (corecrypto wrappers, AppleM2 clock/property, AppleImage4 flags/gates, sandbox checks, AppleARMPlatform lookup and the AMFI DRBG initializer) are not part of the iOS 26 build; they were responses to the 24A446 source mismatch.
Completion criteria
- Kernel and prelink succeed with no missing targets, the payload contains all declared inputs, and the boot image matches the bootloader format and size limit.
Current limits
- Kernel, package and firmware are host-verified. Payload is blocked on the platform seed (UNIXNU_UNIQUE_CHIP_ID); the boot image is blocked on a cupid firmware DTB. Neither is in the repository.
Next action
- Build payload and boot image once the owner supplies UNIXNU_UNIQUE_CHIP_ID and cupid's firmware DTB; the macOS workflow already stages boot-v4 images.
Evidence
host: Pre-pivot iOS 27 run: rebuilt arm64e XNU and built the EDK II package (DEBUG/CLANGPDB, UniXNU.efi and the shared drivers). This evidence is kept as packaging history, not as the current profile. Command:./unixnu build kernel -D ../device && ./unixnu build package -D ../device. Revision:14ab2c0527b2b808ac94afd66025fa56238b9168.device: userdata geometry measured from the live GPT (sda38, 3170304..61528058 at 4096-byte LBA). Command:adb shell su -c 'sh /data/local/tmp/collect2.sh'. Revision:4730e3b1fb52e1238a5d370bdc1f381622033de9.
Diagnostics
planned
Hardware and dependencies
- UART serial access, the firmware log exporter and reproducible build logs.
Configuration
- The payload kernel command line starts with -v serial=3 debug=0x14e.
Procedure
- Attach UART, capture firmware and XNU logs, and store each result with its revision and command.
Development findings
- No phone is attached to the build host, so no firmware or kernel log exists yet.
- tools/diagnose-unmapped-call.py reproduces the fileset panic diagnosis from the emitted kernel.macho and the pinned decompressed kernelcache: it resolves the caller component, the direct BL or import-stub GOT slot, the original target and its function range, and prints the strings the original function references. On run 42471867225 it names the known site 0xfffffff00ab15578 as corecrypto -> __memcpy_chk (0xfffffff00ad05978) and shows the emitted slot resolved from the stub 0xfffffff00b405c60 to native ___memcpy_chk 0xfffffff00ad3f568.
- tools/match-unmapped-target.py searches the unstripped native kernel for the closest function to an unmatched original using the XnuPrelink relocation-masked shape. It found no candidate above 0.55 for AppleM2 0xad714b8/0xb0de1d8, confirming they are 13432-only; it also lets future targets be reviewed against real symbols instead of guessed.
Completion criteria
- Each claimed milestone has a reproducible command, a matching revision and an accessible result.
Current limits
- No device access from the current host (no adb, fastboot or USB bus).
Next action
- Attach the phone and capture the first firmware log.
Evidence
Collect evidence using the next action.