跳到正文

Acelogic

Snapintosh

EL2 hypervisor and toolchain that boots macOS on the ASUS A16 (Snapdragon X2 Elite), with an Adreno Metal/IOGPU stack

README 已保存到本站,可直接阅读

Documentation snapshot

README 快照

这篇是英文原文

下面正文是项目自己的英文 README。想读全文就用浏览器自带的整页翻译: Chrome / Edge 点地址栏右侧的翻译图标,或用右键菜单里的「翻译成中文」; 手机浏览器一般在菜单里。

本页保存的是公开项目资料快照,阅读过程不需要连接 GitHub。

Snapintosh

图片:Snapintosh — macOS on Snapdragon; ASCII hands reaching toward a red chip

Snapintosh boots Apple’s macOS 27 (build 26A428) on an ASUS Zenbook A16 laptop with a Qualcomm Snapdragon X2 Elite (X2E-96-100). It is an EL2 monitor (hypervisor) and the toolchain around it. The monitor runs Apple’s stock kernelcache (the J700/T8140 kernel) unmodified by default. It supplies the platform contracts that the kernel expects from Apple silicon: the SPTM and TXM monitor calls, translation of the kernel’s 16 KiB page tables, and the Apple devices the kernel looks for.

Graphics run on the laptop’s own Adreno X2-90 GPU through a driver stack written for this project:

  • AdrenoMetal.bundle: a Metal driver plug-in.
  • AdrenoX2: an IOGPU kernel extension, with AdrenoDisplay driving the internal panel.
  • air2ir3: a shader compiler that translates Apple’s AIR (Metal’s IR) into Mesa’s ir3 for the Adreno.

There is no software, CPU or paravirtual rendering path.

The project also includes an I2C-HID keyboard and touchpad driver (SnapI2CHID), native QCC2072 Wi-Fi work, and NVMe storage through an emulated Apple storage controller.

Snapintosh is used together with q1n1, a UEFI EL2 proxy forked from Asahi Linux’s m1n1. q1n1 takes the machine at EL2 after UEFI and serves m1n1’s proxy protocol over USB-C to a Mac host, which drives Snapintosh from there.

Status

This is experimental software, written for one laptop model.

AreaState
macOS desktop on the A16Boots to the desktop with GPU acceleration. Rendering is correct: the pixel checks across the desktop test scenes pass.
SmoothnessIn progress. Interaction is usable but not yet smooth. The target is a steady ~60 Hz first and the panel’s 120 Hz later.
InputThe built-in keyboard and touchpad work, including trackpad gestures, Mission Control and app switching.
Wi-Fi (QCC2072)Scanning, a WPA2 connection, DHCP and ping work through a host-proxy harness driven from the Mac. Joining from the macOS Wi-Fi menu does not work yet.
StoragemacOS is installed on, and boots from, the internal NVMe.
Other hardwareAudio, cameras, Bluetooth, sleep and external displays are not supported.

docs/STATUS.md has the details, the known issues and the roadmap.

Required hardware

  • An ASUS Zenbook A16 with the Snapdragon X2 Elite X2E-96-100 (UX3607OA). Nothing else is supported. The monitor, device tables, clocks and register addresses are specific to this machine.
  • A Mac host running macOS 27, connected to the A16 over USB-C. q1n1 brings up a USB NCM network link on that cable, and every boot, upload and log capture goes over it.
  • AC power is strongly recommended. The tools refuse to boot or write the SSD below a battery threshold.

Architecture in brief

flowchart TD
    UEFI["A16 UEFI firmware"] --> Q1N1
    Q1N1["q1n1: UEFI EL2 proxy(USB-C NCM link to the Mac host)"] --> MON
    MON["Snapintosh EL2 monitorSPTM/TXM call emulation, 16K-to-4K shadow page tables,Apple device models (AIC, ANS2 NVMe, DART, ...), GPU ring and SMMU mediation"] --> XNU
    XNU["Stock macOS kernel at EL1 + AuxKC(AdrenoX2 + AdrenoDisplay, SnapI2CHID, ...)"] --> USER
    USER["macOS userspaceWindowServer, Core Animation, appsAdrenoMetal.bundle + air2ir3 compiler runtime"]
    HOST["Mac host: tools/cycle.py, q1n1 proxy client"] -. USB-C NCM .-> Q1N1
A16 UEFI -> q1n1 (EL2 proxy) -> Snapintosh monitor (EL2) -> XNU + AuxKC (EL1) -> userspace + Metal plug-in (EL0)

docs/ARCHITECTURE.md explains each layer.

Repository layout

PathContents
compat/the EL2 monitor: SPTM/TXM contracts, CPU, interrupt, timer and device emulation, the GPU ring and SMMU mediation, the NVMe backend
shadow/the page-table walker and the 16 KiB guest to 4 KiB hardware shadow tables
probes/the code that runs on the target (loader, monitor entry) and the host-side image builder and runner
tools/firmware acquisition, kernelcache analysis, the boot-cycle tool (cycle.py), build helpers and the native test suites
gpu/adreno-kext/the AdrenoX2 kext (kext/), the AdrenoMetal plug-in (plugin/) and the shared register and contract headers
gpu/air2ir3/the AIR to ir3 shader compiler (README)
gpu/agx*an earlier virtual-AGX model, kept for reference
drivers/smaller kexts: SnapI2CHID (snap-i2c-hid/), the QCC2072 Wi-Fi controller (snap-qcc2072/), the boot framebuffer, a loader test
config/monitor feature flags and guest launchd jobs
build/generated output (gitignored, apart from the AuxKC link helpers)
docs/design and reference documentation

Building

You need:

  • a Mac with Xcode (macOS 27 SDK);
  • the Kernel Debug Kit for build 26A428, installed at /Library/Developer/KDKs/KDK_27.0_26A428.kdk;
  • Python 3;
  • Homebrew LLVM, Meson and Ninja for the shader compiler. Its Mesa checkout is fetched and patched by gpu/air2ir3/tools/mesa-setup.sh;
  • a q1n1 checkout next to this one (../q1n1).

docs/BUILDING.md has the steps.

Bring your own Apple software

This repository ships no Apple, Qualcomm or ASUS binaries or firmware. You supply them yourself:

  • The macOS 27 restore image (IPSW). Download it from Apple with python3 tools/fetch-ipsw.py [destination]. Then extract the J700 boot set (kernelcache, device tree, SPTM, TXM and others) with python3 tools/extract-firmware.py j700ap. Nothing runs without it.
  • The Kernel Debug Kit for 26A428, from Apple’s developer downloads.
  • Device firmware. The Adreno GPU’s GMU and SQE microcode (gen80100_gmu.bin, gen80100_sqe.fw) and the QCC2072 Wi-Fi firmware come from the linux-firmware project. The Wi-Fi board file (bdwlan_qcc2072_1p0_ncm820A.elf) comes from ASUS’s Windows WLAN driver package for this model. The tools check each file against a pinned SHA-256.

The project depends on Apple software that each user must obtain and use under Apple’s terms.

Warning

Snapintosh is an experimental hypervisor that runs with full control of the machine.

  • It writes the internal NVMe SSD. Installing macOS changes the partition table, and the guest writes its own volumes. A bug can corrupt or destroy data on the SSD, including the Windows installation. Back up everything before you start, and keep a way to restore Windows.
  • It programs clocks, voltages, the GPU and memory-bandwidth votes directly. The tools refuse to run on low battery and stop the run when the SoC gets too hot (--thermal-guard), but those guards are not a guarantee.
  • It is not a supported or stable way to run macOS. Expect panics, hangs and cold reboots.

Use it at your own risk.

Snapintosh is an independent project. It is not affiliated with, endorsed by or sponsored by Apple, Qualcomm, ASUS or Asahi Linux. macOS, Metal and Apple are trademarks of Apple Inc. Snapdragon and Adreno are trademarks of Qualcomm Incorporated. Zenbook is a trademark of ASUSTeK Computer Inc. All other trademarks belong to their owners.

Running macOS on non-Apple hardware may conflict with Apple’s macOS software licence agreement. You are responsible for making sure that your use complies with the licences that apply to you.

License

The project’s own code is MIT licensed; see LICENSE. Some components carry other licences. Generated Mesa register tables keep Mesa’s MIT notice, and the QEMU tracer patch in tools/qemu-sptm-oracle/ is GPL-2.0-or-later. THIRD_PARTY_NOTICES.md and LICENSES/ list every third-party component and its licence text.

Credits

Snapintosh builds on the published work of others:

  • Asahi Linux and m1n1. q1n1 is a fork of m1n1, and Snapintosh uses m1n1’s proxy protocol, its Apple-silicon constants and its RTKit/mailbox knowledge.
  • Mesa and freedreno, for the ir3 compiler that air2ir3 builds on, the Adreno register database and the a6xx/a8xx driver code used as reference.
  • The Linux msm/drm, clk/qcom, ath12k, i2c-hid and GENI driver authors. Their drivers were read as hardware references. Snapintosh’s drivers are written from the interface facts, and one generated table is derived from Linux’s Adreno catalogue (see the notices).
  • jprx, for qemu-sptm and darwin-vm, used to observe Apple’s real SPTM/TXM as ground truth.
  • XNU sources from Apple Open Source, for reading the kernel’s side of each contract.

THIRD_PARTY_NOTICES.md has the complete list.

Documentation

ReadFor
docs/STATUS.mdwhat works, known issues, roadmap
docs/ARCHITECTURE.mdhow the layers fit together, including the GPU stack and Wi-Fi
docs/BUILDING.mdbuilding the monitor, kexts, plug-in and compiler
docs/RUNNING.mda boot cycle with tools/cycle.py
docs/KERNEL-PATCHES.mdthe opt-in kernel patches and why each exists
docs/BOOT-CHAIN.mdhow a stock macOS kernel boots on this SoC
docs/FULL-INSTALL.mdinstalling to and booting from the internal NVMe
docs/COMPATIBILITY.mdguest/host boundaries and pinned profiles
gpu/air2ir3/README.mdthe shader compiler
docs/WORKSPACE-LAYOUT.mdlocal inputs, generated output and what is never committed
docs/GUI-BOOT-ROADMAP.mdthe path from the first kernel instruction to the desktop

Official distribution

获取与安装

暂未发现可确认的官方软件包地址

当前 README 快照没有出现 npm、PyPI、Crates.io、pub.dev 等官方包页链接。本站不会根据仓库名称猜测下载地址。

本站不托管项目文件;需要安装时,请以项目维护者发布的官方文档为准。

使用前核验

本站保存公开资料用于阅读,不代表安全审计或功能背书。安装前请核对许可证、依赖来源和发布签名,不要直接运行来源不明的二进制文件或高权限脚本。