aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
GitHub aien-dev/aienux#38 (code only)
Apply it
git checkout -b patch-aa26c84591960860 f376589439fcd7aaf5080f90eb483b9c74d48793 curl -fsSL https://interplane.io/drakestapleton/aienux/patches/aa26c84591960860.patch | git am
Provenance
github-import 1
aien-dev/aienux
38
3c013d19bfadf4abbf4d5c257680aece563b0d42
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":38,"url":"https://github.com/aien-dev/aienux/pull/38","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:18Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..28ef02ac --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,73 @@ +# Contributing to AIENOS + +Thank you for considering it. AIENOS is experimental and pre-alpha; we welcome +contributions of code, review, design and testing. + +## Find something to work on + +- [ROADMAP.md](ROADMAP.md) shows the gates and links every open issue. +- Issues labelled `good first issue` are small and self-contained. +- Issues labelled `emulator-ok` need no special hardware: everything runs in + QEMU on an ordinary machine. +- Comment on an issue before starting larger work so effort is not duplicated. + Questions and ideas belong in GitHub Discussions. + +## Build and verify + +You need a Rust toolchain with two extra targets: + +```bash +rustup target add aarch64-unknown-uefi aarch64-unknown-none +bash scripts/verify_all.sh +``` + +`verify_all.sh` runs every workspace test, `clippy -D warnings`, the bare-metal +kernel build, and a format check of both UEFI images. It must pass before a +pull request is reviewed. + +For boot work, install QEMU for AArch64 and the AAVMF UEFI firmware (on Ubuntu: +`qemu-system-arm` and `qemu-efi-aarch64`). An automated emulator boot is being +added in [#18](https://github.com/aien-dev/aienos/issues/18); once it lands it +becomes part of `verify_all.sh`. + +## Rules for code + +- **Rust.** Small AArch64 assembly is fine where the hardware requires it. +- **No Python, no CUDA, no CUDA-shaped APIs** anywhere in the repository. +- **Sovereign trusted base.** Boot, kernel, memory management, scheduling, + storage, cryptography, identity, AEGIS and recovery build from inspectable + source, offline. Do not add proprietary binaries, cloud services or network + fetches to the build. +- **Dependencies are rare.** Prefer small in-house code for the trusted base + (the kernel carries its own SHA-256 and HMAC). Explain any new crate in the + pull request. +- **Tests.** New behaviour comes with host tests; anything that touches the + boot path must build for `aarch64-unknown-uefi` and `aarch64-unknown-none`. + +## Pull requests + +- One concern per pull request. +- Lead the description with proof: the commands you ran and their output. +- Claims about speed or hardware behaviour need recorded evidence. +- House style for docs and comments: plain language, no em dashes or en dashes. +- Changes that touch the root of trust, security boundaries, persistent + identity, irreversible data formats or recovery guarantees need maintainer + and operator sign-off; see the escalation triggers in + [docs/MILESTONES.md](docs/MILESTONES.md). + +## Hardware + +Machine 1 is an NVIDIA DGX Spark. Work that needs it is labelled +`needs-hardware`; maintainers run those boots under the `aien-proof` +hardware-test ledger and publish the evidence in `evidence/`. You can still +design and review that work, and most of it can be prototyped in QEMU first. + +## Security + +Report vulnerabilities privately through GitHub's "Report a vulnerability" +(Security advisories) on this repository, not in public issues. + +## License + +AIENOS is licensed under Apache-2.0 WITH LLVM-exception. By submitting a +contribution you agree that it is licensed under the same terms. diff --git a/README.md b/README.md index 4b36244f..950bfd60 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,25 @@ # AIENOS -> **Status: experimental / pre-alpha.** Nothing here boots yet. No support, stability, or compatibility promises. Expect breaking changes. +> **Status: experimental / pre-alpha.** The first native boot on the NVIDIA DGX Spark passed on 2026-09-24 ([evidence](evidence/m2_first_boot_2026-09-24.md)); the operating system itself is far from usable. No support, stability, or compatibility promises. Expect breaking changes. + +## Help build AIENOS + +We are building a sovereign, agent-native operating system in Rust, from the +first instruction after firmware upward, and we want help. Kernel isolation, +memory management, interrupts, scheduling, storage, networking and native +inference are all open, and most of it can be developed and tested in QEMU on +any machine: no special hardware needed. + +- **[ROADMAP.md](ROADMAP.md)**: where the project is, the gates ahead, and live + progress for each milestone. +- **[Open issues](https://github.com/aien-dev/aienos/issues)**: start with + [`good first issue`](https://github.com/aien-dev/aienos/labels/good%20first%20issue) + or anything labelled + [`emulator-ok`](https://github.com/aien-dev/aienos/labels/emulator-ok). +- **[CONTRIBUTING.md](CONTRIBUTING.md)**: build, verify, and the rules for the + trusted base. +- **[Discussions](https://github.com/aien-dev/aienos/discussions)**: questions, + design ideas, and introductions. AIENOS is an agent-native operating system designed around continuous logical agent existence: the agent persists while models, kernels, inference state, power states, and physical machines change beneath it. You turn the machine on, the agent wakes up, knows the machine and your history, operates nearly everything inside it, and asks you only before crossing a boundary you have told it not to cross alone. @@ -23,7 +42,7 @@ An optional compatibility island (for example, Linux with vendor drivers) may si Power on, AIENOS boots directly on the NVIDIA DGX Spark (no Linux host), the AIEN agent starts on a local console, a local model loads, you talk to it, and its state persists across reboot. CPU inference is acceptable for this milestone. -Two UEFI images are available. The default diagnostic prints a banner and returns to firmware. The separate handoff image exits UEFI boot services, counts conventional-memory pages, selects a validated region, initializes early frame allocator bookkeeping, enters the kernel UART path, and halts. Neither image has been booted on the DGX Spark. The allocator does not yet dereference physical memory; storage, agent-state recovery, and model loading are also missing, so this milestone remains open. Host verification checks the AArch64 EFI image format without changing the boot configuration. +Two UEFI images are available. The default diagnostic prints a banner and returns to firmware. The handoff image discovers the CPU topology, memory map, display and GB10 identity, exits UEFI boot services, enters the AIENOS kernel, reports what it found on screen, in a bounded firmware variable and on the serial port, then resets. It booted natively on the DGX Spark on 2026-09-24 (`kernel: alive` at EL2, 20 cores in two efficiency classes, 184 memory-map descriptors with none rejected) and returned to Linux without damage. Kernel isolation, storage, agent-state recovery and model loading are still missing, so this milestone remains open; see [ROADMAP.md](ROADMAP.md). The AIENOS boot path is a native Rust UEFI entry followed by the AIENOS kernel. It does not use systemd or a Linux init system. The handoff image emits counter-based timings for UEFI entry to kernel handoff and handoff to kernel entry once it runs on hardware. These timings do not include platform firmware time before UEFI starts the image. diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 00000000..c7e187b7 --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,99 @@ +# AIENOS Roadmap + +AIENOS is an agent-native operating system built in the open. This file is the +public map: where the project is, what is next, and where you can help. +**Live progress** is on the GitHub milestone pages linked below: each progress +bar moves as issues close. This file is updated at every gate. + +## Status (updated 2026-09-24) + +```text +M0 PARTIAL Reference freeze + reference snapshot PASS + benchmark evidence PASS 54.2 tokens/s CPU decode baseline + native-boot rollback PASS + bootable recovery media PENDING + +M1 IN PROGRESS Emulator boot + automated QEMU boot IN PROGRESS + +M2 PASS First native Spark boot (2026-09-24) + follow-ups: observability, console, GB10 discovery, keyboard, test rig + +NEXT HARD GATE: +recovery media -> QEMU regression boot -> M3 kernel isolation +``` + +The first native boot on the NVIDIA DGX Spark ("Machine 1") passed on +2026-09-24: the machine left firmware, ran AIENOS code at EL2 with no Linux +underneath (`kernel: alive`), left a report that Linux read after the reset, +and returned to Linux undamaged. Full record: +[evidence/m2_first_boot_2026-09-24.md](evidence/m2_first_boot_2026-09-24.md). + +## Critical path + +```text +M0 Reference freeze + -> M1 Emulator boot + -> M2 Spark bring-up + -> M3 Kernel isolation + -> M4 Storage and recovery + -> M5 Encryption and identity + -> M6 Minimal networking + -> M7 Native CPU inference + -> M8 Persistent agent first vision proven +``` + +The first public demonstration is M8: power on, AIENOS boots, you talk to the +local agent, power off, power on, and it remembers. + +## Gates + +| Gate | Milestone (live progress) | Open work | Done so far | +| --- | --- | --- | --- | +| M0 Reference freeze | [M0](https://github.com/aien-dev/aienos/milestone/1) | [#17](https://github.com/aien-dev/aienos/issues/17) recovery media | [#12](https://github.com/aien-dev/aienos/pull/12) Rust evidence tooling and clean snapshot ([9bd233d](https://github.com/aien-dev/aienos/commit/9bd233d)) | +| M1 Emulator boot | [M1](https://github.com/aien-dev/aienos/milestone/2) | [#18](https://github.com/aien-dev/aienos/issues/18) QEMU boot, [#19](https://github.com/aien-dev/aienos/issues/19) CI | QEMU 8.2 and AAVMF chosen as the emulator | +| M2 Spark bring-up | [M2](https://github.com/aien-dev/aienos/milestone/3) | [#20](https://github.com/aien-dev/aienos/issues/20) pre-exit file, [#21](https://github.com/aien-dev/aienos/issues/21) screen evidence, [#22](https://github.com/aien-dev/aienos/issues/22) UART via SPCR, [#23](https://github.com/aien-dev/aienos/issues/23) GB10 discovery, [#24](https://github.com/aien-dev/aienos/issues/24) USB keyboard, [#25](https://github.com/aien-dev/aienos/issues/25) test rig | Gate passed: [#10](https://github.com/aien-dev/aienos/pull/10) memory handoff, [#11](https://github.com/aien-dev/aienos/pull/11) GB10 identity, [#13](https://github.com/aien-dev/aienos/pull/13) visible report ([a22b1d8](https://github.com/aien-dev/aienos/commit/a22b1d8)), [#14](https://github.com/aien-dev/aienos/pull/14) CPU topology ([44fcba7](https://github.com/aien-dev/aienos/commit/44fcba7)), [#15](https://github.com/aien-dev/aienos/pull/15) first-boot image ([52109bc](https://github.com/aien-dev/aienos/commit/52109bc)), [#16](https://github.com/aien-dev/aienos/pull/16) evidence ([f376589](https://github.com/aien-dev/aienos/commit/f376589)) | +| M3 Kernel isolation | [M3](https://github.com/aien-dev/aienos/milestone/4) | [#26](https://github.com/aien-dev/aienos/issues/26) vectors, [#27](https://github.com/aien-dev/aienos/issues/27) MMU, [#28](https://github.com/aien-dev/aienos/issues/28) timer and GIC, [#29](https://github.com/aien-dev/aienos/issues/29) topology-aware scheduler, [#30](https://github.com/aien-dev/aienos/issues/30) IPC and capabilities | Frame allocator, bounded UART, fault capture used on the first boot | +| M4 Storage and recovery | [M4](https://github.com/aien-dev/aienos/milestone/5) | [#31](https://github.com/aien-dev/aienos/issues/31) NVMe and System Store | Host-tested store and WAL recovery | +| M5 Encryption and identity | [M5](https://github.com/aien-dev/aienos/milestone/6) | [#32](https://github.com/aien-dev/aienos/issues/32) | Host-tested agent identity (ADR 0007) | +| M6 Minimal networking | [M6](https://github.com/aien-dev/aienos/milestone/7) | [#33](https://github.com/aien-dev/aienos/issues/33) | | +| M7 Native CPU inference | [M7](https://github.com/aien-dev/aienos/milestone/8) | [#34](https://github.com/aien-dev/aienos/issues/34) | Linux baseline recorded in M0 | +| M8 Persistent agent | [M8](https://github.com/aien-dev/aienos/milestone/9) | [#35](https://github.com/aien-dev/aienos/issues/35) | Host-tested Cortex store | + +Separate lanes that never block the critical path: +[#36](https://github.com/aien-dev/aienos/issues/36) GB10 characterization (no GPU +execution yet) and [#37](https://github.com/aien-dev/aienos/issues/37) Fabric +(after native networking). + +Related repositories: [aien-sovereign-core](https://github.com/aien-dev/aien-sovereign-core) +holds the AIEN runtime, Cortex, AEGIS and `aien-proof`, the shared test board +and hardware-test ledger ([#124](https://github.com/aien-dev/aien-sovereign-core/pull/124), +[#126](https://github.com/aien-dev/aien-sovereign-core/pull/126)). + +## Help build it + +AIENOS is a lot of low-level Rust, and most of it does not need our hardware. +Everything labelled [`emulator-ok`](https://github.com/aien-dev/aienos/labels/emulator-ok) +can be built and tested in QEMU on any machine. Good places to start: + +- [`good first issue`](https://github.com/aien-dev/aienos/labels/good%20first%20issue): + small, self-contained changes. +- [`help wanted`](https://github.com/aien-dev/aienos/labels/help%20wanted): + kernel, boot, evidence and tooling work that is ready for a contributor. +- M3 kernel isolation (exceptions, MMU, GICv3, scheduler, IPC) is the next + large body of work, and all of it runs in the emulator. + +Work labelled [`needs-hardware`](https://github.com/aien-dev/aienos/labels/needs-hardware) +runs on Machine 1; maintainers execute it and publish the evidence. Read +[CONTRIBUTING.md](CONTRIBUTING.md) before your first pull request. + +## Ground rules + +- Rust throughout, with small amounts of AArch64 assembly where the hardware + requires it. No Python, no CUDA, and no CUDA-shaped APIs. +- The trusted base builds from inspectable source, offline, with an + independently obtainable toolchain. +- Evidence earns claims: a boot, benchmark or fix counts when its output is + recorded and reproducible. +- Experimental and pre-alpha: no support, stability or compatibility promises. diff --git a/docs/MILESTONES.md b/docs/MILESTONES.md index 7c249344..afe80763 100644 --- a/docs/MILESTONES.md +++ b/docs/MILESTONES.md @@ -32,11 +32,11 @@ only at M8. Status words: **done** = verified on this repository's evidence; | Gate | Scope | Status | Evidence / blocker | |---|---|---|---| -| **M0** Close Config A | Clean reference snapshot | done | PR #12: schema 3.0.0 bundle, all repositories clean | +| **M0** Close Config A (**partial**) | Clean reference snapshot | done | PR #12: schema 3.0.0 bundle, all repositories clean | | | Benchmark evidence | done | CPU baseline: Llama-3.2-1B Q4_K_M on 20 Arm cores, 256-token samples, mean decode 54.2 tokens/s | | | Native-boot rollback | done | First native boot returned to Linux on its own; BootNext consumed, Linux entry and kernel unchanged ([M2 evidence](../evidence/m2_first_boot_2026-09-24.md)) | | | Bootable recovery media | pending | The only USB stick holds a key backup, not a recovery system | -| **M1** UEFI/QEMU substrate | Automated emulator boot proof | pending | No `qemu-system-aarch64` or AArch64 UEFI firmware on the host; UEFI images are format-checked only | +| **M1** UEFI/QEMU substrate | Automated emulator boot proof | in progress | QEMU 8.2 and AAVMF installed; [#18](https://github.com/aien-dev/aienos/issues/18), CI in [#19](https://github.com/aien-dev/aienos/issues/19) | | **M2A** Spark firmware handoff | Memory map into early allocator | done on hardware | PR #10; 184 descriptors, 36 conventional regions, 0 rejected ([M2 evidence](../evidence/m2_first_boot_2026-09-24.md)) | | | GB10 PCI identity, BAR0, PMC_BOOT registers | built, not found on hardware | PR #11; pre-exit discovery reported `gb10: unavailable` although Linux sees it at `000f:01:00.0` | | | CPU topology from the ACPI MADT (efficiency classes) and boot-core MIDR | done on hardware | 10 cores in class 0, 10 in class 1; boot core class 0, MIDR part `0xd87` (Cortex-A725) ([M2 evidence](../evidence/m2_first_boot_2026-09-24.md)) | @@ -53,6 +53,17 @@ only at M8. Status words: **done** = verified on this repository's evidence; | **M7** AIEN runtime and native CPU inference | | pending | Compare against the M0 CPU baseline | | **M8** Cortex and persistent agent | | pending | Host crates exist (`cortex`, `agent-state`) | +**Overall gate status (2026-09-24):** + +```text +M0 PARTIAL snapshot PASS, benchmark PASS, rollback PASS, recovery media PENDING +M1 IN PROGRESS automated QEMU boot +M2 PASS first native Spark boot +NEXT HARD GATE: recovery media -> QEMU regression boot -> M3 kernel isolation +``` + +Public roadmap and contributor entry points: [ROADMAP.md](../ROADMAP.md). + **Secure Boot (operator decision 2026-09-24, escalation trigger 1):** disabled for early development only, so unsigned experimental images can be tested. No other security mechanism is relaxed. Before daily use: operator-owned key,