Expand description
Guest-side runtime support for PVM2 programs.
Provides compiler builtins (memset, memcpy, memcmp), a panic
handler, and a default trap _start (so guests link without
defining one themselves).
Programs that need alloc get it from
bump_allocator!, which installs a
resettable bump arena.
Personality-free: a program built against this crate is a plain PVM2 program. Whether the engine running it has a capability system is not its concern.
Guests declare their entry points via the
#[nub_rt::endpoint(N)] attribute (from nub-rt-macro).
Each annotation emits a per-endpoint trampoline that calls the
user fn and halts; the kernel enters trampolines via
endpoints[N].entry_pc. _start (PC=0) is never an intended
entry — it traps via unimp if ever reached.
All freestanding-only symbols are gated behind cfg(target_os = "none") — on host this crate is empty. Services force-link it via
use nub_rt as _;.
target_os = "none" is the freestanding-target test throughout;
the guest target JSON sets it. The RISC-V-specific bits (panic
handler, _start) additionally require target_arch = "riscv64",
because x86_64-unknown-none is also target_os = "none" and
must never see this crate’s unimp.
Modules§
- alloc
- A bump allocator with an explicit reset.
Macros§
- bump_
allocator - Install a
BumpAllocof$bytesas the program’s global allocator, and definereset_heap()beside it.
Structs§
- Endpoint
Descriptor - Descriptor written into the
.nub.endpointsELF section by theendpointattribute macro.nub-linkerreads this section at link time and turns each record into anub_program::ProgramBlob::endpointsentry.
Attribute Macros§
- endpoint
- Mark a function as endpoint
Nof a PVM2 program.