Skip to main content

Crate nub_program

Crate nub_program 

Source
Expand description

The PVM2 program blob: what a linked guest program is, with no reference to any kernel personality.

A ProgramBlob is raw PVM2 bytecode plus the geometry and initial contents of its four data regions (stack, ro, rw, heap) and its exported Endpoints. That is exactly what an execution engine needs to build an address space and start running, and nothing more.

abi holds the PVM2 address-space constants (abi::CODE_BASE, abi::DATA_BASE) that both producers and consumers of a blob must agree on. They live here because this is the crate every PVM2 producer and consumer can depend on.

A capability-based personality layers on top: JAVM’s cap Image wraps a blob’s regions in cnode slots, adds content hashing and an SSZ encoding, and keeps the same geometry. Nothing in this crate knows that exists.

#![no_std] with alloc, zero dependencies — the guest-side kernel links this too.

Modules§

abi
PVM2 guest virtual-address-space layout (ABI constants).

Structs§

Endpoint
One exported entry point.
ProgramBlob
A self-contained PVM2 program: raw code plus the region geometry and initial contents a runtime needs to build its address space.
Region
One data region’s placement in the guest address space.
Regions
Data-region geometry: the page count of each of the four fixed regions. Placement is derived, not stored — regions stack linearly from DATA_BASE in the order stack, ro, rw, heap, so the page counts alone determine every base address.

Enums§

DecodeError
Why a byte slice does not decode to a ProgramBlob.
InvalidProgram
Why a ProgramBlob is not well-formed.
RegionKind
Which of the four fixed data regions a Region describes.

Constants§

MAGIC
Format magic: b"NUBP".
VERSION
Current format version.