Files
UniXNU/docs/devices/sheng-loadinghtml.md
2026-11-16 21:55:12 +00:00

185 KiB

Xiaomi Pad 6S Pro (loadinghtml)

loadinghtml/UniXNU-sheng

Xiaomi Pad 6S Pro 12.4 uses shared SM8550 support and board-owned storage, input, firmware and power integration. This record describes implementation coverage and the evidence required for each milestone.

Source record: porting.toml, 4d9dcff412af08913e7fd221423d623ec2b36d31.

This page is generated from the device record.

Area Status
Configuration implemented
Firmware and boot implemented
CPU and interrupts implemented
Memory and DMA implemented
Storage and root implemented
Display implemented
Input implemented
keyboard device-verified
GPU implemented
bluetooth device-verified
usb device-verified
Network implemented
Audio implemented
Power implemented
Image assembly implemented
Diagnostics implemented
arm64e-os planned
video implemented

Configuration

implemented

Hardware and dependencies

  • SM8550, the default iPadOS 27.0.1 profile (24A446), the macOS 27.3 override (26C5035r), and pinned arm64e component sources.

Configuration

  • board.soc_source = sm8550; board.os_profile = ipados-27.0.1-24A446; schema_version = 2.
  • The device owns ShengUfs, ShengHidInput, ShengNovatekTouch and ShengPreflight submodules.

Procedure

Development findings

  • The macOS desktop override selects os:configs/macos.config. package.sh uses the board desktop arguments with the preserved installation seed, and macos-lab.yml selects the matching build driver revision.
  • The kernel-cache export selects Xcode 26.6 and stages its compiler, classic linker, SDK, resource directory and non-system dylib dependencies. Its staged arm64e compile and partial-link check verifies the exported toolchain.
  • The local-input export job selects Xcode 26.6, follows non-system dynamic library dependencies and runs the staged compiler, IIG and linker, then compiles and partially links an arm64e object with the packaged classic linker.
  • The macOS lab preserves Data and shader checkpoints. Shader Cache provides manual inventory compilation, progress and stop controls; --shader-cache-view opens its window for inspection.
  • The macOS kernel adopts loader-listed free memory outside the managed span using the profile memory map and access checks.
  • The macOS profile uses a 6 GiB high-memory window, 64 excluded-range slots and 8 outside-memory slots. The SoC feed is 2dc650ca76ae38715cd0712e60a44b14fe251745; unixnu.lock records the same source.
  • The macos-lab workflow builds on macos-26 with pinned core, device and UEFI sources, a private chip identifier and an account password supplied through Actions secrets. Its source and dependency caches support incremental builds.
  • The runtime payload lists firmware_tools: scripts/stage-video-firmware.py stages the VPU firmware of proprietary-files.txt under the Data addon's firmware/ prefix. The VPU starts by default; sheng-video=0 leaves it off and vt-paravirt=0 keeps VideoToolbox on its own codecs.
  • The kernel adopts the low DRAM bank by default; memory-outside=0 on the command line leaves it alone. The built-in macOS arguments include gpu-pool=0.
  • The macOS 27.3 kernel arguments drop -v and serial=3 and add ca-fb-8bit=1, armcpu-edge=1, boot-payload-release=1, thermal=1 and board-clock=7; the macOS payload.adt sets owned_memory_size 0x180000000 with owned_memory_excluded_ranges 64 and loader_inputs. Not yet run on hardware.
  • The macOS 27.3 kernel arguments in board.toml include fb-half=2, the reading of WindowServer half-float frames that gives correct colours on hardware.
  • The macOS 27.3 override of board.toml keeps the Bluetooth runtime tool with target macos27 and adds bluetooth=1 to the kernel arguments (864 bytes); the iPadOS settings are unchanged.
  • The 24A446 kernel arguments include keyboard=1, which starts the keyboard cover driver; the 17 and 26 overrides do not.
  • The 24A446 profile enables payload.runtime.appsync and appsync=1. The 17 and 26 overrides remove payload.runtime and replace the kernel arguments, so they do not select this adapter.
  • Tables merge in ARM64, SoC, OS, device order. Arrays replace inherited selections, so include every required component and fragment.
  • The selected defconfig applies after the explicit configuration fragments. Keep OS ABI and IPSW pins in the OS profile.
  • The active 23F84 configuration remains minimal. Source storage/input archives are built separately and are not yet selected for boot. OS-profile source pins select the public macOS 26.5 families without claiming binary ABI compatibility.
  • feeds.toml pins the SoC source at the commit that holds patches/xnu-12377/series, which board.toml lists as soc:patches/xnu-12377/series; a pin older than that commit leaves the series missing.
  • board.toml carries the 27 values at the top level and the differences of the 17 and 26 profiles under os_overrides, so one branch serves every profile., .github/workflows/package.yml runs scripts/package.sh on a macOS runner with the UniXNU and uefi-sheng checkouts beside the device repository; the platform seed comes from the UNIXNU_UNIQUE_CHIP_ID secret, and the run offers boot.img, payload.img, kernel.macho and the manifest as its artifacts. Run it in a fork and delete the run after downloading them., and the run passes its own GITHUB_TOKEN to the packaging step for api.github.com, whose anonymous quota a hosted runner exhausts., The kernel archives of the 27 and 26 profiles list build-sheng-source-storage.py after component:ShengUfs, so the source storage archive and root-policies.bin the defconfigs link no longer depend on a leftover of an earlier build., and name scripts/policies/<profile> in --policy-dir, the signed headers the repository ships., and the 27 kernel archives run fetch-adreno-inputs.py and the three prepare-sheng-* generators before build-adreno740-kits.py, so the generated GMU and SMMU headers no longer come from earlier local runs., with fetch-sheng-dts.py first: the firmware step runs after the kernel step, and the generators read the DTS sources it fetches.
  • [firmware] preflight lists scripts/fetch-sheng-dts.py before scripts/check-sheng.py, and [bootimg] dtb names the device tree it builds (build/sheng/sheng.dtb) for the pack step.
  • .gitignore keeps policies/**/*.bin tracked under the global *.bin ignore: the signed root-policy headers are repository inputs of the storage area.
  • .gitignore keeps firmware/**/*.bin tracked under the global *.bin ignore.
  • The 27 kernel archives end with build-fileset-release-reference.py --tree . --lto, the comparison kernel the prelink step reads.
  • .github/workflows/package.yml puts /opt/homebrew/opt/llvm/bin first on the package step PATH: the packaging step needs lld-link of the Homebrew LLVM the tools step installs.
  • The tools step also installs cmake: the packaging step builds EDK II BaseTools with it.
  • The package step PATH keeps /opt/homebrew/bin ahead of the LLVM tools: dropping it hid the tools step installs (cmake).
  • The tools step installs lld beside llvm (the keg-only llvm bottle has no lld-link; the packaging step finds /opt/homebrew/opt/lld/bin through the loader), and the PATH override is gone: the default runner PATH keeps Apple clang driving the kernel link.
  • The tools step installs the complete external set (dtc, llvm, lld, cmake, mtools, blacktop/tap/ipsw) and asserts every tool of the flow before the build: mtools builds the payload FAT volume, the ipsw tool fetches the AEA keys of the OS images.
  • The keg-only tool check accepts either the llvm or the lld keg for a tool: ls with two paths fails when only one of them carries it.
  • The uefi-sheng checkout carries its submodules recursively: the firmware volume builds from Binaries/sheng, itself a submodule.
  • The firmware preflight runs the download, extract and import scripts between the DTS fetch and the memory-map check.
  • .github/workflows/package.yml pins UniXNU revision be0e4fab00, which selects the GPU, Metal, display and source-storage latency integration. Existing installations retain their original Data seed through the packaging cache or an explicit seed import.
  • The packaging workflow pins the UniXNU commit with the GMEM colour order fix and lazily allocated memory for memoryless attachments.
  • The packaging workflow pins the Wi-Fi runtime builder and Data firmware integration; device gitlinks pin the matching Ath12kWifi and Wi-Fi DMA support.
  • The 24A446 runtime selects signed Bluetooth userland and bluetooth=1. Other OS profiles remove the runtime stanza.
  • drivers/QcomDwc3 is a submodule. The iPadOS 27 prelink roots add the USB stacks, and its boot arguments add usb=1 and aks-sls=3.
  • The board's kernel.prelink.roots (the iPadOS 27 list plus the USB stacks) replaced every profile's list, so the macOS kernel was prelinked with the iPadOS closure. The list moved to os_overrides."ipados-27.0.1-24A446"; iPadOS 27, 26 and 17 resolve to unchanged roots and macos-27.3-26C5035r uses its profile list. An os_overrides remove deletes the merged key, so it cannot drop only the board value.
  • The macOS override (macos-27.3-26C5035r) removes the iPadOS install entry, seed-edit tool and audio, Wi-Fi, Bluetooth, wallpaper and AppSync runtime layers, and sets ADT chip_id 6050 (T6050, Mac17,11).

Completion criteria

  • All source pins resolve; every selected component has a record; status shows the intended overrides and patch order.

Current limits

  • Local overrides can select a different source from the published pin; record the effective source in each verification result.

Next action

  • Compare the effective status output whenever a profile, source or component selection changes.

Evidence

Firmware and boot

implemented

Components: ShengPreflight.

Hardware and dependencies

  • uefi-sheng firmware, stock firmware DTB, GOP handoff, PSCI SMC interface and vendor firmware inventory.

Configuration

  • firmware.dsc = Platforms/Xiaomi/shengPkg/sheng.dsc; firmware.config = sheng.
  • proprietary-files.txt records input paths and provenance.
  • The firmware DSC and FDF embed UniXNU, UniXNUDxe, DarwinBoot, UniXNURamDiskDxe, DiskIoDxe and FAT support.

Procedure

  • Run ./unixnu build firmware -D ../UniXNU-sheng --uefi ../uefi-sheng.
  • Record the firmware commit, output FD and handoff memory map before a boot attempt.
  • Build the payload, then run ./unixnu bootimg with the firmware DTB. Inspect boot.json ramdisk_bytes and the required firmware modules.

Development findings

  • The macOS boot transport uses a SHA-256-pinned qualified firmware template. The current build replaces only its DarwinBoot PE; the other 53 inner-FV modules, BootShim, firmware DTB collection and encoded Android OS metadata remain unchanged. A 187 MiB payload keeps the image below the qualified 193 MiB boundary. QEMU verifies the loader handoff and a menu that waits for input; sheng reached the desktop after explicit Data initialization on 2026-11-15. The newly built full firmware volume is not qualified by this compatibility result.
  • The board stores FAT payloads as independently UEFI-compressed 1 MiB chunks. The encoded ramdisk limit is 199229440 bytes; UniXNURamDiskDxe exposes the logical FAT through a 1 MiB cache.
  • The sheng firmware profile enables SHENG_BOOT_GUARD. SEC verifies the SDAM bootloader reboot reason and arms the 30000 ms Gunyah watchdog. DXE pings every 2 s within a 180 s firmware budget and hands the armed timer to XNU at ExitBootServices. The matching kernel takes over at EARLY_BOOT with uefi-watchdog=1, pings the running timer and starts its servicing thread.
  • The Wi-Fi runtime fetches WCN7850 amss.bin, m3.bin and board-2.bin from linux-firmware revision a4ce85e98a33fa1021c31d1887fc2dffed27e8dd into .cache/firmware/wcn7850 and checks their sizes and SHA-256 values against firmware/wcn7850/manifest.json.
  • proprietary-files.txt has a Video section: qcom/sm8550/sheng/vpu30_4v.mbn, extracted into .cache/firmware and staged into the Data addon at build time. The VPU loads it from /private/var/ngpu/firmware at its first power-on.
  • proprietary-files.txt pins nanosic/MCU_Upgrade.bin, the keyboard controller image, under Keyboard.
  • The firmware DTB is an input to boot-image assembly. XNU consumes the separately generated ADT.
  • The sheng preflight component belongs with board integration and its firmware requirements.
  • The shared UniXNURamDiskDxe reads the Mu-Silicium entry-argument HOB and FDT initrd range to publish the payload block device. ShengBootMemoryDxe owns memory expansion.
  • Configured menu entries require a payload FAT filesystem containing EFI/UniXNU/unixnu.toml. Check the UNIXNURAMDISK initrd block-device status when entries are absent.
  • fetch-sheng-dts.py writes the firmware device tree at build/sheng/sheng.dtb and the copy the GPU generators bind to at build/adreno-firmware/sheng.dtb.
  • firmware/novatek/novatek_nt36532_n81a_fw_csot.bin is the pinned touch firmware of proprietary-files.txt; the build reads the extracting machine cache first and this copy on a clean checkout.
  • board.toml [firmware.image] pins the official fastboot archive (url, SHA-256, MD5, bytes); the firmware preflight downloads it, streams out only the porting inputs, deletes the archive and generates Binaries/sheng in the firmware checkout from them. No extracted binaries live in any repository.
  • A completed extraction skips both scripts: porting-inputs.json records the archive as deleted with the pinned source url and SHA-256, so a rerun rebuilds Binaries/sheng without downloading again.
  • import-sheng-uefi.py regenerates Binaries/sheng only when its manifest differs from the cache: a matching tree is left in place.
  • Wi-Fi firmware files are pinned by firmware/wcn7850/manifest.json and packaged under the shared Data directory; VFS loading waits for addon installation.
  • Bluetooth firmware and NVM files are pinned by firmware/bluetooth/manifest.json and staged by scripts/stage-bluetooth-firmware.py under firmware/qca in the Data addon.

Completion criteria

  • Firmware image builds, enters UniXNU, publishes the framebuffer and preserves the documented memory reservations.

Current limits

  • Boot-image assembly requires the selected firmware DTB and proprietary input files.

Next action

  • Capture firmware revision and memory reservations with the next image verification.

Evidence

CPU and interrupts

implemented

Components: ArmCpu, ArmDTPlatform.

Hardware and dependencies

  • SM8550 CPU affinities, GIC distributor at 0x17100000, redistributors at 0x17180000, 0x40000 stride and 19.2 MHz timer.
  • PSCI uses SMC. All eight CPUs are enabled; the DTS tags cpu0 to cpu2 (A510) as an E cluster and cpu3 to cpu7 as a P cluster with unixnu,cluster-type.

Configuration

  • dts/sheng.dts includes sm8550.dtsi; shared CPU and interrupt definitions come from the SoC source.
  • Kernel arguments select smp=1 and armcpu-spi-ipi=1.

Procedure

  • Compile the board DTS and inspect enabled CPUs, GIC ranges and timer properties in the ADT.
  • Record per-CPU entry, timer interrupts and inter-processor interrupt delivery.

Development findings

  • macOS 27.3: timebase-user=1 lets userspace read the 5/4 scaled timebase without a trap; the kernel changes libsystem's counter path in place after code signing validation. Not yet run on hardware.
  • armcpu-edge=1 with the two-cluster matrix of zzzzzzzzzzz-sheng-edge-matrix.patch lets an idle P core take waiting E work; without the argument no thread moves between the clusters (macOS runs 56 to 61: the busiest E core at 90 % or more in 13 to 28 % of the rows). Not yet run on hardware.
  • The cores are registered without a power gate latency, so every IODelay of a thread blocks on a timer; armcpu-idle-latency-us sets one (default 0).
  • cpufreq=4 is in the macOS 27.3 kernel arguments; the probe runs there unchanged.
  • CPU affinity values are hardware identifiers. Enabled CPU count and MPIDR affinities must be checked together.
  • GIC register ranges must use translated physical addresses from the hardware tree.
  • XNU accepts work interval operations 6, 7 and 8 (interval start, update and finish) through patches/xnu/native-work-interval-instance.patch in UniXNU; without a performance controller they only succeed.
  • patches/xnu/zzyf-sheng-amp.patch runs the Edge scheduler with the E and P clusters from the ADT; UI work stays on the P cluster and coreduetd is stopped.

Completion criteria

  • Every enabled CPU reaches its entry checkpoint and timer/IPI handling works on each enabled CPU.

Current limits

  • CPU selection and frequency policy are board inputs; SoC topology describes all cores.

Next action

  • Attach per-CPU and interrupt observations for the selected firmware and image.

Evidence

Memory and DMA

implemented

Hardware and dependencies

  • Handoff DRAM at 0x80000000 with size 0x80000000; splash reservation at 0xb8000000 with size 0x2b00000.
  • The macOS high-memory request is 0x180000000; the outside-memory table describes the low bank. Device DMA requires controller stream IDs, address widths and ownership.

Configuration

  • device_tree.source = device:dts/sheng.dts; include_dirs = [soc:dts].
  • payload.adt.owned_memory_size and firmware reservations describe separate allocations.

Procedure

  • Compare firmware RAM ranges, reserved regions, DTS ranges and ADT memory-map entries.
  • Check DMA buffers against controller address width, cache policy and SMMU mapping before submitting work.

Development findings

  • On sheng, macOS 27.3 build 26C5035r reported hw.memsize 6914097152 and an active VM compressor.
  • The macOS ADT provides 8 outside-memory slots and preserves the audio DSP buffer at 0xd0000000 for 64 KiB. The kernel keeps up to 16 adopted runs after reservation splitting. The boot capture records hw.memsize and kern.boot_payload_memory.
  • The host keyboard HID fixture checks one reusable input descriptor across varying lengths, concurrent producers, reentrant callbacks and partial-start cleanup. The IOMemoryDescriptor stub is test-only and does not change device DMA policy.
  • On sheng with macOS 27.3 (26C5035r), run139 exercised 5120 MiB of incompressible allocations, swap-out and swap-in. Before pressure the compressor stored 287653 pages in 101994 pages (2.82:1). Swap grew to four 1 GiB files, the test exited 0, and pressure returned to normal after release. No compressor or swap policy change was needed. Capture excerpts and limits: reports/macos27-memory-run139.md.
  • macOS 27.3: DarwinBoot lists the free memory outside the kernel's window (the low DRAM bank, about 867 MiB by the firmware's map) and the kernel adopts it as ordinary VM memory, page by page after a probe load (458 MiB on hardware, hw.memsize 6.37 GiB). The aperture addresses of that memory lie below the kernel's static region, outside the addresses the kernel map's ranges share. The built-in arguments keep the GPU pool off (gpu-pool=0); the rest is memory another owner keeps (the probe's load is refused) and stays untouched. payload.adt owned_memory_outside_reserved keeps the audio driver's DSP buffer (64 KiB at 0xd0000000) out. The GPU pool of package/GpuMemoryPool.cpp is used only by a kernel that does not adopt the memory.
  • macOS 27.3: the kernel window starts at DRAM bank 1 (0x880000000) and spans the inaccessible range 0x8BB300000..0x8C0000000; DarwinBoot lists that range and firmware-held memory and the kernel leaves them out (expected hw.memsize 5811 to 6067 MiB, was 4864). Not yet run on hardware.
  • The macOS kernel was built with the embedded jetsam policy: 196 highwater kills in five boots (com.apple.dock.extra 113, iconservicesagent 62); on the macOS target the highwater and compressor-thrashing kills are removed, as in Apple's macOS kernel.
  • The sheng WLAN node exports the wlan ADT name used by wifid matching. It adds service-discovery metadata to the shared DTS; DRAM reservations and DMA resource ownership continue to use the existing board and controller descriptions.
  • Physical register translation and CPU virtual mappings have different purposes. Preserve physical resource ranges in hardware descriptions.
  • GPU and UFS use different SMMU instances and stream assignments.
  • The DTS carries each CPU's cluster type for the ADT (see the cpu area).
  • The GPU memory host fixture uses the current trace and task-role interfaces. Image backing reuse and deferred physical release are bounded by the Metal runtime; foreground placement and room-worker allocations can still overlap.
  • The exported Bluetooth node carries transport encoding and baud as little-endian u32 properties; its runtime MAC address is derived from the chosen platform identity.
  • The macOS outside-window handoff accepts up to 64 firmware free ranges, matching the exclusion table capacity; the fixed 64 KiB ADSP buffer remains reserved. This changes descriptor capacity, not the installed DRAM size.

Completion criteria

  • All handoff regions are accounted for and each enabled DMA engine accesses its allocated range with the documented cache policy.

Current limits

  • The DTS declares the current handoff window and splash region; memory sizing requires the selected firmware map.

Next action

  • Record the firmware memory map and each DMA consumer when changing reserved memory.

Evidence

Storage and root

implemented

Components: ShengUfs, VirtioMmioBlock, RamBlock, VerifiedRoot.

Hardware and dependencies

  • UFS host 0x01d84000/0x3000; PHY 0x01d80000/0x2000; GCC base 0x00100000.
  • GCC AXI, AHB, UniPro, symbol and PHY auxiliary branches; power domains and firmware link state.
  • Apps SMMU at 0x15000000, UFS stream 0x60, context-bank ownership, DMA width and cache maintenance.
  • LUN 0 uses 4096-byte blocks; userdata spans LBAs 3094592 through 64007162.

Configuration

  • iOS 17 uses CONFIG_XNU_NATIVE_UFS=y. The 23F84 source adapter uses the deferred source archive with native-source-storage=1 native-ufs-root=1; do not also install the old personality.
  • userdata defines OS and SystemOS windows. 23F84 payload.adt.root_match_volume_uuid = 546DFF4A-4172-4026-9F1B-7FDAD45F3D2E.

Procedure

  • Read https://unixnu.com/porting/ufs with this storage record.
  • Inspect clock enables, power state, HCE/HCS, link state, request-list base and SMMU mappings before changing controller ownership.
  • Validate SCSI capacity and GPT reads, then publish root windows and mount the configured root UUID.
  • Verify persistent Data writes on the documented Data allocation with a recovery image available.

Development findings

  • SourceStorage registers the macOS platform power callback before storage startup, leaving XNU filesystem sync and unmount ordering unchanged. The registration does not access or modify userdata.
  • SourceStorage records its family, policy, service and log initialization stages when storage-probe is selected.
  • On sheng, macOS 27.3 mounted Data as writable APFS. The captured swap total and usage were both zero.
  • make-userdata-full.py --raw ROOT_IMAGE PARTITION_BYTES OUTPUT preserves the complete root image and uses zero FILL chunks for the rest of userdata. This initializes persistent Data and diagnostic regions for a fresh installation.
  • Storage maintenance and throughput diagnostics convert Mach absolute-time intervals through the kernel timebase. Raw controller measurements retain the hardware-counter frequency.
  • Verified-root tables of header-only policies are read and authenticated whole at bring-up, but only a SHA-256 of each 4096-byte table page stays wired (about 1 MiB for the macOS 27.3 windows instead of 130 MiB of tables). A block takes its table page from a wired cache of native-vroot-cache MiB (default 8) shared by all windows, or reads it from the .vroot object through the transport, checks it against the kept page hash and caches it; a page that does not match refuses every block it covers. native-vroot-cache=0 keeps each whole table wired. The UFS row shows vt (hits, misses, reads, evictions, waits, refused pages) and vtc (cache pages, wired KiB). Not yet run on hardware.
  • macOS 27.3: cs-lazy=1 authenticates a 16 KiB signed block when one of its pages is first validated instead of reading every image whole when its signature is added. Not yet run on hardware.
  • Both block devices report Medium Type Solid State; before, every disk logged isssd 0 and swap, read-ahead and I/O throttling used their rotating-disk values. Not yet run on hardware.
  • On macOS 27.3 no volume and no swap is encrypted; UFS command slots never ran out (32, peak 13). The signature pass over the dyld shared cache (6873 MiB, about 30 s of every boot in one thread) runs on every processor.
  • ShengUfs also owns the apps SMMU stage 1 windows for the display bank (dpu-scanout) and the WiFi endpoint (wifi=2 or more); both are off by default.
  • An idle AHB branch may report CLK_OFF with hardware gating enabled. Check enable and gating bits together.
  • SMMU bypass still has address-width constraints. Validate every DMA range and context-bank assignment.
  • ShengUfs contains controller access, GPT/window parsing and sheng Data/log policy. Reuse each layer according to its inputs.
  • iPadOS 26 source-interface build: ShengUfs and all 15 public IOStorageFamily 337.100.1 compilation units produce arm64e iOS 26 objects. Verified-root policy flags remain enabled; four root-path host suites pass ASan/UBSan.
  • The Wi-Fi SMMU window is now 128 MiB: the mainline firmware/CE/DP allocation exceeded the previous 48 MiB window on device; stream ownership and 32-bit IOVA base remain unchanged. The display bank's TCR2 SEP field (bits 17:15) is set so IOVAs with bit 31 translate. The userdata reserve past the log and its export region is readable through native_ufs_import_read and is never written by the driver.
  • scripts/policies/ipados-* carry the signed root-policy headers (manifest.header.bin, trusted-key.bin, verification.json) of each OS profile; the kernel archives pass scripts/policies/<profile> to build-sheng-source-storage.py with --policy-dir, and the full block tables stay local inputs of the userdata image., and .gitignore keeps scripts/policies/**/*.bin tracked under the global *.bin ignore.
  • ShengUfs runs up to 32 commands at once: the request list sits on a write-combined page of its own (as Linux's coherent DMA memory on this non-coherent stream) and slot s uses entry s; without that page 16 slots use the even entries of region A. Completion takes the controller interrupt (GIC SPI 265, UTRCE, UTRD interrupt bit) and wakes only the slots whose doorbell bits cleared; a wait spins for 200 us (native-ufs-spin-us), one WFE between polls instead of 2 us timer pauses, then sleeps on the interrupt, earlier if another thread waits for its CPU; native-ufs-wait=0 restores the timer pauses and 2 sleeps at once. The UFS row shows where commands complete, the spins and the commands still in flight. Not yet run on hardware. Page-aligned buffers are read and written by DMA through a PRDT of up to 1 MiB per command. A full slot pool hands a freed slot to its oldest waiter.
  • The link runs HS-G5 Rate A on two lanes in FAST mode as the boot firmware left it (PA_TxGear and PA_RxGear 5, PA_PWRMode 0x11). ufs-bench=1 runs, before the boot goes on, the read tests of the Linux reader's ufsbench on the same LBAs of the root image, compares zero copy with the data-area path, prints the results into the message buffer and restarts into fastboot. scripts/linux-ufsbench.py runs the same tests on the same LBAs under the mainline Linux reader, unattended; scripts/compare-ufsbench.py compares the two.
  • NativeRamBlock serves direct Data requests without its gate: reads take no lock, a write holds its page range and the flush lock shared and commits its bits under one lock, a flush holds the flush lock exclusive. A synchronize with no write since the last flush sends no command.
  • macOS mounts Data at /System/Volumes/Data. The system volume's /private is empty; /etc, /var and /tmp resolve through the /private firmlink of /usr/share/firmlinks. APFS sets firmlinks only for the Data volume of the system volume's own group, and the owner Data volume is on another device, so macos-owner-data-firmlinks.patch sets each listed firmlink with vnode_setasfirmlink after the mount and follows firmlinks on name cache misses.
  • The macOS Data seed comes from /System/Library/Templates/Data (about 0.8 GiB). Its entries are owned by root and service accounts (_windowserver, _mdnsresponder, _postfix and others), so scripts/make-macos-data-seed.py copies it with ditto as root; the iPadOS seed is written with owners off (uid 99).
  • The Data seed is carried in every payload beside the 137 MiB macOS kernel, and the packed format holds at most 256 MiB, so the 0.8 GiB template is not copied whole: files below private/, Users/, Library/Preferences/ and Library/Keychains/ (267 files, 18 MiB) are copied, and the other 13004 files become links to the system volume's template, as macOS does for Data.symlink-patterns. The copy goes through a scratch volume so the seed image holds no blocks of the replaced files; the macOS payload volume is 192 MiB.
  • A fresh macOS userdata image leaves the persistent Data overlay blank. The 210 GiB seed requires the explicit Initialize macOS Data and boot entry (data-reset=1) before writable Data is available; ordinary Boot preserves the existing overlay. Setup Assistant and account settings come from the selected seed.
  • The macOS storage checkout identifies verified UFS windows as internal media so Disk Arbitration can mount the App cryptex before login.

Completion criteria

  • Host: register, clock, link and SMMU facts match the board inventory.
  • Reads: SCSI capacity, GPT and known blocks are correct; OS/SystemOS windows stay within userdata.
  • Root: the configured volume mounts and launchd starts. Persistence: writes survive reboot within the allocated Data region.

Current limits

  • The SoC DTSI exports host and PHY ranges. GCC and UFS SMMU handling currently use constants and operations in ShengUfs.
  • The root transport uses a polled request slot. Its firmware adoption path requires a usable existing request list.
  • 23F84 now has deferred source storage registration, original IOStorageFamily/APFS loading, signed policy sidecar handoff and build selection. These latest changes have not been built or run: the user explicitly stopped testing. Runtime class/interface compatibility, root mount and persistence remain unqualified. See reports/ipados26-source-storage-runtime.json.
  • The macOS Data template has 19 entries with the restricted flag (Library/StagedExtensions, private/var/db/oah and others). With System Integrity Protection enabled on the build Mac no process may set that flag, so make-macos-data-seed.py copies them without it and fails on any other copy error; on the device those Data directories are not SIP-protected.

Next action

  • Record clock/PHY/reset initialization ownership and the SMMU stream before adapting this driver to another board.

Evidence

Display

implemented

Components: GopFramebuffer.

Hardware and dependencies

  • UEFI GOP framebuffer, stride, pixel format, splash reservation and board panel/backlight controls.

Configuration

  • Select GopFramebuffer; CONFIG_XNU_NATIVE_LEGACY_DISPLAY=y; artwork-display-gamut = sRGB.
  • vsync=120 requests board display timing.
  • dpu-scanout=2 lets the display pipes fetch the compositor surface through a stage 1 window of the display bank (TCR2 SEP 7); off by default. The flip waits for the GPU fence of the frame (always on).
  • backlight=1 starts the backlight driver; backlight-control=0 leaves out backlight-control and the AppleARMBacklight metaclass answer.

Procedure

  • Verify GOP address, dimensions, stride and pixel layout before enabling presentation.
  • Build the late display archive with the selected OS ABI records, then check display publication and frame presentation.

Development findings

  • The macOS display archive includes ShengChargeAuth.c with the battery manager and USB role integration. Archive source fingerprints include those inputs.
  • The macOS display archive source fingerprint includes the keyboard worker policy header, so scheduling changes invalidate the linked archive.
  • The late probe starts the VPU after the GPU power probe (sheng_video_probe), and the display archive carries the iris driver, the decoder device and the VideoToolbox host; the transport's classes are registered late, as the display's are.
  • macOS 27.3: QuartzCore presents half float because the device answers as virtualized (vmm-present); ca-fb-8bit=1 makes WindowServer present 8-bit BGRA, which the display pipes scan out directly. Not yet run on hardware.
  • macOS: WindowServer presents half-float frames that are already encoded; fb-half=2 in the macOS kernel arguments takes them as such, and the grey cast of the linear reading (fb-half=1) is gone on hardware.
  • The GENI I2C core also moves buffered transfers of any length for the keyboard cover; the backlight register transfers are unchanged.
  • iPadOS 27 reads the nits range from IODisplayParameters.BrightnessMilliNits and sets brightness-nits as signed 16.16. CoreBrightness needs backlight-marketing-table and backlight-calibration-parameters to create the display. BrightnessControl reads LmaxProduct as 4 bytes of 16.16 and LmidProduct and LminProduct as numbers; a zero LmaxProduct makes every slider position the maximum. iPadOS 17 uses brightness and FadePeriod; the service accepts both.
  • ADT vmm-present makes MobileGestalt answer IsVirtualDevice, and iPadOS 27 CoreBrightness then selects VMBLControl, which drops every brightness request. AMFI and many frameworks need the answer, so UniXNU scripts/appsync/BacklightMode.m changes only backboardd: initBLControl: gets mode 1 instead of 3.
  • The board archive records SmmuBypass.h and AppsSmmuLock.h from the resolved board package directory as Bluetooth build dependencies.
  • The 24A446 display adapter declares fixed original targets. XnuPrelink relocates BTI/B stubs after native segment placement; a cached native-slide value is no longer used. The 2026-11-02 device log showed the unrelocated constructor branch jumping to 0xfffffff00dbb4c74 instead of 0xfffffff00a288c74, an excess of 0x392c000.
  • The display source and ABI binding are selected independently from the physical panel configuration.
  • The board configuration declares sRGB for the current 8-bit framebuffer path.
  • scripts/build-gop-legacy-display.py also builds the board driver objects in the display archive, including the ADSP, IPC router, FAT reader and battery manager.
  • With dpu=2 DisplayTimingProbe reads the VIG 0 and 1 pipes, CTL 0 and the tear checks; dpu=3 also rewrites the pipe addresses and times the flush latch (5.4 ms, no start needed: the panel refreshes by itself).
  • Direct scanout: the compositor submits a swap when the command buffer is scheduled, so the flip waits until the GPU wrote the frame; the wait removes the flicker (content changes of the shown surface fell from 808 to 2 per run). Direct scanout needs the 8-bit BGRA framebuffer.
  • The GENI I2C core also moves 1 to 8 byte writes and 1 to 4 byte reads (the audio amplifiers use 32-bit registers); the backlight keeps its 8-bit transfers.
  • The legacy display builder now refuses arm64e/iOS 26 before reading original ABI addresses. Its existing use of kernel_target.TRIPLE does not qualify the iOS 17 class layout for 23F84. Source input transport compilation is independent of this builder.
  • The 24A446 adapter creates a BGRA IOSurface through the original IOSurfaceRoot factory, checks allocation and geometry, and transfers its reference to the family default-surface field. The void create_default_fb_surface slot is invoked by the original start method.
  • build-gop-legacy-display-27.py reads the device checkout from UNIXNU_DEVICE (set by the release) before the sibling directory name, so a checkout under any name works., and the HID source is the tree pin (refer/IOHIDFamily of the feed) instead of a hand-placed driver-sources copy.
  • The 24A446 board archive resolves QcaBluetooth from the assembled tree before the device fallback, matching the selected runtime component.
  • The late probe starts USB through the weak sheng_usb_probe, and the board package build compiles QcomDwc3.

Completion criteria

  • A known frame appears with correct geometry and colors, then userland presentation and backlight controls work.

Current limits

  • The late display builder needs qualified prelink candidates and ABI records. A timing request requires a measured presentation result. The 24A446 default-surface adapter still requires a hardware boot result.
  • On iPadOS 27 backlight off on sleep is not verified. The range of 2, 140 and 500 nits is not measured and only sets the slider's scale.

Next action

  • Record frame timing, pixel format and presentation evidence for each image used to qualify display.
  • On iPadOS 27, verify that sleep turns the backlight off.

Evidence

Input

implemented

Components: ShengHidInput, ShengNovatekTouch, QcomGeniSpi.

Hardware and dependencies

  • Novatek NT36532 sensor, GENI SPI controller, pin configuration, reset/interrupt lines, firmware and touch coordinate geometry.

Configuration

  • Select ShengHidInput, ShengNovatekTouch and QcomGeniSpi; touch=4 and touch-hid=1 select board integration.

Procedure

  • Read TouchBoard.h and verify the SPI clock and mode against the controller setup.
  • Validate protocol reports, contact tracking and coordinate orientation before publishing HID events.

Development findings

  • Touch report timestamps and polling intervals use Mach-time conversion helpers on macOS. The Novatek source pin is 69fdd6223ed2572aa8bd8351e77c53a238276130.
  • Digitizer usage matching retains both registry properties while reading their numeric values, so concurrent event-driver updates cannot invalidate borrowed OSObject pointers.
  • Keyboard HID host stubs model synchronous report consumption and gate serialization for buffer lifetime tests; they do not qualify the touchscreen driver.
  • The touch thread counts its line interrupts, wakes, header peeks (stale, invalid), full frame reads and frames with the time in each ([touch cost]); idle, it reads one frame about every 1.5 s, 2.4 ms each.
  • The touch thread sleeps through the 5418-byte frame transfer until the serial engine's interrupt (GIC SPI 357) instead of polling; a deadline covers a lost interrupt and after eight transfers without gain it polls again (touch-spi-irq=0 keeps polling). Not yet run on hardware.
  • Once touched, the touch controller leaves doze and sends every frame of its active scan, about 0.38 s of CPU per second in the touch thread with nobody touching. The touch thread sends the doze host command again once three seconds have passed without a finger, checked after every wake whatever frame type was announced; on hardware the thread then returns to no CPU time.
  • On macOS 27.3 the HID device starts with offline-hid-home=1, and WindowServer pairs the touch screen with the display by the service's displayUUID, the UUID the framebuffer publishes as IOMFBUUID.
  • ButtonProbe retries the PMIC interrupt setup up to four times; a failure records the failing command in B err.
  • backboardd caches the event service's usage pair when it first sees the service, and drops every touch if that pair is not 0x0d/4. The DriverKit driver writes 1/6 and registers the service, so HidInputProbe checks every 2 ms until the service has been registered for 10 s.
  • The shared SMMU fixture adds UART14 stream 0x423 beside touch without modifying its route and accepts a 64-bit DMA buffer address.
  • The arm64e HID adapter uses the same fixed-target stub contract as the display adapter. Host verification checks all 51 IOHIDFamily stub destinations after fileset placement.
  • Controller transfer logic, sensor protocol and board sensor geometry are separate inputs.
  • Track contact IDs across movement and lift events; a register read alone covers only transport access.
  • sheng_buttons_press() holds a button mask for a given time through the HID sink, for unattended tests (the audio lock sound test uses it).
  • iPadOS 26 source-interface build: IOHIDDevice reports and independent touch/button, GENI SPI, Novatek and firmware archives compile. Four host model suites pass ASan/UBSan. The source path does not patch a foreign vtable.
  • On arm64e the event driver's vtable is copied and every slot is re-signed with the 220 discriminators read from the 24A446 kernelcache; each slot is checked against the original table first, and AppleUserHIDEventService, this device's event driver, takes the copy as well. A search over 16-bit values can accept a second discriminator with the same 24-bit signature and stops touch events.
  • With latency capture enabled, the HID input path records the time of each touch report handed to the event driver; these times bound the analysed touch windows. Contact IDs and coordinates are not recorded.
  • Idle touch handling returns the controller to doze after the last touch report.

Completion criteria

  • Touches map to the display, simultaneous contacts keep stable IDs, release events arrive, and buttons produce expected HID reports.

Current limits

  • Sensor firmware and board dimensions remain sheng inputs.
  • 23F84 HID linking/startup and edge gestures remain unqualified. Apple IOHIDFamily 2238.120.5 omits event-type/struct headers and the complete device build needs private reporting/analytics dependencies.

Next action

  • Attach contact and orientation observations when firmware or geometry changes.

Evidence

keyboard

device-verified

Hardware and dependencies

  • Nanosic WN8030 keyboard controller on I2C9 (QUP2 SE1 at 0x884000, client 0x4c, GIC SPI 583); interrupt GPIO 62, reset GPIO 58, sleep GPIO 57, status GPIO 56, supplies vreg_l12b_1p8 and vreg_l13b_3p3, from sm8550-xiaomi-sheng.dts of https://github.com/ianchb/sm8550-mainline.
  • Lid and tablet-mode hall sensors on GPIO 171 and 172, active low.
  • The controller RAM image nanosic/MCU_Upgrade.bin pinned in proprietary-files.txt.
  • SmartCoverServiceFilter.plugin and the IOHIDFamily-2238.120.5 event driver of iPadOS 27.0.1 (24A446).

Configuration

  • keyboard=1 starts the driver. keyboard-khz selects 1000 (default), 400 or 100 kHz; keyboard-backlight sets the backlight from 0 (default) to 100.
  • The supplies use active TCS 2 of the apps RSC under AppsSmmuLock, as the microphone and USB rails do.
  • The iPadOS 27 build compiles KeyboardCover.cpp with the source interface command of NativeHidInput and embeds the pinned image.

Procedure

  • Run scripts/extract-files.py --section Keyboard before building.
  • Run scripts/check-wn8030-host.py, scripts/check-keyboard-cover-host.py, scripts/check-keyboard-service-host.py and scripts/check-geni-i2c-host.py.
  • Boot with the cover attached, type, use the touchpad, fold the cover behind the tablet, close it and detach it, then read the K row of the boot log.

Development findings

  • The shared macOS display archive compiles battery authentication alongside the keyboard, display and USB services. Battery authentication requests use the existing serialized battery-manager queue.
  • The macOS pointer sends raw controller displacement at a declared 828 counts/inch. Every nonzero single-count sample, including diagonal motion, reaches HID; only unchanged reports are suppressed. Scroll remains 48 counts per step.
  • Each HID device owns one 21-byte input buffer, serialized by its command gate. Synchronous report consumers finish before reuse; recursive submissions are rejected. Stop prevents further input, and free removes the gate and releases the buffer.
  • The worker drains at most 16 frames before servicing control deadlines. Failed reads retain their pending interrupt and retry after 100 ms. Failed keepalive commands wake the controller through its sleep GPIO; three consecutive read or control failures release input and reload firmware, with failed reloads backing off to 32 s. Idle alone never triggers a reset. A 12 s frame poll catches missed controller edges; a 1 s hall poll repairs missed gate changes.
  • Cover attach/detach queues Xiaomi battery property 0xe4 through the battery work loop.
  • keyboard-lone=1 keeps a report's only touching contact although the controller gives it no confidence; two or more such contacts are still lifted as resting hands. Not yet run on hardware.
  • On macOS the touchpad is dead while its reports carry only touching contacts without confidence (3 to 28 s at first use); cause unknown, the KP rows record such reports. The pointer takes movement only between reports with the same contact ids and keeps a click's button until release.
  • On macOS 27.3 the cover is a keyboard and a pointer: no Keyboard Power input (macOS reads it as the power key held down) and the touchpad as relative motion, scroll steps and two buttons (wn8030_pointer_report). On the tablet the keys work, macOS's keyboard setup completes and the pointer moves in the right directions (macOS 27.3, 2026-11-10); scrolling and the buttons were not reported on.
  • keyboard=1 is in the macOS 27.3 kernel arguments; the cover enumerates there as an I2C HID keyboard.
  • The boot ROM answers id 0xc8 in state 0, takes a 65-byte header (state 1), 99 data blocks of up to 503 bytes, a verify command (state 3) and a boot command. The image header's ram_code_checksum is the byte sum of the 49756 code bytes; the header command carries their 32-bit word sum.
  • Controller frames start with 0x57 and byte 3 names the content: report 5 keyboard, 6 consumer, 0x19 touchpad, 0x22 to 0x24 vendor messages (0xa2 attach state, 0x64 accelerometer, 0x24, 0x31 and 0x32 authentication).
  • SmartCoverServiceFilter matches a service whose usage pairs include Touch Pad, Finger and Keyboard and whose transport does not contain test, and it needs SurfaceDimensions. IOHIDDevice lists only Application and Physical collections as usage pairs, so the fingers are Physical collections of one device.
  • The event driver's SurfaceDimensions conversion handles only centimetre units (0x11); the touchpad X and Y extents are 9.35 and 5.55 cm.
  • Keyboard Power (page 7, usage 0x66) as a feature and an input element sets KeyboardEnabled, which decides whether the system shows the on-screen keyboard.
  • Every I2C transfer runs from the engine interrupt. The keyboard thread sleeps until a controller, hall or engine event or the 12 s keep-awake deadline.
  • The controller's touchpad Y grows toward the hinge; the driver sends 2031 minus Y.
  • SmartCoverServiceFilter aborts backboardd (index past the end of the hand event's children) when a touching contact with Touch Valid 0 is the last child. The driver sends such palms as lifted.
  • While a finger moves, the controller sends about 20 touchpad frames per second at both 100 kHz and 1 MHz.

Completion criteria

  • Keys, consumer keys and the touchpad reach iPadOS, with touchpad gestures from SmartCoverServiceFilter.
  • Folding the cover behind the tablet or closing it releases input and shows the on-screen keyboard; attaching and detaching create and remove the device.

Current limits

  • The pointer hitches about once a second while moving; the cause is not known.
  • Cover authentication needs the devauth trusted application and is not implemented; its requests stay unanswered.
  • The tablet accelerometer is not available, so only the hall sensors gate input, not the hinge angle.
  • The mic mute LED is not synchronized, and the backlight is a fixed level.
  • Raw pointer motion, buffer reuse, battery synchronization and communication recovery have host coverage; their effect on the reported macOS charging and idle failures is not yet measured on hardware.
  • Controller suspend and resume are not implemented.

Next action

  • Measure diagonal pointer cadence, charging at boot and keyboard/touchpad response after extended idle with the recovery image.
  • Implement authentication and controller suspend and resume.

Evidence

GPU

implemented

Components: Adreno740, AdrenoMetal, AirNir, Sm8550Platform, AdrenoPM4, AdrenoFirmware, ArmSmmu4K.

Hardware and dependencies

  • A740 GPU/GMU registers, GPU SMMU streams 0/1 and GMU stream 5, signed ZAP firmware and board power votes.
  • Turnip, metal2vulkan, AIR translation and the selected OS GPU/Metal ABI.

Configuration

  • Select Adreno740, AdrenoMetal and AirNir; shared SM8550 operations arrive through component dependencies.
  • Board scripts combine shared GMU code with package/ShengGmuVotes.c.
  • gpu-preempt defaults to 2: requested high priorities use ring 0, normal/low work uses ring 1. Mode 1 sends only low/background to ring 1; mode 0 selects one ring.

Procedure

  • Qualify power, firmware, SMMU and GMU startup before command submission.
  • Check memory mapping, command completion and a known rendered image before staging the Metal plugin.

Development findings

  • The macOS 27.3 capture completed 19572 function checkpoints and 129 of 258 eligible libraries. The pass reported 8037 refused functions and one GPU recovery; numerical and performance comparison awaits complete priming.
  • The macOS runtime build inventories Metal libraries from OS, SystemOS and App, embeds the list in the plugin and packages its sidecar. Missing or invalid inventory keeps the priming pass incomplete. Planned lab returns record prime-resume so interrupted work can resume after reboot.
  • The macOS run139 lowering-worker-off experiment (metal-flow=6) did not demonstrate a lower heavy-frame commit-to-schedule median: 17.4 ms versus run136 at 17.0 ms, with unequal retained trace windows. The default is retained and the experiment is closed. The final capture still reports one recovered GPU hang; the zero-high-word fault root cause remains unresolved. See reports/macos27-memory-run139.md.
  • The GPU governor counts a 16 ms window as work only when the GPU was busy for 1 % of it or the ring holds jobs; an idle window's trace of busy time is rest, so the wake boost fires at the first work after a pause (60 to 95 boosts a run on hardware, none before).
  • macOS 27.3: DarwinBoot lists the free memory outside the kernel's window (the low DRAM bank, about 867 MiB) and package/GpuMemoryPool.cpp hands it to the GPU driver, which serves buffer objects from it before it takes window memory (gpu-pool=0 turns it off). gpu-bundle-system=1 is off: with the plugin only under /System/Library/Extensions IOGPU refuses it and WindowServer gets no Metal device.
  • Fence waiters are woken by the driver's completion pass from the GPU interrupt (gpu-fence-wake=0 keeps the timed pause); a submission no longer cleans the driver's eleven context buffers (8548 KiB each time before); a GPU-denied task submits at background priority; gpu-dcvs-span sets how many 16 ms windows the governor sums (default 1). Not yet run on hardware.
  • The Metal runtime discards idle resources that callers declare Volatile and answers Empty when they are used again (gpu-purge=0 keeps them). Not yet run on hardware.
  • The GPU governor treats the GPU as idle only after 80 ms without work. One empty 16 ms window at the floor level used to count as idle, so every light frame after it took the wake boost to the top level: macOS at rest spent 96 % of the time above the floor with the GPU under 1 % busy. With the corrected rule the wake boosts at rest dropped from 530 to none in a run.
  • Each ring restores its executed page-table snapshot, saves GMEM and runs the SRAM postamble. GMU keepalive covers restore-register writes through the incoming WPTR update; board writes retry AHB-fence drops.
  • The shared process queue keeps FIFO across priority changes. Current live Metal requests determine priority, with task GPU role selecting foreground or background.
  • All AdrenoMetal clients use one sample by default; NATIVE_METAL_SINGLE_SAMPLE=0 preserves a process's requested sample counts. The frontend implements heap aliasing, swizzles, mip/slice copies, function constants and callbacks, specialized link names, backing-allocation statistics, queue capacity and full viewport/scissor arrays.
  • Writable same-user caches cover frontend, runtime and Turnip IR3 artifacts; restricted clients use private caches. Normal builds enable Mesa disk caching and apply the recorded vendor patches.
  • The optional wallpaper-freeze=1 mode retains a Poster renderer's first completed large IOSurface draw and parks later runtime commits. PosterBoard and compositor clients keep running. Event 60 identifies the completion boundary and parked commands.
  • The current sheng iPadOS 27 image boots and accepts touch interaction, and shader priming covers 280 of 280 selected libraries. Foreground and room-worker 64 MiB allocations still overlap. Focused latency capture retains full-width runtime memory phases, command and pass timings, paired callbacks and allocation roles. GPU pixel collection and per-frame content scans are disabled.
  • The kernel GPU ring keeps submission, retirement, display arrival, fence, latch, build identity and the render server's render, encode and completion thread identities; client processes forward nothing else. The decoders read only these records and write touch-window subsets.
  • check-gpu-trace.py checks that Turnip's GMEM swap trace (passes, transfers, attachments) leaves only the render server, and the kernel store keeps events 36, 37 and 44.
  • AdrenoMetal carries 25 patches over metal2vulkan 963f0e64. The lowering thread, commit submission and pipeline warm pass are off by default and metal-flow=1 enables them for testing. They showed no measured frame rate gain, and one of four boots with them stopped presenting at the logo. pipeline_waits stays Exact because the upstream default drops draws of a pipeline not made in time.
  • The macos27 target builds Turnip, the Rust bridge and NativeAdrenoMetal.bundle as arm64e Mach-Os for macOS 27 (LC_BUILD_VERSION platform 1, minos 27.0). The macOS bundle keeps the executable and Turnip in Contents/MacOS (turnip::libraryPath looks beside the executable) and gpu-build.json in Contents/Resources, which codesign seals as data. The macOS payload does not yet carry it ([payload.runtime] gpu_addon = false).
  • Mesa's ir3 parser needs GNU Bison 3 or newer (-Wcounterexamples); Xcode's bison is 2.3. The builds take tools from .cache/mesa-tools/bin first.
  • GPU diagnostics retain bounded submission and wait records alongside the native driver recovery state.

Completion criteria

  • GPU submissions complete, mapping/fence handling is correct, a known image renders, and the selected Metal client presents it.

Current limits

  • A740 coverage depends on the selected firmware and OS ABI; board qualification requires its own memory and power evidence.

Next action

  • Qualify concurrent Metal clients, repeated preemption, rendered pixels and frame pacing on sheng with iPadOS 27.
  • Run third-party Metal applications with cryptid 0 on the metal2vulkan 963f0e64 build. Find why backboardd stopped presenting with metal-flow=1 before enabling any of its three paths.

Evidence

bluetooth

device-verified

Components: QcaBluetooth.

Hardware and dependencies

Configuration

  • UART14 is QUP2 SE6 at 0x898000, GIC INTID 493, wrapper 0x8c0000 and apps-SMMU stream 0x423; CTS/RTS/TX/RX use GPIO 76/77/78/79 and BT_EN uses GPIO 81.
  • The board's 3.2 Mbaud operating rate uses a 51.2 MHz serial source and 16x oversampling.
  • package/BluetoothFirmware.h and stage-bluetooth-firmware.py share firmware/qca under the Data addon.
  • bluetooth=1 starts the bound UART14 worker after Data addon installation; log-bluetooth=1 enables initialization messages. The drivers/QcaBluetooth submodule or an explicit --local-module checkout supplies kernel and runtime sources.

Procedure

  • Stage firmware with scripts/stage-bluetooth-firmware.py OUTPUT --source FIRMWARE_QCA_DIRECTORY.
  • Run scripts/check-wcn-power.py and scripts/check-bluetooth-board.py ASSEMBLED_TREE after changing shared power.
  • Build the protocol, GENI DMA and Skywalk sources with the selected arm64e kernel command, then package BlueTool and the native controller adapter.
  • Boot the integrated image with log-bluetooth=1, then check pairing, reconnection, audio, sleep and recovery.

Development findings

  • The macOS profile explicitly selects QcaBluetooth so the kernel component and runtime use the same pinned source checkout.
  • log-bluetooth=3 captures bounded discovery HCI frames at UART acceptance and controller receive, including Inquiry Complete and full result payloads. BootLog reserves 16 KiB per slot, advances the trace cursor only after successful storage sync, and snapshots the newest sixteen records at panic. Physical discovery remains unverified.
  • The Bluetooth RX wake pin shares TLMM summary interrupt 240 with touch and keyboard and its raw status latches while the wake is disarmed; a wake acknowledgement queued behind a stopped UART clock made the worker spin, fixed in QcaBluetooth. Not yet run on hardware.
  • On macOS 27.3 the image carries the Bluetooth runtime: the serial device front end (/dev/cu.BLTH), the daemon patched by the 26C5035r adapter and BlueTool in the addon's sbin (shown over /usr/sbin), the capability library in the addon's lib (shown over /usr/lib), the firmware, and bluetooth=1. On the tablet the controller comes up, the system's job starts the patched daemon, it loads the library and opens the serial device; its initialization then failed on a Broadcom version command (the daemon's default chipset) and it restarted every ten seconds. The adapter now makes the third-party chipset the default; that has not run yet, so the Settings page and pairing are not confirmed.
  • On iPadOS 27.0.1 (24A446) the device pairs AirPods Pro, reconnects after reboot without pairing again, toggles power, plays A2DP at normal volume and quality, and shows noise control and battery. Music over Bluetooth during 2.4 and 5 GHz speed tests stays normal.
  • WcnPower records independent WLAN and Bluetooth ownership of the six shared supplies; the last owner releases them. Bluetooth-only startup omits the PCIe NoC vote. Wi-Fi startup uses this ownership interface.
  • The firmware VFS reader waits for Data addon installation, accepts controller firmware names, bounds file size and rejects short reads.
  • The protocol core uses the byte-identical Linux btqca.c initialization through namespaced host services. H4 backpressure retains input, and IBS control bytes enter only between TX packets.
  • The GENI engine provides bounded DMA buffers, deferred IRQ work, wire drain checks, quiesce/resume and error reporting. UART.SK and BlueTool sources compile for the 27 target.
  • BluetoothProbe binds UART14 clocks, 32 KiB of DMA buffers through the firmware-managed bypass bank, IRQ 493 and GPIO79 wake. The 64-bit physical DMA addresses use the same shared mapping planner as touch and audio; Bluetooth uses no private page tables. Shared configuration locks preserve touch and audio resources; GIC routes dispatch directly to registered handlers. Hardware faults abort command waiters immediately.
  • The version-locked 27 adapter selects type zero, clears vendor hooks, preserves generic callbacks and skips the empty H4 pre-stop hook. Real HCI reports supply eleven capabilities, including coded and 2M PHY; an asynchronous 0x203b query supplies up to six native advertising sets. Model, cache, lower flags and broadcaster mode agree.
  • The board publishes a bluetooth IOService before userland starts, with H4 encoding, 3.2 Mbaud and a private stable MAC. Public addresses use network order and convert to Linux bdaddr_t at initialization. The runtime signs three arm64e binaries, preserves bluetoothd entitlements and uses read-only system-path overlays; BlueTool runs as root with transactions enabled.
  • The kernel archive and runtime builder accept the same resolved QcaBluetooth checkout. UART clock-restore failures end the transport, preserve the hardware error and stop command waits and wake retries. The board startup entry uses C linkage to match the late platform probe. The archive record hashes the Bluetooth board, core, shim and SoC inputs before kernel linkage.
  • Controller shutdown and faults clear the UART.SK queues, wake both rings and return the controller error from sync callbacks before data movement. In-flight notifications retain both rings until disconnect can release them.
  • BlueTool starts the controller by reading kern.qbt_power_on because its sandbox denies sysctl writes; connecting to UART.SK also starts a stopped controller. Closing state belongs to the nexus that owns the session, so a channel torn down after its control socket closed cannot block the next connection.
  • Extended scanning uses 0x2041 and 0x2042, because the controller rejects legacy scan commands once extended advertising commands have been used. Apple's scan extension stays off because it has no type zero backend.
  • A random address (0x2005) is queued before a scan can be enabled, and starting an advertising set always sends its address (0x2035). When no resolvable address can be generated, the refresh uses a non-resolvable address and completes, so the daemon does not restart on the busy flag.
  • Pairing keys need the keychain, which needs AppleKeyStoreState software key wrapping. The board returns /chosen/unique-chip-id through native_aks_device_id.
  • The macOS integration selects QcaBluetooth effe4ec5c57cd400a5f818b21c9903fef237edbc with the merged runtime and signed launchd configuration.

Completion criteria

  • The integrated kernel and payload boot with independent Bluetooth power and live UART DMA/IRQ.
  • The native stack scans, pairs, reconnects, stores keys, supports BLE and plays Bluetooth audio.
  • Idle power, audio continuity, recovery and Wi-Fi coexistence have device measurements tied to the image revision.

Current limits

  • Calls and microphone (HFP/SCO), sleep and wake, idle power and recovery are not tested.
  • The kern.qbt_* sysctl names compile but have not run on the device; the device results use the earlier names. A build that resolves the driver from the submodule has not been run.
  • Features that need Apple vendor commands are unavailable. Non-connectable advertising uses a non-resolvable address because the secondary IRK is zero.

Next action

  • Boot an image built from the submodule to confirm the kern.qbt_* sysctls, then test calls and microphone, sleep and wake, idle power and recovery.

Evidence

usb

device-verified

Components: QcomDwc3.

Hardware and dependencies

  • AppleUSBXDCI, AppleUSBXHCI, IOUSBDeviceFamily, IOUSBHostFamily and AppleUSBDeviceMux from the 24A446 kernelcache.
  • Linux reference https://github.com/ianchb/sm8550-mainline for the SoC sequences and sm8550-xiaomi-sheng.dts for the board.

Configuration

  • drivers/QcomDwc3 is a submodule of https://github.com/UniXNU/QcomDwc3.
  • usb=1 runs the driver; 2 adds register sampling; 3 also takes the controller off the bus and back once.
  • usb-host=<s> forces host mode after a delay; usb-back=<s> then returns to the cable's role.
  • aks-sls=3 reports no passcode.
  • board.toml adds the USB device and host stacks to the prelink roots for iPadOS 27 and leaves out AppleOnboardSerial and AppleSMC.
  • chip_id 0x8142 comes from board.toml; board-id 0xc and security-domain 1 come from the OS profile.
  • The provider's configuration-string is standardMuxOnly.

Procedure

  • Generate the class layouts again after the kernelcache changes.
  • Boot and connect to a Mac: the device lists as 05ac:12ab and lockdownd answers QueryType.
  • Unlock the tablet and tap Trust: the Mac reports the device as paired and starts a lockdown session.

Development findings

  • The macOS desktop transport builds BootShim, board firmware and DarwinBoot from the selected uefi-sheng checkout.
  • QcomDwc3 exposes a UCSI data-host request and connector generation. Connection changes invalidate authentication; USB power-role control stays with the DSP.
  • Keyboard attachment writes share the battery manager request queue; UCSI owner 32779 remains routed separately on the same GLINK channel. QcomDwc3 receives USB online only from a valid reading. The macOS archive source fingerprint includes KeyboardService.h.
  • build-gop-legacy-display-27.py builds the video objects after the USB controller's and adds them to the same archive; the USB bindings are unchanged.
  • board.toml documents the adoption of the low DRAM bank, on by default; nothing of the USB controller depends on it.
  • The USB controller's buffers come from the VM, which on macOS 27.3 includes the adopted low DRAM bank; no USB memory sits at a fixed address there.
  • The [usb ...] board rows come from package/UsbProbe.cpp; package/BootLog.c, which prints them, belongs to the diagnostics area.
  • With log-power=1 the boot log has a [pmic rtc] row: the PMK8550 real-time clock's control register and seconds counter, read only. The counter runs but is not wall time, and the system has no real-time clock service yet; the calendar starts one day before the kernel build date until the network time arrives.
  • The macOS 27.3 override of board.toml keeps the Bluetooth runtime tool with target macos27 and adds bluetooth=1 to the kernel arguments (864 bytes); the iPadOS settings are unchanged.
  • ucsi-delay=<seconds> in ShengBattery.cpp holds the first UCSI command (PPM_RESET) back after the channel comes up; it is a diagnosis of the missing USB input under this kernel and defaults to no delay.
  • The [kernel cpu] rows that boot-ui-trace=1 adds to the boot log in BootLog.c do not change the [usb] rows or the USB stacks.
  • keyboard=1 in board.toml and the keyboard cover in LegacyDisplayProbe.cpp, BootLog.c and the iPadOS 27 board build start after the USB probe and do not change the USB stacks.
  • The boot log's [usb] rows travel in the text slot, which UFS log version 5 writes only up to its last used block.
  • payload.runtime.appsync and appsync=1 in board.toml do not change the USB stacks; unsigned apps install over USB through installation_proxy and the AppSync installation hook.
  • AppleUSBXDCI programs the DWC3 itself; a subclass supplies the register window at base + 0xc000, one interrupter, power and PHYs. AppleUSBXDCI has no personality, so it needs an explicit kext load before the subclass registers.
  • The driver does no cache maintenance. Stream 0x40 needs a stage 1 identity context with write-back inner shareable blocks; through the shared bypass bank the CPU reads stale event words.
  • The eUSB2 reference is 38.4 MHz (xo_board 76.8 MHz, RPMH_CXO_CLK divides by 2). With the 19.2 MHz table chirp passes and high-speed data fails.
  • Slot 179 of the class keeps the family's configuration list when true, which leaves bNumConfigurations 0; it must stay false without an IOPort transport object.
  • lockdownd starts on the IOResources property AppleUSBCableType=USBHost, one of its launch events; configd's USBDeviceConfiguration plug-in then sets the description and the family goes on the bus.
  • UCSI reports the cable partner and selects the role. Until it answers, the charger's online value stands in for a host.
  • In host mode the family's desired power is 0 once ports are idle, so the xHCI subclass answers on. The device stack answers 0 while the host role owns the core.
  • A Mac looks up chip-id, board-id and security-domain in MobileDevice's device map. A pair that is missing makes it ask for a software update.
  • SpringBoard accepts a CFUserNotification from a process on the system partition: it compares statfs f_fsid of the executable with /System. The SystemOS union layer has its own number, so native-union-statfs-fsid reports the root volume's number for that layer.
  • lockdownd completes Trust directly only in lock state 3. Any other state asks for a passcode.
  • The BootLog.c DIO row does not change the USB stacks.

Completion criteria

  • A Mac enumerates the device, usbmuxd lists it and lockdownd answers, at 10 Gbps on a USB 3 cable and 480 Mbps on a USB 2 cable.
  • A physical reconnect re-enumerates.
  • Trust appears on the panel, the Mac pairs and starts a session, and lockdownd starts installation_proxy, afc, atc and diagnostics_relay.

Current limits

  • Sustained transfers and app installation have not run.
  • One cable orientation has run on USB 3.
  • Host mode runs Apple's xHCI stack and completes commands; enumerating a peripheral is not verified.
  • MobileDeviceMinimumVersion has no answer; a Mac treats that as no update needed.
  • fairplayd.A2 and adid stay disabled: with both enabled, SpringBoard does not finish starting.

Next action

  • Run a sustained transfer and an app installation.
  • Test the reverse cable orientation on USB 3.
  • Verify peripheral enumeration in host mode.

Evidence

Network

implemented

Components: Ath12kWifi.

Hardware and dependencies

  • WCN7850 PCIe endpoint, MSI routing, DMA callbacks and hash-pinned amss.bin, m3.bin and board-2.bin.

Configuration

  • wifi=5 selects the mainline cfg80211/mac80211/ath12k runtime; wpa_supplicant 2.12 owns userspace authentication.
  • WifiProbe supplies power/PCIe/MSI and the 128 MiB DMA window; WifiNet exposes en0/Apple80211. The DTS exports /arm-io/wlan for wifid.
  • The signed service runs at /usr/libexec/unixnu-wpa_supplicant. package/WifiFirmware.h defines the shared loader/packer directory /private/var/ngpu/firmware/ath12k/WCN7850/hw2.0/.

Procedure

  • Run host checks affected by source changes, build the kernel/payload/boot image and verify packed inputs.
  • Check scanning, association, DHCP, traffic, cancellation and signal display on the device; measure throughput, jitter and heat.

Development findings

  • The Wi-Fi runtime fetches WCN7850 amss.bin, m3.bin and board-2.bin from linux-firmware revision a4ce85e98a33fa1021c31d1887fc2dffed27e8dd into .cache/firmware/wcn7850 and checks their sizes and SHA-256 values against firmware/wcn7850/manifest.json.
  • The Ath12kWifi source pin is 39cc47b7bd1afef3c03a977c0c06fe475199ac0c. It is resolved with the current SoC feed for the macOS build.
  • The wireless daemon reaches the driver through its user client: the interface grants it to airportd, sharingd and wifivelocityd, a set request without a length takes the sent length, the capability reply states scan completion, and a scan-results request rewinds the result cursor. On hardware the daemon's scans complete without error and return 5 to 13 networks.
  • wifi-aj=2 keeps the unattended-test join beside the wireless daemon: the kernel joins the network of join.txt, does not carry out the daemon's disconnect requests, and en0 gets its address by DHCP (192.168.10.x on hardware, the router answers ping). wifi-aj=1 stops once the daemon acts.
  • Apple80211 byte replies (country code, SSID, BSSID) to a request the kernel made are copied with memcpy: its buffer is a kernel buffer, which copyout refuses. With that the wireless daemon's scan and country requests succeed on macOS 27.3.
  • Receive path: packet metadata lives in heap memory instead of the uncached DMA window, the spare receive mbufs are kept between batches, and a frame is classified from its copy; log-wifi=1 adds per-stage times and TCP order counters. Not yet run on hardware.
  • With log-power=1 the boot log has a [pmic rtc] row: the PMK8550 real-time clock's control register and seconds counter, read only. The counter runs but is not wall time, and the system has no real-time clock service yet; the calendar starts one day before the kernel build date until the network time arrives.
  • WifiProbe.cpp also hosts the read-only charger PMIC survey for the power log (sheng_charger_pmic_sample); the WiFi power sequence is unchanged.
  • On macOS 27.3 (26C5035r) the module's frames travel over en0, an IOEthernetController of the original IONetworkingFamily; the supplicant is built for macOS and its job is a plist in /Library/LaunchDaemons. Association, DHCP and traffic are verified on the device.
  • The supplicant job runs with -q -s and no StandardOutPath: warnings and errors go to syslog and logd's bounded store, and no Wi-Fi log file grows on Data. The Ath12kWifi pin builds the supplicant with CONFIG_DEBUG_SYSLOG.
  • Device verification covers Wi-Fi toggling, SSID scanning, WPA2 association, DHCP, traffic and join-result delivery.
  • Accepted joins complete after port authorization, cancel once and time out after 30 seconds. Association and cached peer RSSI supply signal updates.
  • TX/RX use direct copies, shared DMA storage, bounded reuse and batching; mac80211 supplies aggregation, reordering, FQ and AQL.
  • Data firmware reads wait for addon installation. Packaging validates file hashes, service/cache signatures, stock jobs, trust modules and the preserved Data seed.
  • The shared runtime cache retains the native Wi-Fi jobs and adds the supplicant alongside the Bluetooth service configuration; the original Data seed and existing trust modules are preserved.
  • The WCN7850 firmware manifest and source fetcher select matching pinned inputs for the macOS runtime.

Completion criteria

  • Scanning, association, address configuration and sustained bidirectional traffic pass with the selected firmware.

Current limits

  • Current-image device checks pending: cancellation/timeout completion, runtime signal display, Data firmware startup, throughput, jitter and heat.

Next action

  • Complete the pending device checks and tune packet processing, scheduling and power from the measured results.

Evidence

Audio

implemented

Hardware and dependencies

  • ADSP firmware from modem_a, SMEM, SMP2P, GLINK, the GPR channel adsp_apps.
  • Speakers: six CS35L43 amplifiers on QUP1 SE5 and QUP2 SE0 (I2C 0x40 to 0x42), shared reset gpio90, secondary MI2S (gpio121 to 124).
  • Microphones: WCD938x codec on the TX SoundWire master (0x6d30000), reset gpio108, supply ldob15; TX and VA macros.

Configuration

  • audio takes bits (adsp=2 is required): any nonzero value serves the audio service, 2 plays a 1.5 s 750 Hz test tone at boot, 4 brings up the microphone path and reads two seconds of capture, 8 runs the lock sound test.
  • audio-pa moves the DSP period buffer (default 0xd0000000); audio-tone-ms and audio-atten set the tone.
  • The payload addon carries hal/ShengAudio.driver under audio/; patches/xnu/zzyd-sheng-audio-addon-mount.patch mounts it over /System/Library/Audio/Plug-Ins/HAL. Its CDHash joins the owner trust cache.

Procedure

  • Read the [audio], [amps], [audio-glink], [audio-buffer], [mic], [mic regs] and [mic capture] log lines with scripts/read-sheng-log.py.
  • Read [audio-props], [audio-service], [audio-io], [audio-thread], [audio-clock], [audio-requests] and [audio-sync] for the iOS path: the plug-in's volume and peak, late and silent periods, write-ahead and read-behind, IO cycle intervals, clock skew, the audio server's IO thread scheduling and host clock, and the plug-in's last start and stop requests.
  • Run scripts/check-audioreach-host.py, scripts/check-cs35l43-host.py and scripts/check-geni-i2c-host.py after changing the codecs.

Development findings

  • The macOS audio plug-in queries the macosx SDK and builds as arm64e-apple-macos27.0. The iPhoneOS SDK query belongs to iPadOS targets.
  • The audio server plug-in keeps its image's segments resident (mlock): the audio server had counted I/O overloads with page faults on the I/O thread under memory pressure. Not yet run on hardware.
  • The GENI I2C core also moves buffered transfers of any length for the keyboard cover; the amplifier register transfers are unchanged.
  • The ADSP image loads in place from the split adsp and adsp_dtb files in /image of the modem_a FAT volume.
  • The DSP offers 24 intents of 128 bytes on adsp_apps and grants a 4 KiB one on request; the GLINK remote intent table keeps it.
  • The amplifiers play ASP RX1 directly (DSP bypassed, no amplifier firmware): top three slot 0, bottom three slot 1, gain 18 dB, 16-bit I2S at 48 kHz from the SoC as clock master.
  • The DSP takes buffers as a 32-bit address with the stream index (0x1001 & 0xf) in the upper word. The period buffer is low DRAM outside the kernel's window, mapped write-combined; the audio streams stay in SMMU pass-through.
  • Programming a translating SMMU context for the audio streams resets the board; the hypervisor keeps those context banks.
  • PRM commands go from the PRM port (2) and use PRM clock ids: the TX core clock is 0x30c. The macro and digital codec votes make the LPASS registers accessible.
  • The VA macro gates the TX SoundWire master's clock on SM8550; with its gate and the TX macro's on, the link comes up and the codec enumerates as device 1.
  • The primary microphone is AMIC3 on micbias 3 into ADC2, codec data port 1 channel 2, master port 2, TX decimator 0 from SWR_MIC1 and codec DMA TX3, mono 48 kHz.
  • iOS sees the plug-in device only with the Thunderbolt transport type: VirtualAudio makes it a driver device with one output and one input port. Built-in devices need Apple port descriptions, and a USB device needs a location the audio server does not take from a plug-in.
  • The plug-in and the service share one timeline anchored at boot on the 19.2 MHz host timer (400 ticks per frame, computed in 128-bit). Playback and capture rings hold 65536 frames; the service takes 480-frame periods and keeps four in flight.
  • The DSP answers a playback buffer once it has copied it, so the steady lead is measured per run (about 1600 to 2000 frames) and the published lead is at least 300 ms.
  • Capture answers carry a byte count and an offset; only those bytes are taken, and a short period is normal.
  • CoreAudio takes the host clock to be 24 MHz (one constant behind AudioGetHostClockFrequency). The plug-in finds that constant and the service sets it to 19.2 MHz on its shared page; without it the audio server's IO cycles ran 25 percent long and playback and recording stuttered.
  • The zero time stamps start at the frame IO starts on, every 65536 frames, with the raw clock algorithm. A period under the safety offset stops the audio server's IO.
  • The audio server's IO thread runs with a time constraint (priority 97, period 409600 ticks, computation 204800).
  • The audio server is arm64e on iPadOS 27: dlsym signs the pointer it returns, so the plug-in strips the signature to read the two instructions behind AudioGetHostClockFrequency and calls through the signed pointer. The VirtualAudio image-added rebind is built for arm64 only, because the slot pointers there are authenticated with their slot address and a plain rebind faults.
  • The audio overlay hides the system HAL plug-in directory from audiomxd. board.toml audio_system_plugins lists BTAudioHALPlugin.driver, and the runtime builder copies its unchanged bundle from the OS image. Other system plug-ins stay hidden.
  • Audio takes AppsSmmuLock and uses sm8550_gcc_update32 for its GCC clock vote when present, so the vote and shared SMMU setup do not race Bluetooth and touch.
  • The microphone rail request holds AppsSmmuLock because TCS 2 is shared with the USB rails. ADSP messages reach 560 bytes to fit UCSI.

Completion criteria

  • Each declared route carries the selected audio format through playback or capture and handles start/stop correctly.

Current limits

  • Playback sounds harsh in places; no speaker equalization or protection runs.

Next action

  • Qualify iOS playback and capture across apps and routes, then add speaker equalization and protection.

Evidence

Power

implemented

Components: AppleKeyStoreState.

Hardware and dependencies

  • Board PMGR integration, clocks/regulators and per-peripheral power requirements.
  • ADSP battery manager: PMIC GLINK owner 32778 on PMIC_RTR_ADSP_APPS; board properties use opcode 0x50; fuel gauges 0x8a/0x8b and 0xa6/0xa7.

Configuration

  • CONFIG_XNU_SHENG_PMGR=y; pmgr=2 selects the board integration.
  • AppleKeyStoreState is selected with the OS event integration.
  • adsp=2 publishes the battery as an IOPMPowerSource; battery=0 leaves it off.
  • usb-sdp-ma sets the input limit on a standard computer port (default 900; 0 keeps the firmware limit).
  • cpufreq=4 scales the CPU domains with load (cpufreq-min sets a floor in MHz); cpufreq=3 fixes the highest non-turbo level.
  • gpu-dcvs=1 scales the GPU clock with its busy time (gpu-dcvs-min sets the floor level, default 3); gpu-perf fixes a level instead.

Procedure

  • Document each clock, regulator and firmware-owned state before enabling power transitions.
  • Check battery units and update behavior separately from suspend/resume and peripheral power.
  • Read the [battery], [battery-raw] and [charger] log lines with scripts/read-sheng-log.py.

Development findings

  • The macOS source-storage startup registers a PSCI SMC halt/restart callback only when PE_halt_restart is unowned. SYSTEM_OFF and SYSTEM_RESET availability is queried before registration; panic notifications do not trigger either operation. Unsupported or returned firmware calls report failure. Device power transitions remain pending validation.
  • The macOS 27.3 PC-USB capture reported battery 97 percent, 4865 mV and 1109 mA at the input, with gauge authentication bits 3.
  • AdapterDetails selects USB property 7 for the adapter family, the port maximum for advertised current and BmPowerMax for adapter wattage.
  • run-sheng-charge-test.py boots the reader in RAM, starts authentication in an independent session with SIGHUP ignored, retrieves charger and kernel logs after USB reconnects and confirms fastboot within a 270 s host limit. The original 300 s reader return timer remains active.
  • The Linux 7.3.4 charge reader packages a static aarch64 sheng-charge executable, ADSP firmware and the qcom_battmgr dependency closure. sheng-charge-setup loads the modules after the reader starts its 300 s rebootbl timer. The tool discovers the pmic_glink.power-supply auxiliary xiaomi sysfs directory, waits up to 30 s for a successful service response, reads the qcom-battmgr-usb and qcom-battmgr-bat supplies and runs the same ShengChargeAuth.c authentication state machine as macOS.
  • ShengChargeAuth.c is shared by macOS and the Linux sysfs tool. It authenticates both gauges with HMAC-SHA256, then a Xiaomi adapter with SVID 0x2717 and valid PDO2. Authentication runs once per PD attachment, with bounded retries and serialized 24-, 32- and 52-byte battery-manager requests.
  • The DSP owns PD/PPS contracts, charge pumps, current limits and thermal regulation. log-power=1 records authentication, PD state and both charge pumps. The Linux tool captures the same properties and runs the shared state machine with --authenticate.
  • Host checks against an independent CommonCrypto peer passed for gauge and adapter authentication, reconnects, mismatched replies, digest lengths and timeouts. PD/PPS/MiPPS power measurement uses the physical charger and cable.
  • Cover state uses Xiaomi board SET opcode 0x51, property 0xe4, and one outstanding battery-manager request. The queue coalesces state changes, retries failed writes at most three times per refresh cycle and replays the latest state after GLINK loss, including a coalesced down/up event. The keyboard thread performs no PMIC I/O.
  • Failed status or USB-online reads retain the last successful charger values while latest-read validity records the error. Unknown charger fields do not publish a disconnect or a stopped charge. A successful zero online reading still publishes a disconnect.
  • After a pause the GPU returns to the governor's floor (348 MHz) and the wake boost raises it at the first busy window; [gpu dcvs] boosts wake= and [gpu dcvs why] rests= count both.
  • package/GpuPowerProbe.cpp keeps every row the GPU power-up sets in order (native_gpu_row_log) with its stage, so a power-up that stops shows the step it stopped at.
  • thermal-level=1 publishes the service thermalmonitord reads its pressure level from (key mTPL, read once a second); the level follows the CPU and GPU trip points of the device tree with hysteresis and is nominal for an unreadable sensor. Not yet run on hardware.
  • thermal=1 adds [thermal] rows: the three TSENS controllers' sensors and, per CPU frequency domain, the temperature of the samples in which the firmware limited a busy domain (thermal-ms sets the period). board-clock=<bits> runs the calendar from the PMK8550 counter plus the offset at 0xbc of the second SDAM: 1 measures, 2 starts the calendar from it, 4 stores it when the system sets the time. Not yet run on hardware.
  • At rest under macOS two things kept the load up with nobody using the tablet: the GPU governor boosted to the top level about once a second, and the touch thread read every frame of the touch controller after the first touch. The governor now needs an 80 ms rest before it calls the GPU idle, and the touch thread returns the controller to doze after three seconds without a finger. Both are confirmed on hardware.
  • Under this kernel the charger firmware reports no USB input (online 0, 6 to 44 mV) although the bootloader charges on the same cable; the cause is not known. With log-power=1 the boot log shows the charger PMIC's own registers, and ucsi-delay=<seconds> holds the first UCSI command back for the diagnosis.
  • The ADSP firmware runs charging and PD/PPS negotiation without host requests.
  • Battery properties after 11 are shifted by one: charge current 12, temperature 13, charge counter 15, cycles 16, design 17, full 18, time to full 20, time to empty 21.
  • Charge is the sum of both fuel gauges' remaining over full capacity. Battery current is reported discharge-positive.
  • USB property 6 reads SDP on every port. Property 7 carries the adapter type (6 PD, 8 PD PPS).
  • A PPS adapter gets a 3 A input limit at about 8.7 V; the battery charges at the 2000 mA charge current with the charge pump off.
  • A Mac USB-C port negotiates PD 5 V with a 1.2 A input limit: about 1.1 A in, and the battery gains 0.25 to 0.4 A on the desktop.
  • Power policy belongs to the board even when controller operations are shared.
  • The GPU power probe hands the ring its register window without a GMU fence callback: only the GPU service checks fenced WPTR writes.
  • The CPU governor reads each CPU idle time through patches/xnu/zzye-sheng-cpu-idle.patch. Domain 0, the E cluster, scales with load like the other domains.
  • The GPU governor reads the GMU XO busy counter and votes over HFI with the level bandwidth.
  • A touch holds the P CPU domains and the GPU at their top level for cpufreq-boost-ms and gpu-dcvs-boost-ms (1000) after the last report. GPU submits in 2 of 4 windows keep every CPU domain at 60 percent of its top for 300 ms. A fence waiter sleeps up to gpu-pause-us (1000) and the fence interrupt wakes it.
  • The existing xnu-12377 migration uses kernel_target.TRIPLE and DEPLOYMENT for platform-power binding assembly and the deployment audit instead of a fixed iOS 17 target. This compilation-target change does not provide new 23F84 power or charging device evidence.
  • GpuPowerProbe retries AHB-fenced context-switch writes for up to 2 ms while keepalive is held. The governor records accepted frequency votes and, with gpu-perf=1 and diagnostic export enabled, samples 19 A7XX BR counters approximately every 32 ms with selector, reset and preemption validity.
  • package/WcnPower.h keeps independent Wi-Fi and Bluetooth votes over the six shared WCN supplies; the last owner releases them. scripts/check-wcn-power.py covers both startup orders, independent release, repeated votes and failed transitions.
  • ShengBattery routes GLINK owner 32779 to the UCSI client and passes the charger's USB online value to QcomDwc3.
  • Charging authentication and battery reads share the serialized battery-manager request queue; reconnects retire earlier replies.

Completion criteria

  • Declared power controls and battery readings match observations; each claimed sleep/resume transition restores its dependent peripherals.

Current limits

  • Charge current stays at 2 A without fuel gauge and adapter authentication.
  • A low-battery shutdown panics in vnode_rele_ext during unmount.
  • Per-peripheral controls and battery publication have separate coverage from system suspend.
  • The GPU governor changes level several times a second and spends most busy time at 680 MHz; its effect on frame times is not measured.

Next action

  • Measure PD/PPS and MiPPS input power, both charge pumps and battery temperature with the physical adapter and cable; compare the matching Linux and macOS captures.

Evidence

Image assembly

implemented

Components: DarwinBoot, XnuPrelink, SoftwareAES.

Hardware and dependencies

  • Prelinked kernel, hardware DTB, generated ADT, trust cache, Data seed, platform identity and firmware DTB.

Configuration

  • The 27 archive recipe builds the fileset comparison kernel with --lto; the reference builder validates its inputs and output digest before reuse.
  • The macOS desktop payload is a 256 MiB logical volume with a one-second Boot default. kernel.patch_series selects ARM64, SoC, OS and device series in order.

Procedure

  • Build kernel and package, then payload with --unique-chip-id and the selected trust-cache/Data inputs.
  • Run ./unixnu bootimg -D ../UniXNU-sheng --uefi ../uefi-sheng --dtb <firmware.dtb> and inspect the assembly report.

Development findings

  • The macOS release selects os:configs/macos.config and builds the complete board firmware transport from source. Standard package.sh uses the desktop boot arguments and preserved Data input.
  • restore-macos-images.py recovers OS, SystemOS and App from Android sparse userdata into the selected IPSW cache; each raw image must match its profile root digest.
  • The matched-toolchain startup comparison records Data disk initialization and an approximately 80-second watchdog return for current, GPU-reference and combined CPU/GPU-reference kernel builds. Persistent checkpoints identify completion of BSD initialization; the bootstrap and PID 1 call sites record the subsequent startup path.
  • Local kernel inputs include the Xcode 26.6 compiler, linker, resource directory, SDK and kernel tools. Cache relocation selects that toolchain for compile records and native component builds.
  • The timed boot runner uses a six-character build-tag beginning with s. cycle.json records the expected tag and whether the capture matches it.
  • The macOS lab restores cached XNU compile records, builds the source-matched Metal bridge, and supports a boot-only build with root_storage=false.
  • prepare-sheng-gpu-lab.py merges the current GPU bundle, signed arm64e acceptance tool, Vulkan loader, validation layer and lab scripts into a 256 MiB RAM payload while preserving the existing addon entries and owner trust bundle. make-userdata-full.py --zstd streams compressed root storage into a sparse image and fills the remaining userdata partition with zeros.
  • The packaged Metal priming list and per-image counts accompany the build artifacts. The list covers the three installed root windows and preserves library paths containing spaces.
  • prepare-macos-install.py creates a 210 GiB Data seed with Setup Assistant completed, a local administrator and automatic login. The username is unixnu and the password is supplied through UNIXNU_LAB_PASSWORD. It signs all three root-window policies and includes their hash tables in userdata.
  • The macOS desktop image uses autoreset=7200, uefi-watchdog=1 and diag-export=7140. Shader Cache is installed in Applications. The Linux log reader has an independent 300-second return timer.
  • run-sheng-unattended.sh bounds fastboot boot, image wait, log retrieval and final fastboot discovery. repack-sheng-boot.py changes XNU arguments or payload files and fits a header-v0 boot image to the measured partition capacity.
  • The boot image gains about 120 KiB of kernel text for the VPU driver and the VideoToolbox host. The host's encoder half is compiled out, since the board offers a decoder alone.
  • The built-in arguments of package/BootWatchdogPolicy.c carry the defaults a run may override on the command line (gpu-pool); the adoption of the low DRAM bank is on without an argument and memory-outside=0 turns it off.
  • A run's extra kernel arguments are placed before the board's on the command line, so autoreset and the log switches are parsed first.
  • macOS 27.3: with boot-payload-release=1 the kernel returns the GPU addon blob and the packed Data seed inside the boot image to the VM once they are installed (about 40 MiB); loader_inputs records where the payload RAM disk lies in the firmware's memory map (sysctl kern.boot_payload_memory). Not yet run on hardware.
  • The macOS 27.3 override of board.toml keeps the Bluetooth runtime tool with target macos27 and adds bluetooth=1 to the kernel arguments (864 bytes); the iPadOS settings are unchanged.
  • The iPadOS 27 kernel embeds the pinned keyboard controller image (82524 bytes).
  • The AppSync runtime applies native ad-hoc installation and FrontBoard trust to every user .app tree on Data. Rejected unsigned, fakesigned and expired bundles are repaired on device by the source-pinned ldid library inside installd, preserving entitlements, then revalidated. XNU registers validated CodeDirectory hashes on demand before AMFI checks, covering new apps, updates and nested code without per-app build inputs. Runtime hashes remain in the boot trust bundle; Data and original trust modules are preserved. Exec runs these apps without platform status. An unsigned arm64 app installs over USB, launches and stays installed across reboots; reports/ipados27-appsync.md describes the runtime.
  • Addon replacement sets va_data_size explicitly with va_mode after a successful write, removing stale tails when kernel vnode_open leaves an existing size. The host fixture reproduces and removes the observed 55-byte tail.
  • The cache-only export retains full plist bytes from the parser and filesystem; it is enabled by cache-log=1 and preserves the existing Data seed.
  • The 27 patch series includes the opt-in launchd cache-input diagnostic; payloads retain the panic screen with automatic reset disabled.
  • The next 24A446 device run passed the display branch but aborted in vfs_fsadd+0x364: APFS still referenced an old vnop_mknod descriptor address, which now held zone_array data (index 0xaaaaab). XnuPrelink now pins 13 missing vnode descriptors, four metaclass pointer slots, gIODTPHandleKey and audio_active by data identity and source consumers. A subsequent run mounted the OS root and SystemCryptex, then stopped because the payload omitted its Data seed. The payload now rejects CONFIG_XNU_OWNER_DATA_MOUNT without a seed; a persistent overlay also requires the original seed.
  • Fileset adapters contain N_ABS function branches without split-segment records. XnuPrelink now retargets them after placement and rejects destinations outside retained executable code. The final packed 24A446 kernel passes checks for 266 branches and five absolute data symbols; the scan covers 317146 branch-shaped words, with two source-confirmed inline constants.
  • The 2026-11-02 packaged 24A446 image panicked at corecrypto_kext_start: its kprintf import was rebound to unixnu_fileset_unmapped. The recipe omitted --lto and the reference builder accepted any existing output. Restore LTO and rebuild the reference and mapping; packaging success with --allow-missing does not establish boot compatibility.
  • The OS boot-progress integration follows the SoC hooks in patch order.
  • The payload carries kernel.macho.adt; the boot image carries the firmware FDT. Keep the two inputs named explicitly.
  • The device patch series adds zzyd-sheng-audio-addon-mount.patch: the payload addon's audio directory is union-mounted over /System/Library/Audio/Plug-Ins/HAL (mount4 in the A log line).
  • zzyf-sheng-amp.patch follows it: the AMP Edge scheduler for the E and P clusters (see the cpu area).
  • The selected xnu-12377 board series contains CPU-idle, AMP and audio-addon patches. The new source-driver archives are compile-audit outputs only and are not added to the minimal 23F84 boot payload.
  • scripts/package.sh is the shared packaging script of the device repositories (templates/package.sh in UniXNU) and holds no board value: board.toml [package] names the UniXNU checkout and the defconfig of each OS profile, and [os_overrides] holds the kernel, payload and component values of the 17 and 26 profiles. unixnu release --check lists 64 patches for 17, 75 for 26 and 78 for 27. scripts/package.sh --os 27 produces boot.img (185733120 bytes), payload.img (184549376 bytes) and kernel.macho (96354304 bytes) when --uefi and UNIXNU_UNIQUE_CHIP_ID are given. The firmware preflight runs scripts/fetch-sheng-dts.py, which builds the firmware device tree that board.toml [bootimg] dtb names, and scripts/check-sheng.py reads the firmware checkout from UNIXNU_UEFI. build-ath12k-wifi.py runs tools/fetch-sources.sh of Ath12kWifi first, which fetches the pinned Linux sources.
  • The bringup patch includes sys/proc.h at its exception record: the RELEASE-config fileset reference build compiles the same tree without the DEVELOPMENT block that carried the declaration.
  • The xnu-12377 board series includes optional latency hooks for IPC, user exceptions, fault registers and signal exit reasons. build-sheng-source-storage.py links BootLatencyTrace.c and includes its header hashes in the source identity.
  • The xnu-12377 board series drops the IPC, user-client, contiguous-allocation and latency-detail trace patches and includes zzzzzzzzz-sheng-unnest-trace.patch, a board hook in log_unnest_badness before its rate limit; the latency trace patch keeps only the user-fault hook.
  • The runtime merges the signed Wi-Fi service/cache and firmware into the Data addon, preserves stock launchd jobs and Data identity, and packages the bounded IEEE80211 association-event transport.
  • Bluetooth and Wi-Fi share one signed launchd cache. The builder preserves existing trust modules and the Data seed, adds the service hashes, and installs the capability library before the executable overlay. Verified firmware downloads are cached after their hash check.
  • The device series adds a patch that relaxes the disabled-signal assertion once sheng_sigp_recover has run.
  • On macos-27.3-26C5035r the touch and keyboard firmware images (0x5025c bytes) are placed in __DATA,__firmware. Neither the kernel's __TEXT nor its __DATA_CONST has room before the first retained kext segment of the macOS collection; native __DATA has 0x9c000 bytes free. __DATA,__const is renamed to __DATA_CONST by the XNU link.
  • The macOS closure (84 bundles) excludes AppleOnboardSerial and AppleSMC as on iPadOS and leaves out com.apple.kec.pthread, which the board builds from source. AMFI's __start does not register its policy; the profile names _amfi_register_mac_policy (0xfffffe0009840dd4) as early_security_init. Prelink reports 0 unresolved closure references and 0 stubbed functions.

Completion criteria

  • Kernel and prelink succeed, payload contains all declared inputs, and the boot image matches the bootloader format and size limit.

Current limits

  • Device logging confirms the reference/import repair passed corecrypto initialization and reached the native legacy-display constructor. The next failure exposed unrelocated absolute adapter branches. Hardware verifies the branch repair and vnode descriptor repair through OS/SystemCryptex mounting. The final collection still reports two unresolved data references and 24 trap references; later boot validation must be recorded separately.
  • Image output depends on the selected ABI audits, firmware and volume policy inputs.

Next action

  • Attach artifact paths and exact source revisions to the next image build record.

Evidence

Diagnostics

implemented

Hardware and dependencies

  • Serial or framebuffer diagnostics, panic region, boot checkpoints and a recovery path.

Configuration

  • boot-progress=2 enables checkpoints; source and image revisions accompany every log.
  • On the iPadOS 27 native source path, log=1 plus boot-ui-trace=1 starts a separate process-capture worker. boot-ui-focus3=chronod adds the display-query client to backboardd and SpringBoard on iOS, and WindowServer and Finder on macOS. Arm64e return-address PAC is stripped for diagnostic stacks.

Procedure

  • Run the existing check for the changed area and keep its command, output and input revision.
  • Record the last completed checkpoint and the first failing operation; link the captured output.

Development findings

  • prepare-macos-install.py resolves UniXNU through board.toml and uses the configured preserved Data seed. The CLI parser and installation argument parser have distinct names.
  • The icon probe reads System Settings sidebar entries and their extension bundle icon configurations, compares NSWorkspace and asynchronous IconServices requests, and records 24-point and 128-point source pixels. The lab captures System Settings events and the user icon service launchd state. The graphics comparison closes restored GUI applications, repeats the same settings panes beside the fixed animation, and captures two WindowServer process samples with background shader priming paused. Manual inspection opens General settings and captures four process samples while keeping the desktop active.
  • The macOS power callback logs installation, advertised PSCI operations and returned transition calls. A sheng shutdown capture completed Data unmount and driver quiescence before Halt/Restart Timed Out; registration addresses the absent platform callback.
  • storage-probe=1 writes synchronous startup checkpoints to the spare UFS log blocks. Separate rings retain the bootstrap and PID 1 paths through BSD initialization, bootstrap completion and launchd execution. Records include sequence, PID, thread, build tag, stage, counters, virtual timer, DAIF, pending interrupt and caller. The reader exports startup-checkpoints.txt and the latest startup-checkpoint.txt, filtered by the expected build tag.
  • The macOS lab exported 72721568 bytes through the Linux reader and returned to command-responsive fastboot. The clock probe records CNTFRQ, counter deltas and Darwin clock deltas around a one-second sleep.
  • cycle.json records acknowledgement, elapsed test and reader time, exit status and the final fastboot command response. The six-minute scene covers the 120-second export budget.
  • The lab agent clears Finder and System Settings saved-window state before priming, then runs the same numeric, paired-throughput and animation sequence after the current boot reports complete whole-system priming. The watchdog timeout is 30000 ms, with kernel pings every 10 s.
  • With diag=1 or gpu-trace=1, timing.log records per-encoder timings and command buffers taking at least 8 ms, bounded to 512 KiB. runtime-policy.log records actual device policy, float controls and runtime path checks, bounded to 256 KiB. Both files are exported from the system shader-cache directory.
  • The macOS process sampler targets WindowServer and Finder. Exported diagnostics include the macOS frame trace, build-specific priming checkpoints, lab logs and two screenshots. Bounded text captures retain their latest records.
  • kern.unixnu_diag_request requests one export when diag=1. kern.unixnu_diag_status reports pending, running, completed or an error; the root lab job waits for completion before rebooting.
  • The lab agent accepts a complete whole-system priming pass from the current boot before starting its fixed animation. Saved-window preferences disable restoration for subsequent controlled runs. Diagnostic export starts while the animation is active.
  • The reset timer uses the raw hardware counter and its frequency. Diagnostic Mach intervals use the macOS timebase; GPU hardware timestamps retain their own clock domain.
  • A Linux reader cycle on this device retrieved the existing macOS log and returned to fastboot using rebootbl. The reader accesses the reserved log blocks without mounting userdata.
  • Digitizer diagnostics retain the usage-page and usage properties while reading them; a host property-replacement fixture passed with ASan and UBSan.
  • The keyboard service retains failed frame interrupts for retry, limits each drain to 16 frames and reloads firmware after three communication failures with backoff. check-keyboard-service-host.py covers scheduling and check-keyboard-cover-host.py exercises the actual HID device against synchronous host stubs. These checks do not establish device recovery or charging behavior.
  • The hang check retains the CP snapshot taken before GPU recovery until the next hang. The [gpu stall] taken at hang row identifies it; far found and far base report candidate low-word matches in the stalled job command buffers. A new snapshot clears the old fault search. These diagnostics do not fix the fault. Metal batch-end trace field d reports encode-thread CPU microseconds, and TUC reports Turnip BO cache activity.
  • [video vt log] holds the VideoToolbox host's last 64 diagnostic lines, oldest first (a session's codec and size, its first frame's flags and output order, the capture layout, failed stages).
  • log-video=1 prints [video] (the VPU's state), [video vt] (the VideoToolbox transport and host: opens, messages, sessions, frames in and out, errors) and [video media] (the decoder device: sessions opened and closed, source changes, unsupported streams, firmware failures and the last error, buffers queued, pictures returned). A ring switch that timed out records CP_CONTEXT_SWITCH_CNTL and the two rings in its [gpu switch timeout] row.
  • [gpu dcvs why] rests= counts the pauses the governor saw; 0 over a run with pauses means every idle window was taken as work.
  • [gpu switch timeout] keeps the CP state (the [gpu stall] words and the ring progress words) of the first two ring switches the CP never finished.
  • [map met] follows [map fails]: what the last refused GPU mapping asked (address, bytes, 'again' where its handle was mapped already) and the mapping at or past that address. A kernel memory allocation that fails prints a kmem_alloc line in the message stream: size, flags, result, the free, reserved and wired page counts, the kernel map's bounds and its ranges. [memory outside] gives the pages the kernel adopted and left; [gpu bring-up] keeps the GPU probe's rows in the order they were set with its stage and the first failed kernel allocation; [touch cost] counts the touch thread's interrupts, wakes, reads and their time; [cmdline] shows what the kernel parses. autoreset marks the bootloader cell and arms the hypervisor watchdog as the first thing after the scheduler starts.
  • Every slot has a [cmdline] row: the length of the command line the kernel parses, whether autoreset parses, and its last 80 characters.
  • diag=1 keeps the normal board rows and the message stream and adds [diag msgs], the latency lines of the kernel messages new in each round. Every slot has [log round] (last, longest and slowest step of a round); a watch thread reports a round running over 10 s, and the panic flush names the step a round was in and marks a panic that left no text. New rows: [gpu jobs]/[gpu long]/[gpu slow], [gpu kick], [gpu pool views], [edge queued], [cs sha]. Not yet run on hardware.
  • macOS 27.3: gpu-bundle-system=1 (the Metal plugin only through a union over /System/Library/Extensions, /Library/GPUBundles covered) left WindowServer without a Metal device: IOGPU's trusted-bundle check refuses the plugin there, WindowServer aborted in WSSystemCanCompositeWithMetal (run64). It stays off.
  • With log-power=1 the boot log has a [pmic rtc] row: the PMK8550 real-time clock's control register and seconds counter, read only. The counter runs but is not wall time, and the system has no real-time clock service yet; the calendar starts one day before the kernel build date until the network time arrives.
  • The macOS 27.3 override of board.toml keeps the Bluetooth runtime tool with target macos27 and adds bluetooth=1 to the kernel arguments (864 bytes); the iPadOS settings are unchanged.
  • With log-power=1 the boot log has [pmic chg] rows: the charger PMIC's boost, charger, DC-DC, battery interface, USB input, Type-C and misc pages, registers 06 to 0d and 40 to 47, read through the arbiter's observer channel. The [fb centre] row prints the centre pixel of half-float frames in thousandths.
  • With boot-ui-trace=1 each boot log slot has a [kernel cpu] section: the CPU time of all kernel threads in the last 10 s and the eight threads that used the most, by name. On macOS 27.3 under memory pressure it showed VM_swapout and VM_cswap_trigger at 12 s of CPU per 10 s.
  • The boot log K row shows the keyboard cover stage, boot ROM states, frames, reports, attach and hall state, I2C failures and the HID device counters; scripts/check-wn8030-host.py tests the controller codec.
  • HidInputProbe logs [hid] digitizer usage pair published at +N ms each time it restores the pair.
  • The device cache-only export contains five files and confirms identical parser, system-path and Data-path bytes with the packed cache as an exact prefix plus 55 stale bytes. GENI retains failed IRQ status for bounded error reports.
  • A published parser-input snapshot triggers one cache-only export to the reserved diagnostic region. The export contains the immutable input, both fixed cache paths and the loader log, without starting GPU or latency capture.
  • The shared bypass register fixture covers UART14 joining the touch bank with 64-bit physical DMA addresses and preserves the touch stream.
  • A source implementation, a host check and a device observation establish different completion levels.
  • Keep an unresolved cause explicit and record the next measurement that can distinguish it.
  • The UFS log carries [adsp], [qrtr], [battery], [battery-raw] and [charger] lines for the DSP, the IPC router and the charger.
  • BatteryProbe starts the battery with adsp=2, so the [battery] and [charger] lines appear on every DSP image; a missing [battery] line on such an image means battery=0 or a failed start.
  • Host checks for the ADSP path: check-adsp-host.py, check-modem-fw-host.py, check-qrtr-host.py and check-battery-host.py.
  • The log carries [audio], [amps], [audio-glink], [audio-buffer], [mic] and [mic regs] for the audio path, and [gpu wptr] for fenced GPU write pointer writes.
  • GPU memory rows: [vm map], [vm unmap], [vm kinds] (time per owned map, fast and full import, unmap by page and by ASID) and [bo memory]. Governor rows: [cpu gov] with boost and frame-floor counts, [cpu throttle] and [gpu dcvs] with touch and wake boosts. [touch doze] counts the doze requests sent to the touch controller, the refused ones and the frames read after the last request. Display rows (dpu=2 or 3, dpu-scanout): [dpu vig0], [dpu vig1], [dpu ctl0], [swap surfaces], [direct scanout] and [dpu smmu].
  • The 23F84 branch lock and source-driver report describe different stages: unixnu.lock covers the selected minimal build, while reports/ipados26-source-drivers.json records separate public-family compile inputs, object hashes, warning counts and unresolved imports. Neither report qualifies source-driver device execution.
  • unixnu.lock records the sm8550 source at the same commit as feeds.toml; fetch rewrites it, so a hand edit and a fetch must agree.
  • scripts/check-sheng.py reads the firmware checkout from UNIXNU_UEFI, which the firmware step of unixnu sets for its preflight scripts.
  • The direct scanout log labels native_legacy_direct[12] as waits>=250ms. This counter records a slow GPU wait; direct display retries busy queries and keeps the current frame until completion or swap cancellation.
  • kernel.latency.bin pairs IPC send attempts and receive completions by message cookie, records user exception registers, accepted GPU frequency votes and touch coordinates, and exports a bounded LAT1 ring before filesystem logs. Events 61-63 expose encoding batch waits, frontend phases and render-thread identities; client samples mark the selected render thread with state 0x1000, and CPU process names follow xpcproxy exec. The exporter prioritizes the complete backboardd frames.trace before optional CPU reports; framework files, unified logs, shader inventories and images are excluded.
  • Detailed capture records slow encoding operations, callback and destructor identities, outgoing IPC/reply ports, blocked-thread user/kernel stacks and Mach service peers. Faults retain registers, bounded worker-read stacks and image UUIDs; signal exits include reason descriptions. gpu-perf=1 enables the 19-counter A7XX BR plan with selector, reset and preemption validity. The source-storage archive includes the latency capture object.
  • LAT1 separates 32768 fault/identity records from 491519 ordinary events and one coverage summary. IPC keeps traced requests, matching receives and tracked replies, with unmatched or ambiguous traffic counted. Tracking tables are allocated when capture starts and do not occupy linked kernel data. Pending display queries retain state changes, a 100 ms heartbeat and omitted counts. Idle runtime stages and duplicate generic IOKit/GPU/IPC streams are excluded before recording. Fast unannounced resource spans below 250 microseconds are omitted; paired callback spans remain. Dispatch task tracing uses the optional introspection SPI.
  • The latency capture keeps only seven-issue evidence: the backboardd frame trace, kernel GPU submission and display records, large GPU allocations, CPU occupancy and process CPU time, 4 ms samples of the render server's render, encode and completion threads and SpringBoard's main thread, blocked-thread waits, faults with exit reasons, shared-region unnests with kernel and user callers, and touch report times that bound the analysed windows. Mach message flow, user-client calls, contiguous allocations, per-contact touch records and dispatch points are not collected, and their xnu hooks are removed from the series. The export reads the sampler rings at their allocated sizes.
  • scripts/sheng-latency-report.py prints the acceptance figures of a capture inside touch windows: frame intervals, large allocations, full-screen pass times, slow completions, encode thread priority and run-queue share, client crashes and Metal refusal texts.
  • shots=<s> adds bursts of six quarter-resolution screenshots 50 ms apart, one burst every 10 s, as screen-<s>-<index>.bgrx; they are compared by code with a system memory reference tile by tile. With SHENG_GPU_TRACE the render server's Turnip sends its GMEM passes (36), transfers between tile memory and memory (37) and attachments (44) to the GPU trace, decoded by decode-gpu-trace.py.
  • Disabled GPU/display groups skip collection, formatting and register reads. Wi-Fi fixtures cover native control, association events, RX batching, DMA capacity, cache serialization and VFS firmware reads.
  • check-bluetooth-runtime.py validates the actual packed runtime, signatures, firmware, launchd jobs, preserved trust modules and Data seed. The bluetooth-runtime boot row records library and executable mount stages.
  • Cache-loader capture uses the log writer's relative boot time and requires cache-log=1. On a 24A446 launchd cache failure this flag also records the parser input length, head, trailer and complete FNV-1a hash through bounded copyin reads. Bluetooth allocation failures emit one cached selection row without rescanning MMIO.
  • The [usb] rows report QcomDwc3 state from native_usb_stats. The boot log allocates its large buffers at run time, including the 128 KiB message ring, because the kernel's __DATA has no room with the USB stacks prelinked.
  • UFS log version 5 writes per 2 s round only the used blocks of the text slot, the message-area blocks that new kernel messages reached, and the header. The message area is a ring of the message stream (msg_mode 1, msg_head bytes appended); the panic flush and diag=1 write the linear form (msg_mode 0). read-sheng-log.py decodes versions 1 to 5, and check-boot-log-host.py covers wrap, quiet rounds, a replaced kernel ring and a failed write.
  • The [data] DIO row reports Data disk requests (count, MiB, time, lock wait, longest), synchronize calls, the store window's UFS commands, the command slots (in use, peak, waits) and the root window reads with their transport and integrity check time.
  • package/linux-log/ufsbench.c is a static aarch64 Linux program without libc: O_DIRECT reads of a fixed-seed sequence of offsets at queue depths of forked processes, one line per test with IOPS, MB/s, mean, p50, p99 and longest latency.
  • The [gpu vm fail] row reports GPU address spaces taken out of use (count, the last one's status, the source line of the check in NativeAdrenoVm.cpp and whether it was a process's), and [gpu global fault] the SMMU's global fault status seen by such a check and cleared at a recovery. The [video fw] and [video fw error] rows hold the video firmware's messages with log-video=1.
  • The [gpu stall] ib2 row reports the search of a stalled job's IB1s for the IB2 address the GPU thread stopped in: how many CP_INDIRECT_BUFFER packets name it, the first one's IB1, offset and words, and how much was read.
  • The persistent boot log records App Cryptex mount stage/status and HCI discovery commands (sent, replies, status), with classic, legacy LE and extended LE report counts. The counters distinguish an absent scan request, controller refusal and received reports; they do not establish radio discovery by themselves.

Completion criteria

  • Each claimed milestone has a reproducible command, a matching source/image revision and an accessible result.

Current limits

  • Source references in this record describe implemented behavior. Host and device status require their respective evidence entries.

Next action

  • Add captured host or device evidence when repeating a checkpoint on a known image.

Evidence

arm64e-os

planned

Hardware and dependencies

  • iPadOS 26.5.2 build 23F84 IPSW for iPad17,1 to iPad17,4; target identity iPad17,3 J820AP.
  • Public XNU source xnu-12377.121.6; arm64e profile requirements in https://unixnu.com/porting/arm64e.

Configuration

  • board.os_profile = ipados-26.5.2-23F84 with [os] arch = "arm64e"; kernel defconfig sheng_ipados26_defconfig selects the full sheng component set; the xnu-12377 patch series is split into arch, SoC, OS and device layers.
  • Payload kernel arguments: -v serial=3 debug=0x14e kt_fixed_zones=120 -no_slto_panic; no install menu.
  • The arm64e build uses the BCM2837 machine config restored for xnu-12377, the non-SPTM pmap and no Apple CPU counters.

Procedure

  • Check FEAT_PAuth, EL1 key register writes and PAC instruction behavior on all eight CPUs.
  • Build the arm64e kernel from xnu-12377.121.6 with the ported 4 KiB patches, then prelink the 23F84 kexts.
  • Follow the bring-up order: arm_init, bsd_init, root mount, launchd, SpringBoard.

Development findings

  • On sheng, macOS 27.3 build 26C5035r booted and automatically logged into the unixnu admin account with UID 501.
  • The xnu-12377 device series gained vmwait-dyld-pager-source-release.patch (the dyld pager held its source page busy while it faulted the other three 4 KiB parts of a 16 KiB fixup page; APFS verified page-in then waited for the thread's own page, and on macOS every later private mapping of the file waited too) and zzzzzzzzzzz-sheng-edge-matrix.patch (a two-cluster Edge matrix the scheduler accepts). Not yet run on hardware.
  • On macOS 27.3 the software AES accelerator is compiled against the 26C5035r class layout and started by its board probe; AppleImage4 finds it at boot.
  • The series ends with sheng-appsync-runtime.patch and sheng-appsync-user-trust.patch. appsync=0 disables their mounts and registration; trust_cache_rt_storage stays writable in either case.
  • After load_machfile, exec clears the platform status of an appsync user .app main executable, so the app runs without platform restrictions, the hardened IPC policy or the platform-only mapping rule.
  • The shared region slider and the dyld pager use the upstream per-process jop_key checks, so arm64 processes (key 0) get unsigned pointers; the arm64e profile runs arm64 processes at EL0 with the PAC keys off.
  • The matched 24A446 failure frame publishes a bounded 4 MiB copyin snapshot through a weak board callback before process teardown.
  • The 24A446 cache failure diagnostic uses the selected launchd frame layout and bounded copyin reads to record parser input under cache-log=1.
  • The 23F84 kernelcache is xnu-12377.122.8; xnu-12377.121.6 is the closest public source.
  • SM8550 CPUs implement FEAT_PAuth; signatures are created on the device, so the PAC algorithm need not match Apple's.
  • Public XNU programs PAC keys only for VMAPPLE through HVC; the arm64e profile provides native key programming.
  • The 23F84 dyld cache is arm64e and contains SME code; SM8550 has no SME.
  • The arm64e xnu-12377.121.6 kernel compiles and links as MH_EXECUTE with chained fixups.
  • The 23F84 kernelcache is an MH_FILESET with stripped symbol tables; kext code branches directly into the kernel, so the prelink step for iPadOS 17 does not apply.
  • The bringup patch includes sys/proc.h at its exception record: the RELEASE-config fileset reference build compiles the same tree without the DEVELOPMENT block that carried proc_pid's declaration.
  • The shared xnu-12377 device series carries latency, fault-detail and signal-exit hooks backed by BootLatencyTrace.c. The capture is enabled by diagnostic export; qualification of another OS profile requires its own build and device evidence.
  • The iPadOS 27 kernel keeps the board user-fault and exit hooks and adds the shared-region unnest hook; the IPC send/receive, user-client call and contiguous-allocation hooks are no longer patched in.
  • The selected device series supplies the launchd cache/executable overlays and the bounded 540-byte IEEE80211 association event transport for 24A446.
  • The 24A446 Bluetooth runtime patch compiles with the target kern_exec command. The signed native daemon retains its identifier and all original entitlements; the platform service carries typed properties for native transport selection.
  • The device series relaxes the disabled-signal assertion in processor_cpu_reinit once sheng_sigp_recover has run.
  • The macOS patch series includes bootstrap, headless-startup, process-exit and BSD checkpoints used by the local kernel build.

Completion criteria

  • The arm64e kernel reaches launchd on sheng from the 23F84 root volume, then SpringBoard.

Current limits

  • Facts: only the boot core has a recorded PAC check; the other seven cores are unmeasured.
  • Facts: no fileset prelink output exists yet, so the kernel has not booted.
  • Facts: the storage, AES, HID, platform power, Adreno and GOP binding archives use original kext addresses recorded from the iPadOS 17 kernelcache; the iPadOS 26 kernelcache has no symbols for them.
  • Guess: the SME functions are selected at run time from hw.optional and commpage features; this is unconfirmed.

Next action

  • Produce a fileset kernel collection from the native kernel and the selected 23F84 kexts.
  • Read ID_AA64ISAR1_EL1 and ID_AA64ISAR2_EL1 on all eight CPUs and run a PACIA and AUTIA round trip on each.

Evidence

video

implemented

Components: QcomIris.

Hardware and dependencies

  • VPU firmware qcom/sm8550/sheng/vpu30_4v.mbn of proprietary-files.txt.
  • Linux iris sources at the revision drivers/QcomIris/tools/source-lock.json pins, for the buffer calculator and the HFI definitions; the 10-bit output and reference picture sizes follow the current mainline iris driver.
  • The VideoToolbox paravirtualization host and transport of the UniXNU board family (BSD-2-Clause-Patent), adapted to this board's decoder device.

Configuration

  • The VPU is iris at 0xaa00000 with its own SMMU domain; the SoC kit supplies the video clock controller and the apps SMMU domain.
  • VideoToolbox finds AppleVideoToolboxParavirtualizationDriver and sends its decoder sessions to the kernel host (drivers/QcomIris/kernel/VtHost.cpp), which decodes on the iris decoder device (IrisMedia.cpp), a stateful V4L2-shaped interface over the iris session.
  • 8-bit streams decode to NV12 and 10-bit streams to P010, into the player's pixel buffers where their layout fits and into the host's own buffers otherwise.

Procedure

  • Run sh drivers/QcomIris/tools/check.sh (the iris core, session, SMMU and decoder device host tests) and python3 scripts/check-video-platform.py.
  • Build the image, boot with log-video=1 and play H.264 and HEVC clips; read [video], [video vt] and [video media].

Development findings

  • On macOS 27.3 the VPU powers on, loads its firmware and decodes H.264: a 1280x720 clip of 60 frames returned 60 pictures through VideoToolbox.
  • HEVC decodes: a 3840x2160 10-bit stream (the aerial wallpaper) plays on the desktop. Three things were needed to start a session. The coded size is kept rounded up to the codec's block (32 for HEVC, 16 for H.264) as the firmware is told it, because the firmware sizes its internal buffers from that size and refused a co-located motion vector buffer sized for 2160 lines. The HEVC persist buffer holds 768 bytes of three-dimension user data for each of its 32 pictures, as the firmware's own driver sizes it. The partial data buffer is queued for no codec the decoder lists (the firmware names it AV1 only). vt-hevc=0 leaves the HEVC decoder unlisted.
  • The decoder gives its pictures in decode order, each as soon as it is decoded, as the host VideoToolbox expects: the display delay controls (enabled, delay 0) set the firmware property HFI_PROP_DECODE_ORDER_OUTPUT (0x0300015b, a u32 on the bitstream port; the number is entry 0x5b of the firmware decoder's property table, which the pinned iris header does not name). In display order the firmware held pictures back until an idle drain, the host handed them over after the wallpaper extension had let its session go, and VideoToolbox's guest decoder aborted in the extension (it takes its lock again when the last picture's handler releases the session). vt-order=0 keeps display order.
  • The boot log keeps the VideoToolbox host's last 64 diagnostic lines ([video vt log]).
  • The VPU reads and writes memory past the CPU's caches: the decoder device flushes a bitstream before it is queued and new picture memory when it is first mapped, and the host flushes a picture buffer before it reads it.
  • A 10-bit stream's reference pictures are sized as QC10C and its output as P010, as mainline does; the 10-bit 4K stream decodes on hardware. The pictures' colours have not been compared with a reference yet.
  • With log-video=1 the firmware is told a debug level at init (errors, fatal and high messages; it writes none otherwise), and the boot log keeps its last four messages ([video fw]) and its error messages in full ([video fw error], without its version lines).
  • The VPU's buffers are pageable memory that prepare() wires. A 4K session needs 150 to 440 MiB of internal buffers (50 MiB bitstream bin, 33 MiB of motion vectors per four pictures, 12.6 or 16.8 MiB per reference picture); the system runs with tens of MiB free, a wired kernel allocation is refused at once there, and wiring waits for pages. The [video alloc] row shows a refused buffer (pages, step, result) and the physical address bits the VPU's table reaches (36). A start failure reaches the client with the session's own error number, which the last word of [video media] shows.
  • HEVC decoder configuration retains complete parameter-set NAL units; reduced frame delivery is selected explicitly.

Completion criteria

  • H.264 and HEVC, 8 and 10 bits, decode on hardware; the aerial wallpaper plays from the HEVC decoder.

Current limits

  • No encoder is offered.
  • The pictures' colours have not been compared with a reference.

Next action

  • Compare decoded 10-bit pictures with a reference decoder.

Evidence