Commit Graph
45 Commits
Author SHA1 Message Date
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
bluseliu50 2172d86157 feat(unixnu): build the board's archives before the kernel link
board.toml [kernel] archives lists the archive builders in order. The kernel step runs a bootstrap pass for the compile records when they are missing (it may stop at the link), runs the builders, then links, and reports archives that no builder makes. Prelink replaces an earlier candidate instead of refusing. libpthread and corecrypto-2023 join feeds.toml and the kernel references.
2026-10-21 00:33:32 +08:00
bluseliu50 851f7aa856 feat(unixnu): replace board kernel arguments by name, accept an owner trust cache
An extra --kernel-arg NAME=VALUE now replaces the board's argument of the same name instead of being appended, so a test can change a default within the 1000 byte command line. --owner-trust-cache takes an owner-signed bundle that carries the original caches plus extra modules, such as the GPU plugin, and skips the board allow-list. The length error names the real limit.
2026-10-21 00:33:32 +08:00
bluseliu50 327f765de7 feat(scripts): bind AES and the accelerator from recorded audit results
Both audits need hardware and emulator evidence of the original kernelcache that is not in any repository. Their recorded results (AES method addresses, accelerator base class layout) ship with the scripts and are used when the evidence is absent. They belong to the kernelcache pinned in board.toml.
2026-10-21 00:33:18 +08:00
bluseliu50 2bbbbbcb28 fix(scripts): take XNU symbol names from the objects of the kernel link
The pthread and corecrypto archives read the names of a linked kernel, which a fresh tree does not have yet. They now read the objects in link.filelist and the aliases of all-alias.exp, so they no longer depend on an earlier successful link and cannot collide with their own previous output. The corecrypto source check resolves the symlinked reference first.
2026-10-21 00:33:18 +08:00
bluseliu50 9055e44ace feat(scripts): build and stage the published Metal device
build-native-metal-bridge.py applies translator patches 0004 and 0005.
The host checks cover the frontend journal, families and Turnip changes.
add-gpu-plugin-data.py gains --publish, which hands the native device to
the render server and turns off its deep and compressed framebuffers,
and --clients, which lists the other processes that get one.
2026-10-20 23:18:57 +08:00
bluseliu50 acb4fe7fa2 chore(gpu): update the GPU module pointers
ArmSmmu4K, NativeAdreno and NativeMetal gain the cheaper SMMU table
operations, the user BO pool, per-process Metal devices, the target GPU
families and the pipeline journal. check-smmu4k-live.py follows the new
test counts and runs the mixed-size alias checks.
2026-10-20 23:17:50 +08:00
bluseliu50 2d81c3ef61 build: split drivers and kits into module submodules
Add the driver and kit repositories as public UniXNU submodules. Update
submodules during unixnu fetch and before tree assembly.
2026-10-20 18:20:30 +08:00
rpone 6c56ecec19 feat(gpu): import the native Adreno and Metal stack
Bring the current NativeAdreno, NativeMetal, AdrenoFirmware, AdrenoPM4,
AirNir and ArmSmmu4K sources, the Mesa pipeline-cache and builtin-shader
patches, and the Turnip host cache tools.
2026-10-20 18:08:40 +08:00
UniXNU Docs 5c92d4048f docs: add the VitePress documentation site
Add English and Simplified Chinese documentation under docs/, covering the boot chain, build, boot, debugging, porting, drivers, XNU 4 KiB pages, macOS and device notes. Add the Pages workflow and CNAME. Rename the boot manager from CrabApple to UniXNU across the package, symbols, paths, configuration file and logs. Update README with the documentation badge and CONTRIBUTING link.
2026-10-19 22:10:43 +08:00
bluseliu50 980420f0a9 feat(userdata): build the userdata partition image
build userdata writes the OS and SystemOS disk images of the IPSW behind
the SHNGROOT manifest, checked against the partition size of the board.
It prints the fastboot flash command and flashes nothing. The image
matches a previously built one byte for byte.
2026-10-19 21:19:07 +08:00
bluseliu50 2bb5ea7d6a feat(ipsw): read the target IPSW from a local file or a URL
--ipsw takes a local path or an https URL. A remote IPSW is read member
by member with HTTP range requests and never downloaded as a whole.
Members are cached with their sha256, checked against the board pins and
against the product, version, build and chip of the board. The kernel
step takes the kernelcache from the IPSW when none is given. The new
ipsw command lists and extracts components.
2026-10-19 21:19:07 +08:00
bluseliu50 160ea4429a feat(payload): build the boot image ramdisk payload
The payload step writes a FAT volume with the CrabApple config, the
prelinked kernel (optionally with the panic screen patched into a copy),
the generated device tree and the optional trust cache and Data seed.
The volume is written with mtools and is reproducible. bootimg uses it
as the ramdisk when present.

--skip-setup marks Setup as done in a copy of the Data seed so the Hello
pages are skipped. A non-macOS host now only prints a note, and the
kernel step checks for xcodebuild.
2026-10-19 20:39:48 +08:00
bluseliu50 ffd1630b8d feat(kernel): take the Darwin source versions from feeds.toml
The xnu tag, commit, Darwin and source versions, the libplatform,
libdispatch and AvailabilityVersions tags and the tags of the sources
that still carry the DriverKit and TrustCache headers are set once in
feeds.toml. The driver passes them to build-xnu-4k-baseline.sh and
prepare-xnu-source.py, which keep the qualified versions as defaults.
2026-10-19 20:11:04 +08:00
bluseliu50 e7fbf5e869 fix(kernel): run a bootstrap pass before the boot progress build
The boot progress layer is generated from the compile record of
startup.o, which only an earlier build leaves behind. A first build from
scratch now runs once without it.
2026-10-19 20:11:04 +08:00
bluseliu50 850776abc1 feat(scripts): build the firmware from a fresh checkout
Make the firmware step work on clean clones of the remote repositories:
initialize the Mu-Silicium submodules the board lists, fetch the two
extra edk2 submodules (brotli decompressor, libspdm), generate the
CLANG_BIN directory the CLANGPDB tool chain needs from the Homebrew LLVM
and lld, pin SOURCE_DATE_EPOCH to the commit time, and add
--skip-preflight for the board preflight scripts.
2026-10-19 20:11:04 +08:00
bluseliu50 fc6c83ae05 feat(examples): mark the example device and refuse to build it
board.toml gains example = true. status shows [EXAMPLE], and build and
bootimg stop with a message, so a copied sample is never built by
accident.
2026-10-19 19:46:57 +08:00
bluseliu50 647db5f144 feat(scripts): add the unixnu build driver
A Python 3 driver with defconfig, fetch, tree, build, bootimg, status
and clean. Device repositories supply board.toml and configs/*_defconfig;
external sources come from feeds.toml and are fetched with shallow,
blobless, sparse git checkouts pinned in unixnu.lock. Modules can come
from local directories through --local, --local-<kind> and
--local-module. The boot image step packs BootShim, the firmware volume
and the device tree for a Mu-Silicium checkout given with --uefi.
2026-10-19 19:46:45 +08:00
bluseliu50 4e61886d7d chore(scripts): remove free disk space checks
The checks guarded a local development disk floor and do not belong in
the shared scripts. The scratch image capacity check in
prepare-air-nir-diagnostic.py is kept because it validates a mounted
image, not the host disk.
2026-10-19 19:24:32 +08:00
bluseliu50 dec4c7b5b6 Initial import 2026-10-19 18:49:31 +08:00