Commit Graph
69 Commits
Author SHA1 Message Date
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
xVanTuring 12c5d446e3 feat(payload): pass board arguments to the skip-setup tool, add --no-auto-dim
[payload] skip_setup_args (optional) is passed to skip_setup_tool after
the two paths, and the edited seed is cached by the hash of the base and
of those arguments.

seed-data-skip-setup.py --no-auto-dim also sets SBDisableAutoDim,
SBDontDimOrLockOnAC and SBDisableIdleSleep in com.apple.springboard, as
UniXNU-qemu's build-os-root.py does: a board without buttons or a working
idle timer otherwise turns its display off about 30 seconds after
SpringBoard starts and puts the system to sleep.
2026-10-22 19:04:37 +08:00
bluseliu50 d07f3c3fc4 fix(gpu): let Turnip bind host-import images at any offset
Turnip asked a dedicated allocation of every image made for external
memory, so an image over a no-copy buffer's host pages could not be
bound inside the buffer's import and each such texture fell back to a
shadow image copied in and out per pass. Ask it only for handle types
that carry per-image metadata, as the host-allocation format query
already reports.
2026-10-22 19:04:36 +08:00
xVanTuring bb385622c8 feat(patches): take the owner SystemOS volume UUID from the configuration
offline-owner-systemos-mount.patch mounted the SystemOS cryptex volume
by the sheng image's UUID. XNU_OWNER_CACHE_VOLUME_UUID
(CONFIG_XNU_OWNER_CACHE_VOLUME_UUID) now names it; the build writes it
into owner-data-volume.h next to the Data volume UUID and rebuilds
kern_exec.o when it changes. Without it the sheng value stays the
default.
2026-10-22 19:02:21 +08:00
xVanTuring 4fb7a93157 feat(scripts): write the bridge manifest without building
build-native-metal-bridge.py --manifest-only writes
build/native-metal-bridge/Cargo.toml exactly as the build does (patched
translator source, fixtures) and stops before cargo, so the crates can
be fetched once (cargo fetch --manifest-path ...) and later builds run
offline.
2026-10-22 19:01:04 +08:00
bluseliu50 1640f6fe69 fix(gpu): update NativeMetal for two-plane surface textures
NativeMetal now makes textures on two-plane IOSurfaces, which widget
snapshots are drawn into, and reports why a surface texture was
refused. The bridge build applies the runtime patch that accepts the
two-plane RGB surface format.
2026-10-22 18:16:31 +08:00
bluseliu50 eeb23d090d feat(gpu): build the unified log export into adrenoprobed
The probe daemon links NativeOsLogExport.mm and carries the logging
grants it needs to read the whole unified log for the diagnostic export.
2026-10-22 16:20:29 +08:00
bluseliu50 e90b050e65 feat(gpu): carry the shader prime list in the addon and the plugin
make-gpu-addon.py --prime-list FILE adds the OS image's .metallib paths
as addons/NativeAdrenoMetal.primelist. The plugin build also links
build/prime-list.txt into the executable's __DATA,__primelist section,
since the render server's sandbox may refuse to read the file.
2026-10-22 16:20:29 +08:00
bluseliu50 453f1a893a fix(scripts): apply the bridge patch that skips draws without a pipeline
NativeMetal carries 0006-skip-draws-without-a-pipeline.patch since
495d3df, but build-native-metal-bridge.py never applied it.
2026-10-22 12:35:41 +08:00
rpone aef9becad0 feat(patches): copy the staged system apps into the data volume
The deletable system apps (Weather, Notes, Calendar and the rest) ship in
the OS volume's /private/var/staged_system_apps; a restore copies them
into Data, where the first-boot data migration installs them. The owner
Data mount hides that directory, so the apps and their widgets were
missing. With boot argument sheng-staged-apps=1 the kernel copies it once,
before launchd starts, through the vnode the Data mount covers, owned by
mobile (installcoordinationd moves the bundles as mobile). The walk is
iterative and every file is synced; /private/var/db/.sheng-staged-apps
marks a complete copy.

The payload passes --persistent-data to the ADT tool for boards that set
[payload.adt] persistent_data.
2026-10-22 08:16:09 +08:00
rpone 910a19dfaa feat(payload): replace the default wallpaper's heic images with png
PosterBoard renders the iPad7,1 variant of wallpaper 7570, a layered
animation whose two HEIC images ImageIO cannot decode without a hardware
HEVC decoder, so the wallpaper stayed black.

scripts/make-wallpaper-overlay.py converts both images to 2732 pixel PNG
and points a copy of main.caml at them. make-gpu-addon.py --wallpaper
packs that directory into the addon. The kernel now creates missing
directories below /private/var/ngpu while it writes the addon, and
mounts /private/var/ngpu/wallpaper as a read-only union over the
animation's directory.
2026-10-22 08:15:47 +08:00
rpone 0e17699d18 fix(payload): pass the text fixups after the ipad identity flag
The text fixup loop landed inside the ipad_identity condition, between
the if and its body, which leaves payload.py unparsable. Move it after
the --ipad-identity append.
2026-10-22 08:13:47 +08:00
rpone 7d0835dc18 feat(payload): pass signed-text fixups in the device tree
A board lists its fixups of signed file text in board.toml [payload]
text_fixups. The payload passes them to the ADT tool, which stores them
NUL-separated in /chosen/text-fixups, so they take no space on the
1000-byte command line. The kernel reads that table before the
text-fixup0..7 boot arguments and now holds up to 32 fixups.
2026-10-22 08:13:11 +08:00
rpone 18ffa378bd feat(payload): write a gpu addon into the data volume at boot
`unixnu build payload --gpu-addon FILE` carries a file made by
scripts/make-gpu-addon.py next to the kernel. The loader hands it over as
/chosen/memory-map/GpuAddon, and before launchd starts the kernel writes
every file whose content or mode differs into /private/var/ngpu of the
mounted Data volume, then mounts the addon views. The Adreno Metal plugin
then no longer has to be part of the Data seed, so the seed's persistent
store survives a plugin rebuild. Every file is zlib compressed to keep
the payload FAT at 192 MiB. Updates DarwinBoot and NativeRamBlock for the
addon handoff.
2026-10-22 08:12:47 +08:00
rpone aafe46ec6f fix(ci): run board archives only when the config enables them 2026-10-22 02:20:23 +08:00
rpone 74b5597fa7 fix(ci): make the macOS runner build from a clean tree 2026-10-22 02:02:55 +08:00
LiangKam 61e9f1312a fix(qemu): validate PPM headers and raster length (#18)
Parse the P6 header explicitly, keep every raster byte, and reject
non-positive dimensions, maxval other than 255, and mismatched raster
lengths. Add scripts/test-qemu-ppm.py.
2026-10-22 01:11:15 +08:00
xVanTuring 7f79d5b69d fix(unixnu): compile the bootstrap pass without the board's archives 2026-10-21 20:16:53 +08:00
xVanTuring 02a6937b24 fix(scripts): name the command that stops the XNU build 2026-10-21 20:16:53 +08:00
LiangKam 82dbc8ec29 fix(config): parse zero-prefixed decimal values as base 10
The defconfig grammar accepts signed decimal digit sequences, but
int(raw, 0) rejects nonzero decimal values with leading zeroes, such
as 08, 010 and -08. Select base 16 only for the existing 0x form and
base 10 otherwise, preserving signed hexadecimal values.

Add 16 numeric regression cases to the build driver's existing
self-test.
2026-10-21 20:16:47 +08:00
bluseliu50 fd1508792a feat(scripts): grow the Data seed to the size of the device's storage
seed-data-grow.py resizes the APFS container of a packed seed with
diskutil, without mounting a volume, and packs it again. The size is
given in GiB or taken from the userdata partition of a tablet in
fastboot, minus the root image, a guard, the log reserve and one GiB.
2026-10-21 03:33:03 +08:00
bluseliu50 b336cd5f20 feat(tree): share the device's proprietary files with the build tree
The tree's .cache/firmware links to .cache/firmware of the device repository, where scripts/extract-files.py puts them, so every tree sees the same files and none is copied into a repository.
2026-10-21 00:40:30 +08:00