OnePlus 8T (yecw)
OnePlus 8T (KB2000). Firmware, menu, payload volume and DarwinBoot are device-verified: the menu renders, the keys work, the hand-off reports EL1, 4 KiB granule support and a successful ExitBootServices, and the entry probe paints its green, blue and magenta bands. The kernel then stops inside PE_create_console, before PE_init_printf and machine_startup; stubbing the console out does not move the stop. The PMGR bridge is linked (XNU_SHENG_PMGR), the panic log region is compiled in (XNU_DT_PANIC_REGION) and the panic screen can draw from a retained boot video record filled in machine_startup. The next diagnostic is the official boot progress hooks, whose ramoops zone matches this board live DTB.
源记录: porting.toml, 84631897b0b1805ebbfa56c78cab823705e93e6a.
本页按设备记录自动生成。
| 部分 | 状态 |
|---|---|
| 配置 | implemented |
| 固件与启动 | device-verified |
| CPU 与中断 | implemented |
| 内存与 DMA | implemented |
| 存储与根卷 | implemented |
| 显示 | device-verified |
| 输入 | device-verified |
| GPU | planned |
| 网络 | planned |
| 音频 | planned |
| 电源 | planned |
| 镜像组装 | device-verified |
| 诊断 | device-verified |
配置
implemented
组件: ArmDTPlatform, ArmCpu, SoftwareAES, XnuPrelink, DarwinBoot.
硬件与依赖
- UniXNU format 1 device repository (old-fw branch)
- UniXNU-sm8250-common SoC feed pinned in feeds.toml
- iPad7,1 17.7.11 21H461 donor IPSW
配置
- board.toml schema_version = 1 (old-fw branch)
- components include ArmDTPlatform, ArmCpu, SoftwareAES, XnuPrelink and DarwinBoot
- kernel.prelink slide -0x1000000 against kernelcache f18b4df865405f2a287b84977d7aca745e056d656d9fc9df1662970ce2969de7
- kernel archives add build-arm-driver.py ArmDTPlatform and ArmCpu
- kebab_defconfig selects XNU_SHENG_PMGR and XNU_DT_PANIC_REGION
- kernel patch series adds 10063-kebab-panic-vinfo and 10063-kebab-fb-aperture
- archives add build-platform-power.py and package/ShengPlatformPower.cpp supplies the original PMGR bridge
操作步骤
- Clone UniXNU, UniXNU-kebab and UniXNU-sm8250-common as siblings
- Run ./unixnu fetch and ./unixnu defconfig kebab_defconfig
- ./unixnu status --json reports the resolved pins
开发经验
- The format 2 builder exports an arm-io child only for device tree nodes that carry a unixnu,adt-name property, so an untagged tree yields an empty arm-io and the kernel has no interrupt controller.
- The boot image has to use the phone own device tree; the tree shipped with Mu-Silicium lacks cont_splash_region@9c000000 and ABL then keeps the panel dark.
- Two inputs are not in any repository and must be captured per handset: the live device tree from /sys/firmware/fdt and the kernel built on a macOS runner. proprietary-files.txt names both with their hashes and consumers.
- Every change to a file an area owns has to update that area findings or evidence in the same commit; the catalog workflow fails otherwise and names the path.
- The device summary is what the generated page shows first, so it has to name the current stage rather than the first blocker found.
- The README status table names the 2026-11-03 bsd_init/root-wait state and links docs/bring-up.md.
- The shared ADT generator gained platform_node() for nested [adt.*] nodes and reads unixnu,cluster-type (E or P) from a cpu node, so kebab's 1+3+4 clusters can be described without a device-side patch.
- The ADT generator emits a plain phandle property, while IOKit registers and looks up AAPL,phandle. Until the generator maps one to the other, no device tree node is reachable by phandle inside XNU.
完成条件
- Every source pin resolves and the selected components have records; unixnu status reports the intended overrides.
当前范围
- No device-side repository record was published before this file; the entries below are the first complete record.
下一步
- Use the full QEMU device build once the Linux toolchain is ready, or fix the raw QEMU fixture boot_args window; the kernel entry and arm_init stack are valid, and the remaining fault is in the __BOOTDATA/early-bootstrap path. UFS and IOFindBSDRoot are downstream.
证据
source: Format 2 board description with the SM8250 SoC feed and the five components above.source: Thirteen areas with measured facts; python3 scripts/porting-record.py check --device ../UniXNU-kebab passes.
固件与启动
device-verified
组件: DarwinBoot.
硬件与依赖
- Mu-Silicium Platforms/OnePlus/kebabPkg
- Phone's own live device tree as the boot image DTB
- boot_a, 96 MiB, header v2 with 4096-byte pages
配置
- FD_BASE 0x9FC00000, FD_SIZE 0x4600000 (3 MiB firmware volume plus a raw payload region at 0x00300000)
- UFSDxe removed from DXE.inc; SEC disables the APSS watchdog at 0x17C10008
- ScmDxeLA and SdccDxe are included; TzDxeLA is commented out
- Framebuffer PCDs 1080x2400x32
- unixnu bootimg passes the live DTB; ABL refuses images without the splash region node
操作步骤
- Build firmware with ./unixnu build firmware -D ../UniXNU-kebab --uefi <Mu-Silicium>
- ./unixnu bootimg -D ../UniXNU-kebab --uefi <Mu-Silicium> --fd <SILICIUM_UEFI.fd> --dtb <live.dtb> --ramdisk none
- fastboot flash boot_a <image>; fastboot reboot
开发经验
- ABL hands the framebuffer over only when the boot image carries the phone's own device tree; the tree shipped with Mu-Silicium has no cont_splash_region@9c000000 and the panel stays black.
- A payload file inside the firmware volume is impossible: the FFS size field is 24 bits, so the 64 MiB payload is a raw FDF region instead.
- FrameBufferSerialPortLib handled newline and carriage return but ignored form feed, so DarwinBoot's clear screen did nothing and the left half of every log line was cut off.
- The payload builder injects the nodes XNU looks up by property (gic with interrupt-controller master, a one-cell redistributor stride, virtual-timer-intid, a timer node, pram and the panic log size); without them the kernel stops before PE_init_platform returns.
- KebabBootLog reads the 32 checkpoint bytes at 0xB9000010, prints the set list and clears the flags; CacheMaintenanceLib flushes the clear.
- The current firmware has SCM and SDCC but no UFS block device: UFSDxe is removed for the vendor assert, TzDxeLA is disabled and SdccDxe does not replace UFS.
- DarwinBootVideoFromGop passes the GOP frame buffer as a plain physical address; XNU only maps it when bit 0 marks it physical, so DarwinBoot now sets Args->Video[0] |= 1.
完成条件
- Firmware boots from boot_a, the menu is rendered on the panel, the keys navigate it and the log is readable.
当前范围
- USB is not brought up in the firmware; the only log transport is the panel.
下一步
- Publish a firmware image revision alongside each kernel change.
证据
device: UniXNU menu on the KB2000 panel listing the payload entry, keys working, full firmware and DarwinBoot log readable. Command:fastboot flash boot_a out/darwin-boot.img; fastboot reboot. Revision:97f6fea12dae49a1bbc30ccd22c098b82b97dbe4.
CPU 与中断
implemented
组件: ArmCpu.
硬件与依赖
- Eight cores at MPIDR affinities 0x000 through 0x700
- PSCI method smc
- 19.2 MHz timebase
配置
- cpus node with one cpu per affinity and state running/waiting
- timebase-frequency 0x124f800
- arm-io/gic interrupt-controller master, virtual-timer-intid 27
- PE_init_platform hands the console a phystokv() aperture address (patches/xnu/10063-kebab-fb-aperture.patch) so initialize_screen() does not call ml_io_map_unmappable
- kernel args -v debug=0x14e armcpu-self-ipi=1 armcpu-spi-ipi=1 armcpu-diagnostics=1 sheng-pmgr=2
操作步骤
- Install the kernel entry probe with entry_probe_reset_delay and a symbol to bisect
- Read the stage bars: blue is kernel entry with the MMU off, magenta is just before the MMU is on
- A reboot six seconds after the bars proves the probe point was reached
- Run scripts/patch-xnu-log-probe.py on a private kernel copy, build the payload and read the 32 flags in KebabBootLog
开发经验
- The kernel is entered and enables the MMU once ExitBootServices is allowed to finish; the timed reset after the MMU enable proves it.
- With PE_create_console replaced by a ret, the kernel completes PE_init_printf, PE_init_cpu, machine_conf, vm_mem_bootstrap, console_init, sched_init and kernel_thread_create, and reaches the bootstrap thread with its first context switch.
- _machine_startup is four instructions and tail-branches into _kernel_bootstrap, so a probe placed after that call can never fire; earlier readings of it measured nothing.
- _arm_init calls PE_init_platform twice and kernel_startup_initialize_upto is called once per init stage, so a probe needs entry_probe_reset_occurrence when the call appears more than once.
- The kernel clears the screen when it creates the console, so a black panel after the stage bars does not mean the kernel died.
- The kernel removes its identity map in arm_vm_init and the physical aperture starts at gPhysBase. The ring is below both window configurations' kernel base, so the stub uses ml_phys_write_byte, which maps the unmanaged page through the uncached CPU copy window instead of phystokv.
- A call-site stub can save x0-x8 and LR, call ml_phys_write_byte, restore and tail-call the original callee, so arguments and return address are unchanged.
- The 32 calls between PE_init_iokit and the first bsd_init locks name the gap: the last set byte is the call entered, and the next unset byte is the callee that did not return.
- The 4 GiB window loads the kernel at physical 0x20007C000 (base A, measured by a temporary DarwinBoot colour band). A one-stub BSS write at 0x7B281B0, dc cvac and PSCI reset reboots, but the next reader still sees no prefix, so normal DRAM does not carry the flag across the reset; pram 0x17F00FE0 is the persistent page.
- The 2026-10-29 checkpoints reach IOLibInit, OSlibkernInit, IOMachPortInitialize, the OSSymbol interners, OSSet::withObjects, interruptAccountingInit and the IOPlatformExpertDevice allocation on the boot CPU.
- cpus=1, and ret patches on ml_wait_max_cpus, kperf_init_early and platform_stall_panic_or_spin, do not move the PE_init_iokit stall.
- PE_create_console() runs before machine_startup() in _arm_init, so a probe at _machine_conf or a marker in machine_startup can never fire; the order is arm_vm_init, serial_init, PE_create_console, PE_init_printf, cpu_machine_idle_init, the second PE_init_platform, machine_startup.
- initialize_screen() treats a frame buffer base as virtual unless bit 0 marks it physical (kernel_map is already up); DarwinBoot now sets Args->Video[0] |= 1 and the entry probe masks the bit before drawing, because an odd base faults on the first store with the MMU off.
- With PE_create_console() stubbed to return, the kernel still does not reach machine_startup: the next candidates are the printf path that PE_init_printf installs (dump_kva_space is the first heavy caller in DEBUG) and the second PE_init_platform.
完成条件
- Every enabled CPU reaches its entry checkpoint and timer and IPI handling works on each enabled CPU.
当前范围
- Only the boot CPU runs; secondary cores are not started and _machine_conf does not complete.
- The kernel stops inside PE_create_console before PE_init_printf, with or without the physical-bit and aperture changes.
下一步
- Confirm the pram one-stub at 0x17F00FE0 (out/prammap-boot.img), then move the 32 checkpoint bytes from the ring to pram and read last/next in KebabBootLog.
- Stub dump_kva_space and add colour-band checkpoints after PE_init_printf and around the second PE_init_platform instead of panic probes, which park while vinfo is empty.
证据
device: Reboot six seconds after the stage bars with the probe after the MMU enable; no reboot with the probe after _machine_conf, so the kernel reached _machine_startup and stopped inside it. Command:flash the reset-probe image and observe the panel. Revision:97f6fea12dae49a1bbc30ccd22c098b82b97dbe4.source: Resolves 32 call sites, verifies every original bl, places 80-byte stubs in __TEXT_EXEC padding and checks each branch.
内存与 DMA
implemented
组件: ArmDTPlatform.
硬件与依赖
- DRAM banks 0x80000000+0x39900000, 0xC0000000+0xC0000000 and 0x200000000+0x200000000
- DarwinBoot window request of 3 GiB
配置
- dram-base, dram-size and darwinboot-memory-size all 0xC0000000
- /memory node in dts/kebab.dts restricted to the 0xC0000000 window
- DarwinBoot skips conventional-memory runs below 0x40000000
操作步骤
- Build the payload so the generated ADT carries the window, then boot and read the DarwinBoot log line with the kernel virtual and physical base
开发经验
- The kernel first-fit allocated at 0x7D000 and faulted during relocation; loading above 0x40000000 moved it to DRAM.
- A 256 MiB window leaves too little room in arm_vm_init's early I/O page-table reservation for the 0x2300000-byte framebuffer region; only after the window became 3 GiB did the kernel reach the MMU enable and _machine_startup.
- The physical aperture starts at gPhysBase and maps upward, so the 0xB9000000 ring has no phystokv mapping. ml_phys_write_data falls back to the uncached CPU copy window for this unmanaged page, which is how the stage-1 stub writes it.
- The 4 GiB test window put the kernel physical base at 0x20007C000, measured by a temporary DarwinBoot colour band; the 3 GiB build's 0xC007C000 is not the current local base.
- Normal DRAM does not carry the checkpoint flags across the reset: the 0xB9000010 ring, 0xC0001000/0x200001000 and a real __DATA BSS page all lose the byte after a reboot. The pram page at 0x17F00FE0 is the reset-persistent page; UEFI must map it before it can read the flags.
- The ADT handed to the kernel is 13980 bytes with 21 nodes, 122 properties and maximum depth two, so a tree that small cannot make a walk loop; a stall inside IODeviceTreeAlloc would be a lock or a fault.
- SecureDTIsLockedDown() is false because the ADT sits physically after the kernel, so arm_vm_prot_init does not treat it as EXTRADATA; the tree stays mapped through the boot_args window up to topOfKernelData.
完成条件
- All handoff regions are accounted for and each enabled DMA engine uses the documented cache policy.
当前范围
- Only 3 GiB of the 12 GiB is handed to the kernel; no DMA or SMMU work is done yet.
下一步
- Widen the window or describe all three banks once the platform expert completes.
证据
device: DarwinBoot reports the kernel at physical 0xC007C000 inside the 3 GiB window, and the kernel reaches the MMU enable. Command:flash the entry-probe image and read the DarwinBoot physical base line. Revision:97f6fea12dae49a1bbc30ccd22c098b82b97dbe4.
存储与根卷
implemented
硬件与依赖
- UFS host controller 0x1D84000
- root /kebab-ufs ADT node reg <0x01d84000 0x30000>
- userdata GPT partition on LUN 0
配置
- BSD bdevsw driver bsd/dev/kebab_ufs.c added through bsd/conf/files; no IOKit IOBlockStorageDevice or VerifiedRoot
- boot args rd=ufsroot0 ufsroot=userdata rootrw=0
- read-only unless ufsrw=1
- polled UFSHCI legacy transfer list, one physically contiguous DMA allocation, 512-byte BSD sectors over 4 KiB device blocks
操作步骤
- Apply patches/xnu/kebab-ufs-10063.patch and add /kebab-ufs with reg <0x01d84000 0x30000> to the ADT
- Build payload/firmware and flash boot_a
- Read the KEBAB UFS and BSD root colour markers in the framebuffer logger
开发经验
- The BSD UFS driver compiles and links; kebab_ufs_rootdev is present in the kernel image and the ADT carries the absolute controller window.
- GFander's source-level GICv3 path (HAS_GIC_V3, pe_fiq Group-1 setup, sleh_irq Group-1 dispatch) is ported as patches/xnu/10063-kebab-gic-vtimer.patch and builds in CI.
- The source-GIC hardware images srcgic5/srcgic6 show only cyan/blue/magenta bars and no text; the standalone framebuffer logger maps PE_state.video and hooks _kprintf, so this is a console/panic transport gap, not the old binary-stub scratch dependency.
- On the binary-GIC path, retting platform_stall_panic_or_spin, mac_policy_initmach and PE_lockdown_iokit reaches bsd_init and the late kernel_bootstrap chain (band 14); the no-early control kernel confirms it.
- Probe stubs placed at call sites inside bsd_init (kminit, IOKitBSDInit, loopattach, net_init_run, inittodr, IOFindBSDRoot, kebab_ufs_rootdev) stop the new kernel around the GIC bands, while a single probe on the bsd_init call itself works; the framebuffer text logger is also silent on the new kernel.
- Source-level band markers (10063-kebab-bsd-markers.patch, hardcoded GOP base, bands 10-13 at bsd_init start, kauth_init, proc_ro_alloc and setconf) are built in CI run 41861722320 to locate the bsd_init stop without probe stubs.
- ufsprobe2 was flashed; the IOFindBSDRoot -> kebab_ufs_rootdev probe never appeared, so IOFindBSDRoot is not reached yet.
完成条件
- IOFindBSDRoot selects ufsroot0 and the root APFS volume mounts read-only from the userdata partition.
当前范围
- No UFS hardware result yet; the UFS host, PHY, clocks and IOMMU state are owned by the firmware and no UART is attached.
下一步
- Read the band 10-13 markers from CI run 41861722320 to locate the bsd_init stop; then route the root path around it and retest rd=ufsroot0.
证据
source: Adds bsd/dev/kebab_ufs.c, the bsd/conf/files entry and the rd=ufsroot0 hook in IOFindBSDRoot.device: Early kernel log appears, but the last line is the btlog vm-tag warning and no bsd_init/IOFindBSDRoot/KEBAB UFS marker appears. Command:flash the old-fw kernel with GIC/FB/bring-up and rd=ufsroot0. Revision:fab2f0f31aa13fa3a86579611c5df8b5e93c174a.
显示
device-verified
组件: ArmDTPlatform.
硬件与依赖
- Samsung AMB655X panel oplus20828samsung_amb655x_1080_2400_cmd
- Framebuffer base 0x9C000000, 1080x2400, row 4320 bytes, 32 bpp
配置
- PcdFrameBufferWidth 1080, PcdFrameBufferHeight 2400, PcdFrameBufferColorDepth 32
- DarwinEnter paints the hand-off band from the GOP base and flushes it from the data cache
操作步骤
- Read the DarwinBoot video line, then confirm the panel shows text at the expected coordinates
开发经验
- The stride used while drawing a glyph row must remain (FB_WIDTH - FONT_WIDTH * FontScale) * FB_BPP; using a full scanline there shears every glyph.
- The framebuffer is a DSC command-mode panel; the firmware console renders correctly with the inherited GOP.
- PE_create_console blocks in ml_io_map_wcomb while it maps the framebuffer, so the bring-up kernel replaces it with a ret; vcattach and vc_progress_initialize block on the same mapping and are patched the same way.
- initialize_screen is the next call after PE_init_iokit in kernel_bootstrap_thread; it reaches the same framebuffer mapping that blocks PE_create_console, so it is the next checkpoint.
- initialize_screen() maps a physical v_baseAddr with ml_io_map_unmappable(); that call is where the console stops on this board. Marking the address physical (bit 0) or handing it phystokv() of the aperture does not move the stop, so the block is inside console creation rather than the address form.
- The XNU video console convention is "virtual address unless b0 set", so DarwinBoot must mark the GOP frame buffer physical in Args->Video[0].
完成条件
- The kernel presents the boot logo and later the SpringBoard frame through the controller or GOP.
当前范围
- Only the firmware text console is verified; the kernel has no display driver, so kernel output is limited to the entry probe bands.
下一步
- Add a kernel-side framebuffer console or the native display driver once _machine_conf completes.
证据
device: Menu, firmware log and DarwinBoot log render at 1080x2400 with correct geometry. Command:boot the firmware and read the panel. Revision:97f6fea12dae49a1bbc30ccd22c098b82b97dbe4.
输入
device-verified
硬件与依赖
- Synaptics S3908 touch controller on i2c 0xa94000, address 0x4B, reset GPIO 38, IRQ GPIO 39
- Power and volume keys
配置
- Volume and power keys drive the UniXNU menu
操作步骤
- Move the selection with the volume keys and confirm with the power key
开发经验
- The keys navigate the menu and start the payload, which is enough to drive the bring-up without touch.
完成条件
- Touch reports contacts under the kernel and the menu is usable without the physical keys.
当前范围
- Only the UEFI key path is verified; touch has no driver in firmware or kernel.
下一步
- Port the S3908 driver once the kernel reaches the driver-matching stage.
证据
device: Menu selection and confirmation work with the physical keys. Command:boot the firmware and press volume and power. Revision:97f6fea12dae49a1bbc30ccd22c098b82b97dbe4.
GPU
planned
硬件与依赖
- Adreno 650 with GMU firmware from the phone's own Android partitions
配置
- No GPU driver is built or loaded
操作步骤
- Not started
开发经验
- No GPU work has been attempted; the bring-up stops before IOKit matching.
完成条件
- A Metal or OpenGL ES surface is presented through the available scanout path.
当前范围
- No GPU firmware is collected and no driver component exists.
下一步
- Collect the Adreno firmware after the platform expert completes.
证据
按下一步操作收集证据。
网络
planned
硬件与依赖
- WCN6855 Wi-Fi and Bluetooth combo
配置
- No network driver is built or loaded
操作步骤
- Not started
开发经验
- No network work has been attempted.
完成条件
- Association, DHCP and packet transfer work under the kernel.
当前范围
- Firmware, calibration data and driver are all missing.
下一步
- Defer until userspace starts.
证据
按下一步操作收集证据。
音频
planned
硬件与依赖
- WCD9385 codec and the ADSP firmware
配置
- No audio driver is built or loaded
操作步骤
- Not started
开发经验
- No audio work has been attempted.
完成条件
- Playback and capture work through the DSP.
当前范围
- DSP firmware and driver are missing.
下一步
- Defer until userspace starts.
证据
按下一步操作收集证据。
电源
planned
硬件与依赖
- PM8150 and PM8150B PMICs
- APSS watchdog at 0x17C10008
配置
- SEC disables the APSS watchdog so a fault leaves the panel readable
操作步骤
- Not started beyond the watchdog disable
开发经验
- Without the watchdog disable a fault reboots the phone before the log can be read.
完成条件
- Regulators, clocks and battery reporting match the board.
当前范围
- No PMIC driver; only the watchdog is handled.
下一步
- Defer until the kernel reaches the platform driver stage.
证据
按下一步操作收集证据。
镜像组装
device-verified
组件: XnuPrelink, DarwinBoot.
硬件与依赖
- XNU built from source on a macOS runner against kernelcache f18b4df865405f2a287b84977d7aca745e056d656d9fc9df1662970ce2969de7
- iPadOS 17.7.11 21H461 userland image
- 64 MiB payload FAT image
配置
- header_version 2, pagesize 4096, kernel_offset 0x8000, tags_offset 0x100, dtb section from the live device tree
- payload as a raw FDF region at 0x00300000, published by KebabRamDisk over BlockIo
- kernel args -v keepsyms=1 kt_fixed_zones=120
操作步骤
- ./unixnu build payload, then run scripts/pack-payload-mbr.py on the FAT image, point the FDF FILE region at the wrapped image, rebuild the firmware and run ./unixnu bootimg
- ./unixnu bootimg --uefi <Mu-Silicium> --dtb desktop-kebab.dtb --ramdisk none verifies the gzip payload, firmware volume and appended DTB before flashing
开发经验
- The payload cannot be an FFS file, and RamDiskDxe refused the buffer with EFI_INVALID_PARAMETER, so KebabRamDisk publishes the region as a BlockIo device with a device path for PartitionDxe.
- unixnu bootimg needs the patched mkbootimg call that passes the DTB for header version 2.
- The payload builder now injects the device tree nodes XNU looks up by property, and scripts/patch-func-ret.py replaces a single kernel function with a ret when one call has to be skipped without a kernel rebuild.
- The exported firmware patch keeps every edited firmware file, including the two kebab drivers and the BootShim, so the tree can be rebuilt from the patch alone.
- The bring-up kernel is reproducible: the CI Mach-O with a ret in _PE_create_console, _vcattach, _vc_progress_initialize and _PE_get_default is sha256 db666dcf2b930fac1ed5da95accf2a4ed5f9e6c780ab7445284bbcbeedcc7d96, and the entry probe refuses to apply unless that base is un-probed.
- The payload FAT volume has to be wrapped in an MBR disk before it becomes the FDF FILE region: a type 0x0c partition at LBA 2048 plus a 1 MiB pad, written by scripts/pack-payload-mbr.py.
- The working boot image DTB is desktop-kebab.dtb (sha256 8ba6ed34b8396102eac4d95769c56317aece50cf95b69cd3d98aa8353b27f293); the 11 MiB raw live dump carries trailing data past the FDT totalsize and fails the bootimg check.
- The bring-up kernel grew to six ret patches on 2026-10-30: PE_create_console, vcattach, vc_progress_initialize, PE_get_default, initialize_screen and kperf_init_early (sha256 9531eef048f30eba31d159194260e19044fec25b9cd605cbbb2c82ca997d1461).
- The 2026-10-30 evening bring-up kernel grew to eight ret patches: the six above plus vm_commpage_init and vm_commpage_text_init (sha256 63ac20f91988a04f96396408f1d0b1248784d805a5c2e0eee3632082cbef49f4), used to bisect past the commpage stall.
- The 2026-10-31 bring-up kernel is kernel-bsd9: sixteen patches on top of the source build - ret for PE_create_console, vcattach, vc_progress_initialize, PE_get_default, initialize_screen, kperf_init_early, vm_commpage_init, vm_commpage_text_init, OSKextLog, OSKextRemoveKextBootstrap, machine_lockdown, kernel_list_tests, kernel_do_post and PE_lockdown_iokit, mov x0,#0 over the OSKext::copyKexts call in loadSecurityExtensions, and a nop over the ml_set_interrupts_enabled(1) call in kernel_bootstrap_thread.
- The 2026-10-31 evening bring-up kernel is kernel-bsd11: kernel-bsd9 plus a ret for vm_set_restrictions and a mov x0,#0; ret for kernel_do_post, whose return value kernel_bootstrap_thread checks with cbnz before the Assert path at 0xfffffff007984414.
完成条件
- The boot image loads, the menu appears and the kernel is entered.
当前范围
- The payload image must be rebuilt whenever the ADT node injection changes.
下一步
- Fold the ADT node injection into the payload step so the wrapper step disappears.
证据
device: The image boots to the menu, the payload volume mounts and the kernel entry bar appears after the DarwinBoot hand-off. Command:fastboot flash boot_a out/probe-final-boot.img; fastboot reboot. Revision:97f6fea12dae49a1bbc30ccd22c098b82b97dbe4.source: MBR wrapper for the payload FAT volume: status 0, type 0x0c partition at LBA 2048, 1 MiB pad.
诊断
device-verified
组件: DarwinBoot.
硬件与依赖
- Panel as the only output
- kernel entry probe and timed reset from patch-xnu-entry-probe.py
配置
- DEBUG output routed to the framebuffer console
- entry_probe_reset_delay with entry_probe_reset_after and entry_probe_reset_in selects the bisect point
- payload panic probe via scripts/patch-xnu-entry-probe.py --panic-at SYMBOL --panic-text TEXT
- retained boot video info _boot_progress_panic_vinfo filled in machine_startup (patches/xnu/10063-kebab-panic-vinfo.patch), which also paints the top eighth red as a checkpoint
操作步骤
- Build the payload with the probe, flash, boot and read the panel
- A reboot after the delay means the probe point was reached
开发经验
- Stage bars mark kernel entry and the point just before the MMU is on; a timed reset is the only signal available once the kernel runs without a console.
- A probe registered after the exit-boot-services notifications proved those notifications never returned; skipping them made the hand-off complete.
- Probes can mislead: an inline-assembly probe hardcoded to an identity mapping crashes after arm_vm_init closes that mapping and looks like a kernel hang.
- A checkpoint ring at 0xB9000000 and a BSS probe were tried. A one-stub BSS write + dc cvac + PSCI reset reboots, but the next reader still reads no prefix, so normal DRAM does not carry the flag across the reset; the 0xB9000010, 0xC0001000 and 0x200001000 probes behaved the same way.
- pram 0x17F00FE0 is the panic-log page that survives the reset. UEFI leaves it unmapped; a reader that adds it to the GCD and sets it uncached with gDS->AddMemorySpace and gDS->SetMemorySpaceAttributes was built, together with a one-stub ml_phys_write_byte(0x17F00FE0,1) + reset image (out/prammap-boot.img).
- Do not clear the flag page from the firmware: pram may be read-only to UEFI and the kernel clears its own BSS. The prefix check must accept only the value 1, not any non-zero byte.
- debug=0x144 enables a branch that calls SecureDTLookupEntry on /chosen/iBoot and stalls before any IOKit code, so debug stays out of kernel_args.
- The 2026-10-29 chain uses entry_probe_reset_after and entry_probe_reset_in on _InitIOKit and IOPlatformExpertDevice::init: the patched bl performs the call, waits six seconds of the 19.2 MHz counter and issues PSCI SYSTEM_RESET, so one flash answers exactly one question.
- 2026-10-30 bisection of IODeviceTreeAlloc: the checkpoint after IODeviceTreeAlloc did not fire, the one after the first child MakeReferenceTable fired, getRegistryRoot fired and IORegistryIterator::iterateOver fired, which left the interrupt-mapping loop as the stall.
- The device tree carried interrupts and interrupt-parent on the gic node. IODTFindInterruptParent resolves the phandle through gIODTPHandles, which AddPHandle fills only from AAPL,phandle; the ADT has none, so the parent was NULL and IODTGetICellCounts(NULL) dereferenced it. A CPU exception screen after repeated resets is the bootloader crash dump for that fault.
- Removing the gic interrupts property from dts/kebab.dts clears IODeviceTreeAlloc, InitIOKit and ConfigureIOKit; the kernel now reaches initialize_screen in kernel_bootstrap_thread.
- kernel_bootstrap_thread calls PE_init_iokit, then initialize_screen, vm_commpage_init, mac_policy_initmach, OSKextRemoveKextBootstrap, machine_lockdown, kernel_do_post, PE_lockdown_iokit, vm_set_restrictions and kperf_init_early before bsd_init.
- 2026-10-30, after the gic fix: the checkpoint after PE_init_iokit fired, and the one after ConfigureIOKit fired too, so InitIOKit and ConfigureIOKit both return.
- kernel_bootstrap_thread runs kernel_startup_initialize_upto(16) (THREAD_CALL) right after PE_init_iokit; that checkpoint fires. The next checkpoints - after initialize_screen, mac_policy_initmach and vm_commpage_text_init - do not, so the stall is in vm_commpage_init.
- vm_commpage_init calls commpage_populate, whose first call is pmap_create_commpages; it is the current bisection target.
- vm_commpage_init calls commpage_populate, whose first call is pmap_create_commpages. The checkpoint after pmap_create_commpages did not fire, and inside it the one after the second pmap_enter_options_addr did not either, so the commpage pmap creation stops in its first half (page allocation, pmap_create_options, ASID or the first enter).
- Replacing vm_commpage_init and vm_commpage_text_init with ret lets the boot continue; the next checkpoint after OSKextRemoveKextBootstrap still fails, so the stall moves into mac_policy_initmach, vnguard_policy_init, dtrace_early_init, sdt_early_init or OSKextRemoveKextBootstrap.
- The stall after the commpage is mac_policy_initmach: the checkpoints after vnguard_policy_init and dtrace_early_init never fire and the one after mac_policy_initmach does not either.
- mac_policy_initmach calls load_security_extensions_function, which the libsa KLDBootstrap static constructor points at bootstrapLoadSecurityExtensions. That walks com.apple.* kexts and calls OSKext::loadKextWithIdentifier for every kAppleSecurityExtension kext, so the boot is now inside prelinked kext loading (AMFI and friends) before PE_lockdown_iokit.
- Inside KLDBootstrap::loadSecurityExtensions the checkpoint after OSKext::copyKexts already fails, and the one after the first OSKext::loadKextWithIdentifier fails too, so the boot stops in OSKext::copyKexts itself.
- OSKext::copyKexts takes sKextLock with IORecursiveLockLock and then copies sKextsByID with copyCollection. Nothing else in this path runs, so either the lock is held by another thread (deadlock) or the kext registry is not usable at this point.
- The sKextLock acquisition inside OSKext::copyKexts returns, so the lock is fine and the stall is sKextsByID->copyCollection().
- OSKext::initialize creates both sKextLock and sKextsByID and asserts them, and __PRELINK_INFO lists 38 bundle identifiers, so a valid registry of that size should copy instantly; the copy is most likely faulting on a corrupt entry recorded by readStartupExtensions rather than looping.
- Correction, 2026-10-31: OSKext::copyKexts has three callers - KLDBootstrap::loadSecurityExtensions, KLDBootstrap::loadKernelExternalComponents (which runs inside InitIOKit) and IOCatalogue::resetAndAddDrivers. The 2026-10-30 checkpoint inside copyKexts therefore fired during InitIOKit, not at mac_policy_initmach, and patching the whole function broke InitIOKit so every later checkpoint failed.
- With only the copyKexts call inside loadSecurityExtensions neutralised, the checkpoint after OSKextLog at the top of that function still does not fire, so the stop is at that log call or the jump into the bootstrap segment rather than in the kext registry copy.
- 2026-10-31 chain with kernel-bsd9: startup step 16, initialize_screen, vm_commpage_init, vm_commpage_text_init, mac_policy_initmach, vnguard_policy_init, dtrace_early_init, sdt_early_init, mbuf_tag_init all return; machine_lockdown, kernel_do_post and PE_lockdown_iokit only return because they are patched out.
- The stop after that is vm_set_restrictions, whose argument is machine_info.max_cpus and whose body starts with assert(num_cpus > 0); machine_conf derives the value from the topology max_cpu_id, so a zero there panics before kperf_init_early and bsd_init.
- Checkpoints at or after ml_set_interrupts_enabled(1) never fire unless that call is nop'd, which is why the earlier bisection reported contradictory results: with IRQs unmasked the checkpoint cave cannot complete its wait either.
- With kernel-bsd11 the checkpoint after kperf_init_early fires: the whole kernel_bootstrap_thread completes and bsd_init is entered. The checkpoint after bsd_init does not fire, so bsd_init itself now holds the boot.
- A plain ret on kernel_do_post sent the boot to the Assert path at 0xfffffff007984414 because cbnz w0 tested a garbage return value; returning zero fixes it.
- Inside bsd_init the boot stops in throttle_init: the checkpoints after throttle_init and after its first thread_call_allocate never fire, while the earlier bsd_init calls (platform_stall_panic_or_spin, whose stall value is disabled) do not stall.
- throttle_init first calls throttle_init_throttle_window, which reads three kern.io_throttle_window_tier* defaults through PE_get_default. Restoring the real PE_get_default and replacing it with a clean mov x0,#0; ret both leave the stop unchanged, so the PE_get_default bring-up patch is not what blocks it; the remaining suspects inside throttle_init are its PE_parse_boot_argn calls and the lck_mtx_init of each throttle lock.
- throttle_init stops in thread_call_allocate, which does not reach zalloc but kalloc_type_impl_internal, the typed allocator; setup itself is trivial, so the allocation is what blocks.
- bsd_init's first printf also never returns: kprintf's disabled-output branch calls os_log_with_args, and printf itself formats through console_printbuf_putc, which needs a console that PE_create_console and vcattach currently never create. Patching os_log_with_args out is not enough; patching printf out moves the boot to kauth_init, which then does not return either.
- The interrupt controller is not part of the kernel image: the symbols are ArmCpu::mapGic, ArmCpu::prepareGic and ArmCpu::enableGic in the prelinked AppleARMCPU kext. Without kext loading and IOKit matching there is no GIC, so the bring-up kernel has to keep IRQs masked, and every wait that needs an interrupt or a timer never returns.
- The devicetree generator added the arm-io window base to the GIC reg but pe_arm_map_interrupt_controller already maps soc_phys + reg, so the GIC and timer landed at 0x2EA00000 instead of 0x17A00000. The injected reg now keeps the window offsets (0xa00000, 0xa60000) and the mapping resolves to the real addresses.
- Restoring the real PE_lockdown_iokit (IOKit matching) with the printf/os_log/throttle stubs in place still does not return, so driver matching is the next thing to walk.
- PE_lockdown_iokit is zalloc_iokit_lockdown() followed by a tail branch to StartIOKitMatching; StartIOKitMatching calls IOPlatformExpertDevice::startIOServiceMatching, which stops in IOWorkLoop::workLoop, whose first step is OSObject_typed_operator_new - so the stop could never be about drivers: it is kalloc_type_impl_internal.
- kalloc_type_impl_internal ends in zalloc_ext with the Z_NOFAIL flag set, and Z_NOFAIL retries forever; with one CPU, no interrupt controller and IRQs masked, a zone that cannot reach a page never returns. ArmCpu::start (drivers/ArmCpu/ArmCpu.cpp) is what would call prepareGic/mapGic/enableGic, so the GIC, the kext matching and the allocator are one dependency cycle.
- The panic screen reads vinfo, which only vcattach fills during PE_create_console, so an early panic parks instead of drawing; the retained _boot_progress_panic_vinfo filled from boot_args gives it a frame buffer before the console exists.
- A panic probe placed before the console creates a partial clear (rows from v_height/8) and no text, which is how the PE_create_console wall was measured.
- With PE_create_console stubbed the three entry bands stay unchanged and no later marker appears, so the stall is not the console alone.
完成条件
- A failed boot leaves enough on the panel or over a transport to identify the failed stage.
当前范围
- No USB or storage log transport yet; the RAM ring did not survive the reset in the 2026-10-28 test; the pram reader mapping is the current work.
下一步
- Break the cycle at the GIC: either build the kernel with the generic gic_v3_irq.c driver (add it to osfmk/arm64/Makefile, it is not in the object list today, and it reads /arm-io/gic whose reg the ADT now encodes correctly), or get ArmCpu::prepareGic to run before matching. Also confirm why zalloc_ext cannot reach a page at that point.
- Port the official boot progress hooks: zzz-boot-progress.patch applies with fuzz except two owner-root hunks and one PMGR hunk, the build guard requires NATIVE_UFS and OWNER_ROOT_AUDIT, and its ramoops zone 0xB0000000 matches this board live DTB.
证据
device: Seventeen exit-boot-services notifications, a hung notification phase and a passing hand-off after skipping them; kernel entry, MMU enable and _machine_startup all confirmed by bars and timed resets. Command:flash each bisect image and photograph the panel. Revision:97f6fea12dae49a1bbc30ccd22c098b82b97dbe4.