nub_program/lib.rs
1//! The PVM2 program blob: what a linked guest program *is*, with no
2//! reference to any kernel personality.
3//!
4//! A [`ProgramBlob`] is raw PVM2 bytecode plus the geometry and initial
5//! contents of its four data regions (stack, ro, rw, heap) and its
6//! exported [`Endpoint`]s. That is exactly what an execution engine
7//! needs to build an address space and start running, and nothing more.
8//!
9//! [`abi`] holds the PVM2 address-space constants ([`abi::CODE_BASE`],
10//! [`abi::DATA_BASE`]) that both producers and consumers of a blob must
11//! agree on. They live here because this is the crate every PVM2
12//! producer and consumer can depend on.
13//!
14//! A capability-based personality layers *on top*: JAVM's cap `Image`
15//! wraps a blob's regions in cnode slots, adds content hashing and an
16//! SSZ encoding, and keeps the same geometry. Nothing in this crate
17//! knows that exists.
18//!
19//! `#![no_std]` with `alloc`, zero dependencies — the guest-side kernel
20//! links this too.
21
22#![no_std]
23
24extern crate alloc;
25
26pub mod abi;
27mod blob;
28mod codec;
29
30pub use blob::{Endpoint, InvalidProgram, ProgramBlob, Region, RegionKind, Regions};
31pub use codec::{DecodeError, MAGIC, VERSION};