interplane.Get Omega
Read in your language

aienux

Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.

Brought by drakestapleton

branch main Branches Tags History

aienux / docs / CAPABILITY_ABI.md

58 lines · 3702 bytes Raw Blame History Source

Capability ABI: one production authority, one separate Rust implementation

Ruling of the ABI qualification (abi-qual, 2026-10-11). The two capability implementations in this repository are intentionally independent. They are not two builds of one binary contract, and they must never be linked in place of each other.

Native C authority (production ABI)Rust crates (separate implementation)
Sourcenative/capability/aienos_capability.{h,c}crates/aienos-capability (core, no_std), crates/aienos-capability-ffi (C binding)
Generation64 bits, AIENOS_CAP_GENERATION_BITS = 6432 bits, AIENOS_CAP32_GENERATION_BITS = 32
AienosCapRef16 bytes, align 8, generation at offset 88 bytes, align 4, generation at offset 4
AienosCapEntry / AienosCapMint88 / 64 bytes64 / 48 bytes
Exported symbolsaienos_cap_*aienos_cap32_*, plus aienos_cap32_abi_layout (ABI version 1)
Who links itomega (libaienos_capability.a merged into librx_compose.a, header copy src/runtime/aienos_cap.h), native/argusnothing in this repository

Why the separate prefix

Before this ruling the Rust FFI crate exported the same 17 function names as the C library with the smaller layout. A program compiled against aienos_capability.h and linked against libaienos_capability_ffi.a resolved every symbol and silently misread every AienosCapRef and AienosCapEntry. With the aienos_cap32_ prefix that program now fails to link.

The 32-bit generation is not widened: the Rust crates keep their own contract, and a slot whose generation reaches u32::MAX fails closed (ERR_EXHAUSTED) instead of wrapping.

What enforces it

make -C native/capability test
cargo test -p aienos-capability -p aienos-capability-ffi
bash scripts/cap_abi_isolation_test.sh   # ends with AIENOS_CAP_ABI_ISOLATION: PASS

Restart fix brought to the Rust side

The Rust authority had the restart defect the C authority fixed in b1fa747: a restart started the new table at the old boot generation + 1, which a reclaim had already used, so a reference minted after one reclaim validated again after the restart. aienos_cap32_restart now starts the new table at or above AuthorityState::generation_floor() of the table it replaces (take_boot_gen_above), and refuses with ERR_EXHAUSTED when no such start exists.

Known differences (not interchangeable, by design or still open)