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#4 (code only)
Apply it
git checkout -b patch-5a5f0ca40b09af32 28c939c1b5133557277a8a5d5df7901eb040ef87 curl -fsSL https://interplane.io/drakestapleton/aienux/patches/5a5f0ca40b09af32.patch | git am
Provenance
github-import 1
aien-dev/aienux
4
0d1107a0fefe194f5f43d1a8fa6e188b05ca27e1
{"kind":"github-import","owner":"aien-dev","repo":"aienux","number":4,"url":"https://github.com/aien-dev/aienux/pull/4","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:21Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/Cargo.lock b/Cargo.lock index c8a7ef88..25de2299 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,6 +23,13 @@ dependencies = [ "serde_json", ] +[[package]] +name = "aienos-boot" +version = "0.1.0" +dependencies = [ + "uefi", +] + [[package]] name = "aienos-c1-tree" version = "0.1.0" @@ -46,12 +53,36 @@ dependencies = [ name = "aienos-kernel" version = "0.1.0" +[[package]] +name = "bit_field" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" + +[[package]] +name = "bitflags" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" + +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + [[package]] name = "itoa" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" +[[package]] +name = "log" +version = "0.4.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" + [[package]] name = "memchr" version = "2.8.3" @@ -67,6 +98,26 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "ptr_meta" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743da816b98c921cdbe8628ef7381b76f25ecf4da599fc80aca90eae7ef70cc0" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c8d9ca532f185d5d4db7a7c9d51420b452168ea1c2b913953281bd6fe1fcbd0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "quote" version = "1.0.47" @@ -130,6 +181,58 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "ucs2" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79298e11f316400c57ec268f3c2c29ac3c4d4777687955cd3d4f3a35ce7eba" +dependencies = [ + "bit_field", +] + +[[package]] +name = "uefi" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368cef7d94514897e6dad4350945c7910a9f5bf9021191d1c58ee3ec09962697" +dependencies = [ + "bitflags", + "cfg-if", + "log", + "ptr_meta", + "ucs2", + "uefi-macros", + "uefi-raw", + "uguid", +] + +[[package]] +name = "uefi-macros" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643efa8b64be89780bc498b290fab04337c7c4d171cc82cce2e133a74616dcc4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "uefi-raw" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3636327a6d88a38c0f2567fb695ec7ba27b3483d1877730486605aa0866da201" +dependencies = [ + "bitflags", + "uguid", +] + +[[package]] +name = "uguid" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c8352f8c05e47892e7eaf13b34abd76a7f4aeaf817b716e88789381927f199c" + [[package]] name = "unicode-ident" version = "1.0.26" diff --git a/Cargo.toml b/Cargo.toml index e13fb942..180c227d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,6 +6,7 @@ members = [ "crates/aienos-cortex", "crates/aienos-aegis", "crates/aienos-c1-tree", + "crates/aienos-boot", ] [workspace.package] diff --git a/README.md b/README.md index ee52e13b..0e99bedc 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ 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. +The current UEFI image is a firmware-entry diagnostic. It prints a banner and returns to firmware. It does not yet transfer control to the native kernel, load a model, or meet this milestone. The host verification script checks its AArch64 EFI image format without changing the host boot configuration. + ## Principles - **Sovereignty:** no outside organization is required to boot the machine, access your data, authenticate you, authorize the agent, build the trusted core, recover, change models, move hardware, or keep operating. diff --git a/crates/aienos-boot/Cargo.toml b/crates/aienos-boot/Cargo.toml new file mode 100644 index 00000000..39b823af --- /dev/null +++ b/crates/aienos-boot/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "aienos-boot" +version.workspace = true +edition.workspace = true +authors.workspace = true +license.workspace = true +repository.workspace = true +description = "AArch64 UEFI entry diagnostic for AIENOS native boot bring-up" + +[features] +default = [] +firmware = ["dep:uefi"] + +[dependencies] +uefi = { version = "0.41", default-features = false, features = ["panic_handler"], optional = true } + +[[bin]] +name = "aienos-boot" +path = "src/main.rs" +required-features = ["firmware"] diff --git a/crates/aienos-boot/src/lib.rs b/crates/aienos-boot/src/lib.rs new file mode 100644 index 00000000..ab069fb2 --- /dev/null +++ b/crates/aienos-boot/src/lib.rs @@ -0,0 +1,7 @@ +#![no_std] + +/// Diagnostic banner emitted while UEFI boot services are still available. +pub const FIRMWARE_BANNER: &str = "AIENOS firmware entry: aarch64"; + +/// The UEFI diagnostic never provisions or reconstructs an agent identity. +pub const CREATES_AGENT_IDENTITY: bool = false; diff --git a/crates/aienos-boot/src/main.rs b/crates/aienos-boot/src/main.rs new file mode 100644 index 00000000..eea9a3c2 --- /dev/null +++ b/crates/aienos-boot/src/main.rs @@ -0,0 +1,12 @@ +#![no_std] +#![no_main] + +use uefi::prelude::*; + +#[entry] +fn main() -> Status { + uefi::println!("{}", aienos_boot::FIRMWARE_BANNER); + uefi::println!("firmware services: active"); + uefi::println!("kernel handoff: not implemented"); + Status::SUCCESS +} diff --git a/scripts/verify_all.sh b/scripts/verify_all.sh index a208e77a..13ab956c 100755 --- a/scripts/verify_all.sh +++ b/scripts/verify_all.sh @@ -38,9 +38,17 @@ echo "--- [Bare-Metal Target Compilation Check] ---" cargo check -p aienos-kernel --target aarch64-unknown-none --no-default-features cargo build -p aienos-kernel --target aarch64-unknown-none --no-default-features +# Step 5: Build an AArch64 UEFI diagnostic image and inspect its PE header. +# This verifies the firmware entry artifact format, not a hardware boot. +echo "" +echo "--- [AArch64 UEFI Diagnostic Image Build] ---" +cargo build -p aienos-boot --target aarch64-unknown-uefi --features firmware --bin aienos-boot +python3 scripts/verify_uefi_image.py target/aarch64-unknown-uefi/debug/aienos-boot.efi + echo "" echo "============================================================" echo "HOST VERIFICATIONS PASSED." echo "Config A: observed capture and three local inference samples verified." echo "Kernel: aarch64-unknown-none library compiles. Native boot remains untested." +echo "UEFI: AArch64 EFI application builds; kernel handoff remains unimplemented." echo "============================================================" diff --git a/scripts/verify_uefi_image.py b/scripts/verify_uefi_image.py new file mode 100644 index 00000000..d1b84162 --- /dev/null +++ b/scripts/verify_uefi_image.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python3 +"""Check the built image has an AArch64 EFI application PE header.""" + +from pathlib import Path +import struct +import sys + + +def verify(path): + data = Path(path).read_bytes() + if len(data) < 0x100 or data[:2] != b"MZ": + raise ValueError("missing DOS image header") + pe_offset = struct.unpack_from("<I", data, 0x3C)[0] + if pe_offset + 4 + 20 + 70 > len(data) or data[pe_offset:pe_offset + 4] != b"PE\x00\x00": + raise ValueError("missing PE header") + machine = struct.unpack_from("<H", data, pe_offset + 4)[0] + optional_header = pe_offset + 4 + 20 + magic = struct.unpack_from("<H", data, optional_header)[0] + subsystem = struct.unpack_from("<H", data, optional_header + 68)[0] + if (machine, magic, subsystem) != (0xAA64, 0x20B, 10): + raise ValueError(f"unexpected machine/PE/subsystem: {machine:#x}/{magic:#x}/{subsystem}") + print(f"AArch64 PE32+ EFI application verified: {path}") + + +if __name__ == "__main__": + try: + verify(sys.argv[1]) + except (IndexError, OSError, ValueError) as error: + raise SystemExit(f"UEFI image verification failed: {error}") from error