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 42deb38383..c5c467493a 100644 --- a/README.md +++ b/README.md @@ -1,106 +1,101 @@ -

-
- Stela -

+

Stambha: Apple-silicon macOS, on the PC you already have. It runs the real, unmodified Apple-silicon macOS on an ordinary Intel or AMD PC, translating it as it runs. Status: NVIDIA works; AMD experimental; Intel in testing; Wi-Fi works on RTL8852CE; laptops partly; sound and Bluetooth coming. Speed: Stambha 0.6.1 is about 1.5x Stela 0.5.0; more speed is in progress.

+

Download Stambha 0.6.1 Join the Discord Website

+

Stambha runs the real, unmodified Apple-silicon macOS on ordinary Intel and AMD PCs, desktops and laptops, from a USB stick. Free and open source.

-A translation-based Apple Silicon layer for x86-64 PCs. It is a UEFI boot -program with an arm64-to-x86-64 translator, a Metal driver for NVIDIA GPUs and -a model of Apple silicon hardware. Stela currently presents itself as an M2 Mac mini. + + +## The details + +| | What it means | +|---|---| +| 🖥️ **macOS on your PC** | Apple-silicon macOS boots, with NVIDIA GPU acceleration (GTX 16, RTX 20/30/40/50) | +| ⚡ **About 1.5x faster than Stela 0.5.0** | Hundreds of translator and engine improvements, and Apple's matrix engine (AMX) running natively on your CPU | +| 🛡️ **Steady** | No Wi-Fi freezes, laptop touchpads stay working, and a macOS crash stops cleanly with the log saved | +| 📶 **Wi-Fi** | Install over Wi-Fi and network inside macOS with a Realtek RTL8852CE; more chips experimental | +| 🎮 **AMD & Intel graphics** | Experimental: Radeon RX 6000 and RX 7000 cards boot macOS, and Intel built-in graphics now reach the macOS desktop in test builds (RX 9000 in testing; early builds on Discord) | + +## 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's 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. > [!WARNING] -Stela is still in development. It is slow and still may not boot on supported hardware. Fixes are on the way, please submit a GitHub Issue with your boot logs if you encounter an error! +> Experimental. It may not boot on your hardware, and it's slower than a real Mac. Back up anything you care about. -## Translator +## Get started -An ahead-of-time and just-in-time compiler translates arm64e code to x86-64. -It covers more than 3,000 AArch64 instruction encodings, maps guest registers -to host registers and caches translated code. +1. **[Download Stambha](https://github.com/garvitsurana271/stambha/releases/latest)** for Windows or Linux. AMD or Intel + graphics? Grab the [experimental build](https://github.com/garvitsurana271/stambha/releases/tag/v0.6.1-gpu-experimental), + or the latest test build on Discord. +2. **Make the USB stick:** run `stambha create` and pick your stick. Already on Stela? `stambha update` keeps your macOS. +3. **Boot from the stick** and choose **Install macOS**. It installs into empty space next to your other systems. -## NVIDIA driver +Stuck? **[Join the Discord](https://discord.gg/M66z9fPJy5)**: help, hardware reports and early builds live there. -The Metal driver compiles AIR, Metal's shader IR, directly to NIR, Mesa's IR, -and supports the Metal3 and Apple7 GPU families. - -## Hardware requirements +
+Requirements +
| Part | Requirement | |---|---| -| CPU | Intel or AMD x86-64-v2 (Intel Nehalem, AMD Bulldozer or newer). AVX2 and AVX-512 are used when present. | -| Memory | 8 GB or more. | -| Firmware | 64-bit UEFI with Secure Boot off. | -| GPU | NVIDIA GeForce GTX 16 or RTX 20, 30, 40 or 50 series. | -| Disk | NVMe, or SATA in AHCI mode. 60 GB or more for macOS: a GPT partition or a whole disk to erase. | -| USB stick | 8 GB for the Online installer, 32 GB for the Offline installer. | -| Ethernet | Intel I225, I226, I210, I211, I350, 82574L, 82575, 82576, 82579, 82580, I217, I218, I219.
Realtek RTL8111, RTL8168, RTL8169, RTL8411, RTL8125, RTL8126, Killer E2600, E3000.
Broadcom BCM5720, BCM5761, BCM5762.
Aquantia AQC100, AQC107, AQC108, AQC109, AQC111, AQC112, AQC113, AQC114, AQC115C, AQC116C.
Qualcomm Atheros AR8131, AR8132, AR8151, AR8152, AR8161, AR8162, AR8171, AR8172, Killer E2200, E2400, E2500.
USB: Realtek RTL8152, RTL8153, RTL8156, ASIX AX88179, AX88178A, AX88772, CDC ECM and NCM. | -| Wi-Fi | None currently supported. | -| Bluetooth | None currently supported. | -| Audio | None currently supported. | -| USB | xHCI (USB 3) and EHCI controllers, hubs, USB disks. | -| Input | USB keyboards and mice. PS/2 keyboards, mice and Synaptics or Elantech touchpads. | +| 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 with a graphics card (16 GB recommended). Built-in graphics borrow part of the RAM, so use 12 GB or more | +| 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. AMD and Intel: experimental | +| 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 | -## Install +
-1. Download `stambha` from the - [releases page](https://github.com/tylertms/Stela/releases). -2. Run `sudo ./stambha` (Linux, macOS) or double-click `stambha.exe` - (Windows). -3. Choose the USB stick and the installer, then confirm. This erases the USB - stick. -4. Boot the PC from the USB stick. - -## Update - -Download the new `stambha`, plug the USB stick in and run: +
+Build from source +
```sh -sudo ./stambha update -``` - -On Windows, open Terminal with Run as administrator and run: - -``` -.\stambha.exe update -``` - -## Logs - -If Stela does not work, plug the USB stick into any computer with `stambha` and -save the boot log. Include `log.txt` in your GitHub Issue. Save it before you -start Stela again many times: the log keeps the start of each of the last -eight boots, but only the latest part of a long run. - -```sh -sudo ./stambha log --output log.txt -``` - -On Windows, open Terminal with Run as administrator and run: - -``` -.\stambha.exe log --output log.txt -``` - -## Build - -You need [Rust](https://rustup.rs), git, Python 3.10 or newer, and LLVM 21, -22 or 23 with Clang, LLD and libclang. On macOS, Xcode's Apple clang 21 or -newer also works. - -```sh -git clone https://github.com/tylertms/Stela -cd Stela +git clone https://github.com/garvitsurana271/stambha +cd stambha cargo xtask dist ``` -This writes `target/release/stambha`. The first build fetches and compiles -Linux, Mesa and LLVM sources and takes a long time. +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. +
+ +## What's next + +- **0.6.2:** Intel graphics, safer installs over flaky networks, many fixes from your logs +- **0.6.5:** sound and Bluetooth +- **The next big release:** big speed work, real Wi-Fi inside macOS, AMD and Intel graphics in the main build, laptop battery, brightness and sleep, and an installer app with a hardware check + +## Contributing + +Pull requests are welcome: see [CONTRIBUTING.md](CONTRIBUTING.md). Testing on your hardware and posting a hardware +report helps just as much. Questions: the **#faq** channel on [Discord](https://discord.gg/M66z9fPJy5). Bugs: +[open an issue](https://github.com/garvitsurana271/stambha/issues/new/choose). + +Contributors + +## Credits + +- 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. +- Mesa, Linux and LLVM: see [NOTICE](NOTICE). +- Everyone who contributes code, tests and reports. + +Maintained by **Garvit Surana** ([@garvitsurana271](https://github.com/garvitsurana271)). ## Legal -Stela 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](NOTICE) gives the terms for each program. +See [LICENSE](LICENSE). -Stela's code is GPL-2.0-or-later. See [LICENSE](LICENSE) and [NOTICE](NOTICE). - -## Community - -[Discord Server](https://discord.gg/aSkwrJEMYc) +

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

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/readme/btn-discord-dawn.svg b/assets/readme/btn-discord-dawn.svg new file mode 100755 index 0000000000..cd480b3768 --- /dev/null +++ b/assets/readme/btn-discord-dawn.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/readme/btn-discord-night.svg b/assets/readme/btn-discord-night.svg new file mode 100755 index 0000000000..33696e8016 --- /dev/null +++ b/assets/readme/btn-discord-night.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/readme/btn-download-dawn.svg b/assets/readme/btn-download-dawn.svg new file mode 100755 index 0000000000..ff340b9fd7 --- /dev/null +++ b/assets/readme/btn-download-dawn.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/readme/btn-download-night.svg b/assets/readme/btn-download-night.svg new file mode 100755 index 0000000000..ff340b9fd7 --- /dev/null +++ b/assets/readme/btn-download-night.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/readme/btn-website-dawn.svg b/assets/readme/btn-website-dawn.svg new file mode 100755 index 0000000000..82364b7445 --- /dev/null +++ b/assets/readme/btn-website-dawn.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/readme/btn-website-night.svg b/assets/readme/btn-website-night.svg new file mode 100755 index 0000000000..ba1f0468fe --- /dev/null +++ b/assets/readme/btn-website-night.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/assets/readme/canvas-dawn.svg b/assets/readme/canvas-dawn.svg new file mode 100755 index 0000000000..d7437c87d4 --- /dev/null +++ b/assets/readme/canvas-dawn.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/readme/canvas-night.svg b/assets/readme/canvas-night.svg new file mode 100755 index 0000000000..fba47bb5bf --- /dev/null +++ b/assets/readme/canvas-night.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 @@ + + + + + + + + + + + + + + + + + + + +