Commit Graph
90 Commits
Author SHA1 Message Date
bluseliu50 0b3ad36992 refactor: compile pipelines on the device only
make-pipeline-cache.py and the bridge's fallback patch are gone, the
bridge builds 20 patches, and the pointers follow AdrenoMetal and
Adreno740.
2026-10-29 19:35:25 +08:00
bluseliu50 e038ba38fc fix(turnip): owner-laid linear images at 64-byte pitch, rendered in SYSMEM
fdl6_layout aligned an explicit linear layout's pitch to 16 pixels for
the 16x4 GMEM store, so an IOSurface whose rows are 24384 bytes (3048
RGBA16Float texels) could not be imported in place. An explicit layout
now takes the hardware's 64-byte alignment, and a linear host or
explicit-layout attachment whose size is not whole tile blocks renders
in SYSMEM, which reads and writes its texels alone. Bridge patch 0021.
2026-10-29 17:04:39 +08:00
bluseliu50 159eb82611 fix(turnip): memoryless textures take no memory
The darwin backend now offers lazily allocated memory, as the msm
backend does with a settable GPU address: a sparse VMA reserves the
range and a BO is made there only when a pass needs the bytes. A pass
with such an attachment that has no memory yet renders in GMEM, where
the attachment lives in tile memory alone; the autotuner chose SYSMEM
for passes of few draws and so made the memory for good.

Core Animation's render server holds its intermediate targets as
memoryless textures: untagged-feaf29203 had twelve 3048x2032 RGBA16F
ones, 758 MiB, each memory of its own. On the host the same Liquid
Glass scene no longer allocates the 48 MiB attachment.
2026-10-29 16:34:29 +08:00
bluseliu50 b624df5b5a fix(turnip): free cached BOs not reused within a second
The darwin BO cache gave BOs back only on memory pressure or a failed
allocation. With BOs from system memory nothing fails, so it held what
the render server freed. It now frees an entry not reused within a
second of entering it, as freedreno's fd_bo_cache_cleanup does. Bridge
patch 0019 and the MEM telemetry row.
2026-10-29 15:26:53 +08:00
bluseliu50 16d7ff9632 feat(gpu): metal2vulkan development tip, BOs from system memory
The translator pin moves to upstream development 624bab39 (the
inexact-math work) and records its branch; check-metal2vulkan-pin.py
checks the pin against the branch the record names. Bridge patch 0018
rounds heap texture sizes to their alignment. Adreno740 takes user BOs
from system memory, with no fixed pool.
2026-10-29 14:30:09 +08:00
bluseliu50 fa2ff312f5 fix(gpu): ahead-compiled pipelines read on demand, metal2vulkan patch 0017
make-pipeline-cache.py builds its producer with the plugin's include paths
and the tablet's TU_DEBUG.
2026-10-29 13:16:00 +08:00
bluseliu50 c93e965466 feat(gpu): metal2vulkan 0dfdbcd, a fixed Turnip cache identity and pipelines compiled ahead
- pin metal2vulkan at upstream 0dfdbcd5 with the rebased 16-patch series;
  scripts/check-metal2vulkan-pin.py proves with git alone that the
  checkout is upstream plus exactly those patches
- Turnip's pipeline cache UUID comes from its compiler source
  (-Dtu-build-id), the same for the host and the tablet build
- scripts/make-pipeline-cache.py runs the render server's priming over
  every library of the OS image on the host through the tablet's
  compiler and packs the cache
2026-10-29 11:44:31 +08:00
bluseliu50 c6f672600d chore: bump AdrenoMetal for Core Image kernels by name 2026-10-29 01:57:09 +08:00
bluseliu50 2c40ae9a7b perf(turnip): no CPU wait on syncs already on the ring
Every client submits to the kernel's one in-order ring, and each job's
prologue flushes and invalidates the GPU caches and waits for idle, so
a wait on a sync already resolved to a ring fence is met by the ring,
as msm_gem_submit() skips its own ring's fences. Only an unresolved
sync is waited for, until it is submitted. The submitting thread no
longer stalls on the previous GPU work.

Also bumps AdrenoMetal and registers bridge patches 0024-0037.
2026-10-28 23:53:52 +08:00
bluseliu50 fb5cdd6e06 chore: bump AdrenoMetal for Apple-semantics waits, imports and heaps
Registers runtime patches 0022 (mipmaps outside the measured spread) and
0023 (heap texture size a multiple of its alignment). The frontend host
check counts the releasing surface import.
2026-10-28 22:49:41 +08:00
bluseliu50 caffd5dfb5 feat(turnip): release cached BOs on OS memory pressure
The retire queue and the BO cache grow with demand instead of holding
256 and 1024 entries. The cache gives everything back when libdispatch
reports memory pressure (DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, warning
or critical) and when an allocation or GPU range cannot be had; the 2 s
idle eviction, the 100 ms kernel poll and the seven-eighths VA rule are
gone. Fence waits for idle and for ring space have no fixed bound: the
kernel's hangcheck ends a hang. TU_DARWIN_BO_CACHE=0 turns the cache off
for the host checks of the release paths.
2026-10-28 20:56:15 +08:00
bluseliu50 56352f7391 chore: bump Adreno740 for GPU hang recovery
derive-a740-hwinit.py also emits RBBM_SW_RESET_CMD.
2026-10-28 20:40:55 +08:00
bluseliu50 8798b45a77 chore: bump Adreno740 and ArmSmmu4K for on-demand page tables 2026-10-28 20:26:16 +08:00
bluseliu50 aefb6563e3 chore: bump Adreno740, AdrenoMetal and ArmCpu; drop mimalloc
The bridge uses the system allocator now.
2026-10-28 20:13:29 +08:00
rpone ab11a8cb68 feat(scripts): iPadOS 27 kernel, driver, GPU addon and seed build steps
Source-driver and source-storage builds, the arm64e PAC rewrite for the Rust bridge, the IOAccelerator base ABI of 24A446, the bridge with mimalloc and link-time optimisation, the plugin with the prime list, addon options for a prime list, a pipeline pack and cache export, wallpaper overlay and seed changes, and payload, kernel and userdata steps for the new profile.
2026-10-28 09:20:55 +08:00
bluseliu50 2ab05c11ae build: port the arch and OS patch series to xnu-12377 and share the kernel target 2026-10-26 15:10:41 +08:00
bluseliu50 2d5a60af86 build: compile kernel archives for the selected architecture and iOS version 2026-10-26 14:43:27 +08:00
bluseliu50 f66b8b8fe6 fix(feeds): leave submodules with local changes checked out 2026-10-26 14:43:27 +08:00
bluseliu50 2cdf5d9ae9 feat(userdata): take windows from the OS profile and decrypt AEA images 2026-10-26 14:43:27 +08:00
bluseliu50 4453bb371a build: pass the XNU architecture and iOS version to kernel builds 2026-10-26 12:54:22 +08:00
bluseliu50 86c4f67378 feat(profiles): select the architecture profile from the OS profile 2026-10-26 12:54:22 +08:00
rponeawa e721468d55 Automate discovery and rendering of device records 2026-10-26 07:29:25 +08:00
bluseliu50 018c8f3439 fix(kernel): restore omitted XNU headers after a fresh clone
A changed patch series re-clones the XNU work tree, which lacks the public
headers newer xnu omits (TrustCache among them), and archives built before
the kernel failed to compile against it.
2026-10-26 01:40:29 +08:00
bluseliu50 71ccc68c1e feat(adt): pass each CPU's cluster type from the DTS
A CPU node with unixnu,cluster-type "E" or "P" gets the ADT cluster-type
integer XNU reads to build E and P processor sets.
2026-10-26 01:40:29 +08:00
bluseliu50 cabe3cefc7 build(bridge): stack the recorded translator patches in order
Patches 0009 to 0016 touch files the earlier ones do, so the source is
checked against the tree each prefix of the patches leaves (a scratch
index per prefix) instead of a concatenated diff. The runtime id hashes
the final tree.
2026-10-26 00:59:46 +08:00
bluseliu50 f6e4012f71 fix(xnu): let Safari start its WebKit extensions from the OS cryptex
Show the OS cryptex where iPadOS looks for it, under /private/preboot,
and let a board option skip the launch constraints that refused App
cryptex daemons and owner-trusted binaries. The App cryptex trust module
joins the owner module of the trust bundle, and the lookup trace also
records lsd.
2026-10-25 22:53:57 +08:00
bluseliu50 688fa88c65 fix(adt): give the iPadOS identity its product id and board name
MGGetProductType() looks /product/product-id up in libMobileGestalt's
product table; without it the product type was 0, and the audio server
loaded no routing database ("Unknown product ID (0)"). The profile now
sets the J120 product id, puts J120AP first in the root compatible and
adds /product/audio. The ADT generator lets a profile prefix the root
compatible and declare child nodes.
2026-10-25 13:38:02 +08:00
smeng9andClaude Opus 5.5 0f85bc2378 feat(userdata): build the userdata image on Linux
The userdata step read each IPSW disk image through macOS hdiutil, so it
stopped on Linux with "hdiutil not found on PATH". It only needs the raw
disk bytes, so on hosts other than macOS it now decodes them with
scripts/unixnu/udif.py.

udif.py reads the koly trailer and the blkx (mish) tables of a UDIF
image and yields the disk in sector order: raw chunks are copied,
zero-fill and ignored chunks read as zeros, and zlib, bzip2 and LZFSE
chunks are decompressed (LZFSE with the lzfse tool the Linux toolchain
installs). It refuses gaps, unsupported chunk types and chunks that do
not decode to their size. A file without a koly trailer is a raw image
and is copied: the SystemOS cryptex is one, while the OS image is UDIF
with LZFSE chunks. test_udif.py checks this with synthetic images.

The window layout, hashes, SHNGROOT manifest and report are unchanged,
and macOS keeps hdiutil. For iPadOS 17.7.11 (21H461) the image built on
Linux and the one built on macOS from the same disk images are byte
for byte identical (9382658048 bytes, sha256 fd43ee7035ce185c...), as
are the window hashes (OS e5634d04..., SystemOS b4908cde...).

The lzfse lookup that ipsw.py had for the kernelcache moves to util.py,
which both use. The Linux notice now names --skip-setup and
seed-data-grow as the steps that need macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 07:02:39 +08:00
bluseliu50 2103be5f74 fix(devicetree): give arm-io a non-zero base and window-relative registers
XNU reads the arm-io ranges parent address as the SoC base and skips
platform setup when it is zero; device registers are offsets from that
base. Derive the window from the exported registers (16 MiB aligned)
and emit child registers relative to it.
2026-10-25 05:15:56 +08:00
rponeawa c1f6966146 fix: supply shared XNU entry probe tools for device payloads 2026-10-25 03:30:29 +08:00
rponeawa c8057bbcde feat(linux): support native package managers and host LLVM layouts 2026-10-25 03:07:50 +08:00
rponeawa 80cf8d4923 feat(build): load local inputs and add build step shortcuts 2026-10-25 03:02:54 +08:00
rponeawa c952843598 feat(firmware): share the FDT initrd block driver across device ports 2026-10-25 02:56:06 +08:00
rponeawa 6fed2312dd feat: validate structured device porting records 2026-10-25 02:27:00 +08:00
rponeawa 73a793d20f refactor: resolve SoC profiles and canonical component sources 2026-10-25 02:07:33 +08:00
ljhhkx529 c62bf12595 Add Tools menu plugin system and Advanced Logger plugin
Introduce a generic Tools submenu plus a menu-plugin protocol so device
tools can be discovered at runtime instead of being hardcoded in UniXNU.

Structure:
- UniXNUPkg/Include/Protocol/UniXNUMenuPlugin.h: plugin protocol with a
  Run callback, a content rect and a DrawStatus footer callback.
- UniXNUPkg/Library/UniXNULib: discover installed plugins, render a
  Back + plugin list, and run the selected plugin between the header and
  footer while keeping the upper UI visible.
- UniXNUPkg/Driver/AdvancedLogDxe: first plugin; exports the Advanced
  Logger log as OneSend QR frames with 5 volume-key speed gears and a
  5-segment level bar, drawn with a single Blt.
- UniXNUPkg.dec: adds the menu plugin GUID and PcdUniXNUDeviceModel so
  exported log files are named with the device model.
- scripts/unixnu/payload.py, built-in config and docs: `tools = true`
  appends a Tools entry and documents the `tools` action.

The exported QR frames are read with OneSend (扫传):
https://onesend.01mvp.com

Scope: loader and boot logic are unchanged. This commit only adds the
menu/UI plugin path and the Advanced Logger tool; device wiring lives in
the platform checkout and is not part of this change.
2026-10-25 00:01:39 +08:00
smeng9andClaude Opus 5.5 b0fe495af6 build(kernel): run the kernel step on Linux
On a Linux host the driver sets the environment of the
scripts/linux/setup-toolchain.py toolchain: the xcrun shim answers SDK
queries with the build tree's fakeroot, clang targets plain arm64 for
iOS 17, and CCC_OVERRIDE_OPTIONS turns off two warnings upstream clang
has and Apple clang does not (the archive builders use -Werror and
replay xnu's compile records, so only the clang driver sees them).

- build-xnu-4k-baseline.sh runs scripts/linux/prepare-xnu.py: source
  rewrites the xnu sources that assume Apple's tools (SHA/AES assembler
  macros, makesyscalls.sh under mawk, kextsymboltool and /dev/null) and
  installs TargetConditionals.h into the fakeroot; libs builds
  libcc_kext.a from compiler-rt's cc_kext profile sources. xnu's make
  also gets the host compiler, mig and the machine sizes a Mac supplies.
  ditto becomes cp.
- build-firehose.sh compiles libfirehose_kernel from its xcconfig.
- build-corecrypto-14.py reads project.pbxproj with scripts/pbxproj.py
  (same JSON as plutil for all 13,112 objects).
- The kernelcache is decoded with lzfse.

The macOS path is unchanged apart from ditto. Built from the same
sources and configuration on Linux and with Xcode 27.1, the kernels have
the same global symbols, linked objects, archive symbols, 1,265
kalloc_type signatures, and prelink bindings and kexts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:48:06 +08:00
smeng9andClaude Opus 5.5 6dc20ebe08 build(linux): install the kernel step toolchain on a Linux host
scripts/linux/setup-toolchain.py, run once as root, builds into
/opt/unixnu-linux (or PREFIX, or $UNIXNU_TOOLCHAIN):

- clang from llvm-project 58c46bae2118 with llvm-xnu-builtin-type.patch,
  which adds __builtin_xnu_type_signature, __builtin_xnu_type_summary,
  __builtin_xnu_types_compatible and xnu_usage_semantics; kalloc.h uses
  the builtins with no fallback;
- cctools-port 1030.6.3-ld64-956.6 (its master, ld64-609, corrupts the
  kernel link), with libdispatch for ld64;
- mig and migcom from bootstrap_cmds-138;
- iig-port, with iig-port-darwin-target.patch;
- xnu-host-cc, the host compiler for xnu's SETUP tools;
- lzfse for the kernelcache.

It installs the Command Line Tools shims (clang, clang++, cc, install,
gm4) under the prefix and xcrun, plutil and codesign in /usr/bin, where
xnu's makefiles call them. libmacho.a and libstuff.a go to /usr/lib and
libdispatch to /usr/local. Each step is skipped when its output exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 19:48:06 +08:00
bluseliu50 52d18cef78 feat(scripts): key the shader cache to the translator build and allow paths in kernel arguments
The bridge build applies the padded-row alias patch and passes a runtime id derived from the translator pin and its patches, so primed shaders survive until the translator changes. Kernel argument values may now contain a slash.
2026-10-23 18:02:24 +08:00
tycykp b9ecfdbbfa feat(debug): integrate USB terminal capture and screen controls 2026-10-23 17:36:40 +08:00
rpone d12c96bf2c fix(kernel): authenticate the DriverKit header listing when a token is set
prepare-xnu-source.py lists Apple's xnu tree through the GitHub API without credentials. Hosted runners share the anonymous per-address quota and the bootstrap pass stops with HTTP 403 rate limit exceeded. Send GITHUB_TOKEN or GH_TOKEN, when set, to api.github.com and raw.githubusercontent.com only.
2026-10-23 04:46:51 +08:00
bluseliu50 bad2c6ba09 fix(payload): keep Restart and Power off in the payload's boot menu
The payload's unixnu.toml replaces the built-in menu, which held the only Restart and Power off entries; the generated configuration now ends with both.
2026-10-23 02:55:22 +08:00
bluseliu50 df43ee1da1 feat(payload): add a confirmed install entry to the boot menu
board.toml [payload.install] adds a second boot menu entry with the same
kernel and Data seed behind a confirmation; each confirmation choice
appends its boot argument (the sheng board uses it for the Data reset).
2026-10-23 02:55:22 +08:00
IssacL04 9fd45ef70c fix(storage): make backups optional and support macOS self-tests 2026-10-23 02:04:03 +08:00
IssacL04 1c71ba0136 feat(storage): add experimental dual-system partitioning 2026-10-23 02:04:03 +08:00
Sharky Wang 86c177b9bb Merge pull request #66 from xVanTuring/feat/entry-probe-reset
feat(payload): keep the entry probe's timed reset from the board file
2026-10-22 21:23:41 +08:00
Sharky Wang 1ce0f8d98e Merge pull request #62 from xVanTuring/feat/skip-setup-args
feat(payload): pass board arguments to the skip-setup tool, add --no-auto-dim
2026-10-22 21:23:41 +08:00
Sharky Wang b6c2d76821 Merge pull request #60 from xVanTuring/feat/owner-cache-volume-uuid
feat(patches): take the owner SystemOS volume UUID from the configuration
2026-10-22 21:23:41 +08:00
Sharky Wang 3292b23113 Merge pull request #59 from xVanTuring/feat/bridge-manifest-only
feat(scripts): write the bridge manifest without building
2026-10-22 21:23:41 +08:00
xVanTuring d4d9d2819b feat(payload): keep the entry probe's timed reset from the board file
The payload ran patch-xnu-entry-probe.py only for panic_screen, always
with --no-reset. [payload] entry_probe_reset_delay now keeps the reset
(--reset-delay), and entry_probe_reset_after, _in, _occurrence and
_before move it after a given call (--reset-after, --in, --occurrence,
--reset-before), with or without the panic screen. Before the kernel
can draw, a reboot after the delay is the only sign that it got that
far. Without the new keys the call is unchanged.
2026-10-22 20:26:25 +08:00