diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..1527aaab80 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,72 @@ +name: Bug report +description: Something doesn't boot, install or work the way it should. +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for reporting! Quick questions are faster on [Discord](https://discord.gg/M66z9fPJy5) (#help). + **Before attaching a log or photo, hide serial numbers, MAC addresses, Wi-Fi names, IP addresses and anything personal.** + - type: dropdown + id: kind + attributes: + label: Desktop or laptop? + options: [Desktop, Laptop] + validations: + required: true + - type: input + id: model + attributes: + label: Machine + description: Laptop model, or motherboard for a desktop. + placeholder: ASUS TUF A16 FA608PP / MSI B650 Tomahawk + - type: input + id: cpu + attributes: + label: CPU and RAM + placeholder: Ryzen 9 8940HX, 16 GB + validations: + required: true + - type: input + id: gpu + attributes: + label: GPU + description: Laptops, also say whether dGPU-only / MUX mode is on. + placeholder: RTX 5070 Laptop, dGPU-only mode on + validations: + required: true + - type: input + id: disk + attributes: + label: Disk macOS is on + placeholder: NVMe (KIOXIA ...), SATA in AHCI mode, ... + - type: input + id: network + attributes: + label: Network + placeholder: Realtek RTL8852CE Wi-Fi / Intel I225 Ethernet / ... + - type: input + id: version + attributes: + label: Stambha version + validations: + required: true + - type: textarea + id: what + attributes: + label: What happened + description: What you did, what you expected, and what you saw. A photo of the screen helps a lot. + validations: + required: true + - type: textarea + id: log + attributes: + label: Boot log + description: Attach the boot log file (each release explains how to save it). Drag the file into this box. + - type: checkboxes + id: masked + attributes: + label: Privacy + options: + - label: I removed serial numbers, MAC addresses, Wi-Fi names and IP addresses from what I attached. + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..44fbc3151c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Get help on Discord + url: https://discord.gg/M66z9fPJy5 + about: Install or boot trouble? The #help forum is the fastest way to an answer. + - name: Security issue + url: https://github.com/garvitsurana271/stambha/security/advisories/new + about: Report a security problem privately, not in a public issue. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000000..8714ebce42 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,20 @@ +name: Feature request +description: An idea for Stambha. +labels: ["enhancement"] +body: + - type: textarea + id: what + attributes: + label: What would you like? + description: Describe it from your side, as a user. + validations: + required: true + - type: textarea + id: why + attributes: + label: Why? + description: What it would let you do, and what you do today instead. + - type: input + id: hardware + attributes: + label: Your hardware (if it is hardware support) diff --git a/.github/ISSUE_TEMPLATE/hardware_report.yml b/.github/ISSUE_TEMPLATE/hardware_report.yml new file mode 100644 index 0000000000..8d31a701c0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/hardware_report.yml @@ -0,0 +1,56 @@ +name: Hardware report +description: Tell us how Stambha runs on your machine. These build the compatibility list. +labels: ["hardware report"] +title: "[Hardware] " +body: + - type: markdown + attributes: + value: Title it with the machine, e.g. "[Hardware] Lenovo Legion 5 Pro (2023)". Reports that something works are just as useful as reports that it doesn't. + - type: dropdown + id: kind + attributes: + label: Desktop or laptop? + options: [Desktop, Laptop] + validations: + required: true + - type: input + id: cpu + attributes: + label: CPU + validations: + required: true + - type: input + id: gpu + attributes: + label: GPU + validations: + required: true + - type: input + id: network + attributes: + label: Wi-Fi / Ethernet chips + - type: input + id: version + attributes: + label: Stambha version + validations: + required: true + - type: checkboxes + id: works + attributes: + label: What works + options: + - label: Installs + - label: Boots to the desktop + - label: Graphics acceleration + - label: Network in macOS (Ethernet or Wi-Fi) + - label: Audio + - label: Keyboard and touchpad / mouse + - label: Bluetooth + - label: Battery level (laptops) + - label: Sleep / lid (laptops) + - type: textarea + id: notes + attributes: + label: Notes + description: Anything that doesn't work, and anything you had to do to make it work. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000..a851a25aaf --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,15 @@ +## What this changes + + + +## How it was tested + + + +## Checklist + +- [ ] New behavior is opt-in (a boot option) unless it fixes a bug +- [ ] Tests cover the change (named as sentences, like the rest of the repo) +- [ ] Disk/installer changes keep the safety rules: free space only, every write read back, nothing trimmed +- [ ] Translator changes produce the same results as before (differential tests against the reference) +- [ ] No serials, MAC addresses, Wi-Fi names or other personal data in logs, tests or screenshots diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..a5c2f11c84 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# Contributing to Stambha + +Thanks for helping! There are three ways in, and all of them matter: + +- **Test and report.** Run Stambha on your hardware and post a + [hardware report](https://github.com/garvitsurana271/stambha/issues/new/choose), working or not. +- **Help others** in the [Discord](https://discord.gg/M66z9fPJy5) #help forum. +- **Send code.** Read on. + +## Building + +See "Build from source" in the [README](README.md). Host tests run with `cargo test -p `; the boot image builds +with `cargo xtask dist`. + +## How the code is written + +- **Explain the why.** Items carry doc comments that say what they do, why, and which Linux or Apple behavior they + follow (cite the file and line when porting). +- **Tests are sentences.** Name a test after the behavior it proves, e.g. + `a_saved_line_reads_back_as_its_network`. +- **Commit titles** follow `type(area): what it does, where it fixes something` (`fix(wifi): ...`, `feat(boot): ...`). +- **New behavior is opt-in.** A new feature gets a boot option and stays off until it is proven on hardware. Bug fixes + apply by default. +- Run `rustfmt` on what you change. + +## The safety rules + +Some code can hurt a user's data or silently give wrong answers, so it has a higher bar: + +- **Disks and the installer.** Stambha only ever writes into unallocated space, checks its plan against both GPT copies, + reads back every write before the next one, and never trims. A change here must keep all of that, with tests. +- **The translator and AMX.** A faster path must produce exactly the same results as the path it replaces: prove it + with the differential tests against the reference model, including NaNs, infinities, subnormals and rounding ties. +- **Privacy.** Logs, tests and screenshots never carry serial numbers, MAC addresses, Wi-Fi names, IP addresses or + other personal data. + +## Pull requests + +Keep each PR to one change, describe how you tested it, and fill in the checklist. Hardware changes are tested on real +hardware before they ship; say which machine you used. + +## Credits + +Your commits keep your name. Contributors get the Contributor role on Discord. diff --git a/README.md b/README.md index b6755c2c66..b0d18f6be9 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,80 @@ +

+ Stambha +

+

Stambha

-

स्तम्भ (stambha): "pillar", as in the pillars of Ashoka, India's ancient inscribed stone pillars.

+

+ Run Apple-silicon macOS on your PC.
+ Desktops and laptops. NVIDIA graphics. Installs over Ethernet or Wi-Fi. +

-Run Apple-silicon macOS on ordinary x86-64 PCs, desktops and laptops alike. Stambha boots from -a USB stick, translates macOS's arm64 code to x86-64 as it runs, and models the Apple hardware -macOS expects. +

+ Discord + License: GPL-2.0-or-later + Stars +

-The goal: macOS that works like it belongs on your machine. That means **speed**, the hardware -you actually have (**Wi-Fi, Bluetooth, sound**), and on laptops the things a laptop needs -(battery, touchpad gestures, the lid, brightness and keyboard keys). +

स्तम्भ (stambha): "pillar", as in the Ashoka pillars.

+ +--- + +Stambha boots from a USB stick and runs the **Apple-silicon (arm64) version of macOS** on an ordinary x86-64 PC. It +translates macOS's Arm code to x86 as it runs, drives your NVIDIA GPU through its own Metal driver, and recreates the +Apple hardware macOS expects. No Mac, no Hackintosh kexts, no virtual machine. > [!WARNING] > Experimental. It may not boot on your hardware, and it is slower than a real Mac. > Back up anything you care about before installing. -## Status +## ✨ What works | | | |---|---| -| **Wi-Fi**: Realtek RTL8852CE (Wi-Fi 6E, found in many recent laptops): scan, connect, DHCP, HTTPS | Working on real hardware with WPA2 (tested before macOS starts); WPA3 implemented but not yet hardware-tested; the in-macOS test is in progress | -| **Install safety**: installs only into empty (unallocated) space, reads back every partition-table write, refuses unexpected layouts, and offers a "Check only" dry run that writes nothing | Done | -| **Install progress**: a progress line every minute (stage, percent, speed), so a long install never looks frozen | Done | -| Faster installs, Bluetooth (Realtek), sound, battery and charging in macOS, a Magic-Trackpad-style touchpad, power button / lid / brightness / keyboard backlight, a guest profiler and speed-ups | In development on branches; each lands in `main` after review and a hardware test | -| More Realtek Wi-Fi chips (RTL8852BE, RTL8851BE, RTL8852AE, RTL8922AE) and full Wi-Fi speed (aggregation, 80/160 MHz) | In development | -| AMD Radeon and Intel graphics | In development | +| 🖥️ **macOS on your PC** | Apple-silicon macOS boots, with NVIDIA GPU acceleration (GTX 16, RTX 20/30/40/50) | +| 📶 **Install over Wi-Fi** | No Ethernet cable needed with a Realtek RTL8852CE (Wi-Fi 6E, in many recent laptops) | +| 🛡️ **A safe installer** | Only ever uses empty space on your disk; see [below](#-safe-for-the-system-you-already-have) | +| 📈 **Install progress** | A progress line every minute (stage, percent, speed), so a long install never looks frozen | -## Hardware requirements +## 🔧 Coming in the first release + +- ⚡ **Speed:** Apple's matrix unit (AMX) running natively on your CPU, faster translator paths, faster installs +- 📶 **Wi-Fi inside macOS**, and a Wi-Fi picker right in the boot menu with saved networks +- 💻 **Laptops:** battery level and charging, a Magic-Trackpad-style touchpad, brightness and keyboard-backlight keys, + power button and lid, audio fixes +- 🟦 **Bluetooth** (Realtek) +- 🧩 **Fixes for known issues** and the best community contributions + +Next after that: AMD and Intel graphics, more Wi-Fi chips and full Wi-Fi speed, and laptops presented as a MacBook. + +## 🛡️ Safe for the system you already have + +Installing macOS next to Windows or Linux should never risk them. Stambha's installer: + +- uses **only unallocated space**: it never resizes, moves or deletes a partition; +- checks the partition table it is about to write against **both** GPT copies, and refuses an unexpected layout; +- **reads back every write** before making the next one; +- offers **Check only**: a full dry run of the install plan that writes nothing at all. + +## 📋 Requirements | Part | Requirement | |---|---| -| CPU | Intel or AMD x86-64-v2 or newer. AVX2 and AVX-512 are used when present. | -| Memory | 8 GB or more (16 GB recommended). | -| Firmware | 64-bit UEFI with Secure Boot off. | -| GPU | NVIDIA GeForce GTX 16 or RTX 20/30/40/50 series. On laptops with a MUX switch, use dGPU-only mode. | -| Disk | NVMe, or SATA in AHCI mode, with 60 GB or more of **unallocated** space (shrink a partition first and leave the space unallocated). | -| Wi-Fi | Realtek RTL8852CE (more coming). | -| Ethernet | Intel, Realtek, Broadcom, Aquantia, Qualcomm Atheros, and common USB adapters. | +| CPU | Intel or AMD x86-64-v2 or newer (Intel Nehalem, AMD Bulldozer). AVX2 and AVX-512 are used when present. | +| Memory | 8 GB or more (16 GB recommended) | +| Firmware | 64-bit UEFI with Secure Boot off | +| GPU | NVIDIA GeForce GTX 16 or RTX 20/30/40/50 series. Laptops with a MUX switch: use dGPU-only mode. | +| Disk | NVMe, or SATA in AHCI mode, with **60 GB or more of unallocated space** (shrink a partition, leave the space empty) | +| Network | Ethernet (Intel, Realtek, Broadcom, Aquantia, Qualcomm Atheros, common USB adapters) or Realtek RTL8852CE Wi-Fi | +| USB stick | 8 GB or more | -## Getting it +## 🚀 Getting it -Releases are coming soon. Until then, build from source: +The first release is on its way. **[Join the Discord](https://discord.gg/M66z9fPJy5)** to get it the day it lands, to +test early builds, and to get help. + +
+Build from source ```sh git clone https://github.com/garvitsurana271/stambha @@ -47,29 +82,39 @@ cd stambha cargo xtask dist ``` -You need [Rust](https://rustup.rs), git, Python 3.10 or newer, and LLVM 21-23 with Clang, LLD and -libclang. The first build fetches and compiles Linux, Mesa and LLVM sources and takes a long time. -It writes `target/release/stela`: the command keeps its original name until the rename to -`stambha` lands. +You need [Rust](https://rustup.rs), git, Python 3.10 or newer, and LLVM 21-23 with Clang, LLD and libclang. The first +build fetches and compiles Linux, Mesa and LLVM sources and takes a long time. It writes `target/release/stela`: the +command keeps its original name until the rename to `stambha` lands. +
+ +## ❓ Questions + +Answers to the common ones (AMD/Intel graphics, hybrid-graphics laptops, Wi-Fi chips, virtual machines, how long an +install takes) are in the **#faq** channel on [Discord](https://discord.gg/M66z9fPJy5). Bugs and hardware reports: +[open an issue](https://github.com/garvitsurana271/stambha/issues/new/choose). + +## 🤝 Contributing + +Pull requests are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md). Testing on your hardware and posting a hardware +report helps just as much. ## Maintainer -**Garvit Surana** ([@garvitsurana271](https://github.com/garvitsurana271)). +**Garvit Surana** ([@garvitsurana271](https://github.com/garvitsurana271)) ## Credits -- Stambha is originally based on [Stela](https://github.com/tylertms/Stela) by Tyler Smith - (tylertms): the translator, the Metal driver and the Apple silicon hardware model come from his - work. His branches are kept here as `tyler/*`. +- Stambha is built on [Stela](https://github.com/tylertms/Stela) by Tyler Smith (tylertms): the translator, the Metal + driver and the Apple-silicon hardware model come from his work. Thank you, Tyler. - The Wi-Fi driver is a Rust port of Linux's `rtw89` by Realtek and the Linux wireless developers. - Its Linux sources are listed in [NOTICE](NOTICE). - Mesa, Linux and LLVM: see [NOTICE](NOTICE). +- Everyone who contributes code, tests and reports. ## Legal -Stambha contains no Apple software. You are responsible for following Apple's software license -agreement and terms of use. +Stambha contains no Apple software. You are responsible for following Apple's software license agreement and terms of +use. -Stambha's code is GPL-2.0-or-later. Files whose SPDX line says otherwise keep their own terms. The -boot program contains Linux code and is distributed as a whole under GPL-2.0-only; NOTICE gives -the terms for each program. See [LICENSE](LICENSE) and [NOTICE](NOTICE). +Stambha's code is GPL-2.0-or-later. Files whose SPDX line says otherwise keep their own terms. The boot program contains +Linux code and is distributed as a whole under GPL-2.0-only; NOTICE gives the terms for each program. See +[LICENSE](LICENSE) and [NOTICE](NOTICE). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..5d173369b1 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,14 @@ +# Security + +Stambha runs before your operating system starts, with full access to the machine's memory and disks, so security +problems matter. + +**Please report them privately**, not in a public issue: +[report a vulnerability](https://github.com/garvitsurana271/stambha/security/advisories/new) on GitHub. + +Include what you found, how to reproduce it, and what it lets an attacker do. You'll get an answer, and credit in the +fix unless you'd rather not. + +Examples of what counts: a way for macOS or a USB device to escape into the host or another device's memory, a path +that writes to a disk outside the macOS partition, or personal data (serials, MAC addresses, network names, keys) +reaching a log or the network. diff --git a/assets/stambha-icon.png b/assets/stambha-icon.png new file mode 100644 index 0000000000..6b4bb572f3 Binary files /dev/null and b/assets/stambha-icon.png differ diff --git a/assets/stambha-icon.svg b/assets/stambha-icon.svg new file mode 100644 index 0000000000..e34a702a7b --- /dev/null +++ b/assets/stambha-icon.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + +