Skip to content

Apple's open-source XNU kernel on Android phones: its own loader and drivers, Metal on the Adreno. Runs from RAM; a reboot gives the phone back to Android.

C

Licenses: Turnip, AdrenoMetal, metal2vulkan, the plug-in's origin; a binary built with M2V=1 is to verify

yehorkaa5fa8eed5cf4c
diff --git a/COMPLIANCE.md b/COMPLIANCE.md
index 6d47843..22a0ac8 100644
--- a/COMPLIANCE.md
+++ b/COMPLIANCE.md
@@ -35,8 +35,8 @@ License (`LICENSE`). Contributions are accepted under the same terms (`CONTRIBUT
Each third-party component is listed in `THIRD_PARTY_LICENSES.md` with its origin, license, and
whether it is redistributed in the tree or fetched at build time. Components fetched at build time
-(the Darwin SDK, Mesa, Procursus/Sileo, lzfse, ath11k, LinuxKPI headers) are never committed; they
-are obtained from their own upstreams under their own licenses.
+(the Darwin SDK, Mesa and its Turnip, AdrenoMetal, metal2vulkan and its Rust crates, Procursus/Sileo, lzfse, ath11k, LinuxKPI headers) are
+never committed; they are obtained from their own upstreams under their own licenses.
## Items still to verify
@@ -55,6 +55,16 @@ These are flagged for review and are **not** asserted to be settled:
- **Mu-Silicium / Project Mu** derived files under `devices/redwood/uefi/` carry upstream
BSD-2-Clause-Patent and GPL-2.0-or-MIT headers; the derived parts keep those licenses.
+- **Metal on Vulkan (`M2V=1`).** metal2vulkan is `GPL-2.0-or-later OR LGPL-3.0-or-later`, and `userland/build.sh` links it statically into the
+ Metal plug-in and `m2v_test`. A binary so built has obligations; what they are here, and whether they can be met together with the other
+ parts of that binary, has not been settled. **No such binary is distributed**: nothing of it is in `prebuilt/`, and each user fetches and
+ builds it. Before anyone distributes one, this must be answered ([third-party licenses](THIRD_PARTY_LICENSES.md#a-binary-built-with-m2v1-to-verify)).
+- **`tools/m2v/metal2vulkan-hakios.patch`** is in the tree and changes GPL/LGPL code, so it is under those terms and not the MIT License
+ that `LICENSE` gives the rest of `tools/`. It carries no notice of its own.
+- **`userland/src/HakiosMetalCA.m`** began as vcvkk's plug-in (github.com/vcvkk/darwin-redwood). Its header names the origin; that
+ repository states no license (read 2026-11-04), so the permission to carry and change this file is not established.
+- **The Rust crates of `M2V=1`** not read from a local registry (`THIRD_PARTY_LICENSES.md`).
+
If any of these cannot be confirmed as redistributable, the fallback is the same as for all
device firmware: remove the file from the tree and have each user obtain it from their own
hardware.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 14db99b..bdf3c0b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -13,14 +13,15 @@
is worth more than an adjective.
- Names: files are `hakios.<thing>.c`, identifiers `hakios_<thing>`, sysctls `kern.hakios.*`,
devices `/dev/hakios-<thing>`.
-- Licenses: the kernel patch and files are APSL 2.0 (derived from XNU); everything else is MIT.
+- Licenses: the kernel patch and files are APSL 2.0 (derived from XNU); everything else is MIT, but for
+ a patch to third-party code, which keeps that code's license (`THIRD_PARTY_LICENSES.md`).
Third-party code goes into `NOTICE`.
## Legal and licensing
- HakiOS is an independent research project and is not affiliated with Apple. See `LEGAL.md`.
-- The kernel patch and files are APSL 2.0 (derived from XNU); everything else is MIT. Do not
- relabel XNU-derived code as MIT. New third-party code goes into `NOTICE` and
+- The kernel patch and files are APSL 2.0 (derived from XNU); everything else is MIT, but for a
+ patch to third-party code, which keeps that code's license. Do not relabel XNU-derived code as MIT. New third-party code goes into `NOTICE` and
`THIRD_PARTY_LICENSES.md` with its origin and license.
- Nothing of Apple's in the tree: no Darwin files, images, caches, screenshots or headers derived
from the firmware. Nothing of the vendor's firmware either. If you add a file whose origin or
diff --git a/LEGAL.md b/LEGAL.md
index d0f56fa..8f62fde 100644
--- a/LEGAL.md
+++ b/LEGAL.md
@@ -51,7 +51,8 @@ program that can write to flash, and CI fails if one appears that is not listed.
under its own license. They are listed with origin and license in `THIRD_PARTY_LICENSES.md`.
- **Pre-built artifacts** in `prebuilt/`: the kernel, user-space programs and libraries built
from this repository's own source. They carry the same licenses as the source they are built
- from.
+ from. Metal on Vulkan (`M2V=1`) and the window server's Metal plug-in are not among them: you fetch and
+ build those yourself, and whether a binary of them may be distributed is to verify (`COMPLIANCE.md`).
## What this repository does NOT contain and never distributes
diff --git a/NOTICE b/NOTICE
index 031ef5f..c2e98ed 100644
--- a/NOTICE
+++ b/NOTICE
@@ -20,6 +20,13 @@ In the repository:
- the Wi-Fi driver: Linux's ath11k (BSD-3-Clause-Clear) and FreeBSD's LinuxKPI headers (BSD-2-Clause) are
fetched by tools/mk-ath11k.sh at pinned releases and built on our layer wifi/lx (MIT); only the layer is here.
+- patches to Mesa, tools/mesa/*.patch, and the libdrm stand-in tools/mesa/hakios-drm/: Mesa's and X.Org's MIT terms.
+- patches to UniXNU's AdrenoMetal, tools/m2v/adrenometal-ios16.patch: MIT, Copyright (c) 2026 NativeMetal contributors.
+- a patch to steelbrain's metal2vulkan, tools/m2v/metal2vulkan-hakios.patch: GPL-2.0-or-later OR LGPL-3.0-or-later, as the code it
+ changes, not MIT.
+- userland/src/HakiosMetalCA.m: begun from vcvkk's plug-in (github.com/vcvkk/darwin-redwood, branch hakios-workspace, at eb9fdf5),
+ with this tree's changes. That origin's license is "to verify" (THIRD_PARTY_LICENSES.md).
+
Fetched at build time, never committed:
- the Darwin userland 16.5 IPSW (Apple): the user space of the system image; the user gets it and
@@ -29,4 +36,11 @@ Fetched at build time, never committed:
- the phone's firmware (GPU, Wi-Fi, audio DSP, modem, haptics, cameras): the vendor's, pulled from the
user's own phone (devices/redwood/pull-firmware.sh).
- lzfse (Apple, BSD-3-Clause), built by xnuloader/mkidentity.sh when no LZFSE decoder is installed.
-- Mesa (for GL=1 images), Procursus and Sileo packages (tools/mk-jb.sh): their own licenses.
+- Mesa (for GL=1 images; Turnip for TURNIP=1, tools/mk-turnip.sh), Procursus and Sileo packages (tools/mk-jb.sh): their own licenses.
+- hakios-metal (oosexgang, MIT), taken from beside this tree by userland/build.sh METAL_PLUGIN=ca.
+- for M2V=1, by tools/mk-m2v.sh, at pinned revisions: UniXNU's AdrenoMetal 243d63c (MIT, Copyright (c) 2026 NativeMetal contributors);
+ steelbrain's metal2vulkan 624bab3 (GPL-2.0-or-later OR LGPL-3.0-or-later) with AdrenoMetal's 30 patches; the Rust crates of its
+ Cargo.lock (MIT, Apache-2.0, ISC, Unlicense: their own licenses). None of it is in prebuilt/. A binary that statically links that
+ runtime has obligations, which are "to verify" before any distribution (THIRD_PARTY_LICENSES.md, COMPLIANCE.md).
+- QuartzCore's default.metallib for the window server's Metal (tools/ca-metallib.py): Apple's; what you supply from your own Mac or IPSW,
+ on your machine, never committed.
diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md
index 8a6f108..c89aa43 100644
--- a/THIRD_PARTY_LICENSES.md
+++ b/THIRD_PARTY_LICENSES.md
@@ -15,6 +15,10 @@ This supersedes the summary in `NOTICE`, which stays as the short, canonical lis
| libzbitmap | `xnu/files/bsd/miscfs/apfs/libzbitmap/`, `xnu-deps/build/lzbitmap/` | Corellium LLC (port of eafer/libzbitmap) | GPL-2.0+ OR MIT | used under MIT |
| LinuxKPI / Linux headers | `wifi/lx/include/linux/`, `wifi/lx/include/net/` | Linux / FreeBSD LinuxKPI | GPL-2.0 (Linux) / BSD-2-Clause (FreeBSD) | small compatibility headers; see each file's notice |
| Linux DRM shim | `tools/mesa/hakios-drm/`, `xf86drm.h` | Linux / X.Org | MIT | build-time shim for Mesa |
+| Mesa patches | `tools/mesa/*.patch` (`turnip-darwin.patch` among them) | changes to Mesa, HakiOS | MIT (Mesa's terms for the files they change) | patches only; Mesa itself is fetched |
+| AdrenoMetal patch | `tools/m2v/adrenometal-ios16.patch` | changes to UniXNU/AdrenoMetal, HakiOS | MIT, Copyright (c) 2026 NativeMetal contributors | patch only; the source is fetched. `tools/m2v/ios16-compat.h` is our own, MIT |
+| metal2vulkan patch | `tools/m2v/metal2vulkan-hakios.patch` | changes to steelbrain/metal2vulkan, HakiOS | GPL-2.0-or-later OR LGPL-3.0-or-later, as the code it changes; **not MIT** | patch only, and its context lines are their code. The file carries no notice of its own: **to verify** that this is enough |
+| The window server's Metal plug-in | `userland/src/HakiosMetalCA.m` | begun from vcvkk's `userland/src/HakiosMetal.m` (github.com/vcvkk/darwin-redwood, branch hakios-workspace, at eb9fdf5), with this tree's changes | **to verify**: that repository states no license (read 2026-11-04); this tree's changes are MIT | not in `prebuilt/` |
| AIR / Metal-library tooling | `tools/mesa/air/` | HakiOS (Darwin on redwood contributors) | MIT | our own; LLVM bitcode layout is a published format |
| mkbootimg.py | `devices/redwood/prebuilt/mkbootimg.py` | Android Open Source Project | Apache-2.0 | |
| Mu-Silicium / Project Mu derived files | `devices/redwood/uefi/` | Project Silicium, Microsoft, contributors | BSD-2-Clause-Patent; some GPL-2.0+ OR MIT | derived parts keep upstream license |
@@ -34,9 +38,26 @@ This supersedes the summary in `NOTICE`, which stays as the short, canonical lis
| lzfse | `xnuloader/mkidentity.sh` (when no decoder present) | Apple, github.com/lzfse/lzfse | BSD-3-Clause |
| ath11k (Wi-Fi driver) | `tools/mk-ath11k.sh` | Linux | BSD-3-Clause-Clear |
| Mesa (GL=1 images) | `tools/mk-mesa.sh` | Mesa project | MIT and others |
+| Turnip, Mesa's Vulkan driver (TURNIP=1) | `tools/mk-turnip.sh`, in `tools/mk-mesa.sh`'s tree | Mesa project, 25.0.7 | MIT and others |
+| hakios-metal (METAL_PLUGIN=ca) | beside this tree, `userland/build.sh` | [oosexgang/hakios-metal](https://github.com/oosexgang/hakios-metal) | MIT |
+| AdrenoMetal's frontend and bridge (M2V=1) | `tools/mk-m2v.sh`, pinned at `243d63c` | [UniXNU/AdrenoMetal](https://github.com/UniXNU/AdrenoMetal) | MIT, Copyright (c) 2026 NativeMetal contributors |
+| metal2vulkan (M2V=1) | `tools/mk-m2v.sh`, pinned at `624bab3`, with AdrenoMetal's 30 patches | [steelbrain/metal2vulkan](https://github.com/steelbrain/metal2vulkan) | `GPL-2.0-or-later OR LGPL-3.0-or-later`, the user's choice (its `LICENSE`) |
+| Rust crates of that build (M2V=1) | `cargo`, by `tools/mk-m2v.sh`; `xnu-deps/build/m2v/bridge/Cargo.lock` | crates.io: ash, libc, libloading, sha2 and their dependencies, 34 packages | those read: MIT OR Apache-2.0 (22), MIT (3), ISC (1), Unlicense OR MIT (1); the 7 not found in the local registry (proc-macro2, quote, serde, serde_derive, syn, unicode-ident, windows-link): **to verify** |
+| Rust's standard library (M2V=1) | the Rust 1.98 toolchain, target `aarch64-apple-ios` | the Rust project | MIT OR Apache-2.0 |
+| QuartzCore's `default.metallib` for the window server's Metal | `tools/ca-metallib.py`, from your own Mac or a later system's IPSW (`CA_QC_METALLIB=`) | Apple | Apple's: user supplies; the result stays on your machine and is never committed |
| Procursus / Sileo packages | `tools/mk-jb.sh` | Procursus team | their own licenses |
| Phone firmware (GPU, Wi-Fi, DSP, modem, haptics, cameras) | `devices/redwood/pull-firmware.sh` | Qualcomm / Xiaomi | vendor's — user's own device |
+## A binary built with `M2V=1`: to verify
+
+`userland/build.sh TURNIP=1 M2V=1` links `libadreno_metal_bridge.a`, which holds the metal2vulkan runtime (`GPL-2.0-or-later OR
+LGPL-3.0-or-later`), statically into the Metal plug-in (`HakiosMetal`) and into `m2v_test`, beside AdrenoMetal's frontend (MIT), the plug-in's
+own code and hakios-metal. Whoever distributes such a binary takes on that license's obligations for it, whichever of the two is chosen: under
+the LGPL, among others, a recipient's ability to relink against a changed library; under the GPL, the whole binary's source under compatible
+terms. What exactly that requires here, and whether the parts in the row above marked **to verify** allow it, is **to verify**, and has not
+been settled. Until it is, no such binary is distributed: nothing of it is in `prebuilt/` (`prebuilt/userland` has no `HakiosMetal`), and you
+fetch and build it yourself, on your machine. `libvulkan_freedreno.dylib` (Turnip) is a separate library, loaded at run time, under Mesa's terms.
+
## How to rebuild the inventory
- Tracked non-text/binary files: `git ls-files -z | xargs -0 file --mime-type | grep -v text/`