Skip to main content

Crate subsoil

Crate subsoil 

Source
Expand description

Guest-side runtime support library for JAVM chain Images.

Provides compiler builtins (memset, memcpy, memcmp), a panic handler, a default trap _start (so guests link without defining one themselves), and the map_args runtime helper that moves the kernel-allocated args DATA cap from bare-Frame slot 4 into the guest’s main-frame CapTable and maps it into the guest address space.

Guests declare their entry points via the #[subsoil::endpoint(N)] attribute (from subsoil-derive). 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 subsoil as _;.

Structs§

EndpointDescriptor
Descriptor written into the .subsoil.endpoints ELF section by the endpoint attribute macro. The JAVM transpiler reads this section at link time and uses each entry to populate the chain Image’s endpoints: BTreeMap<u8, EndpointDef> field.

Functions§

map_args
Host-side stub. Always returns an empty slice; meaningful only on the JAVM freestanding target.

Attribute Macros§

endpoint
Mark a function as endpoint N of a JAR chain Image.