Skip to main content

Module frame

Module frame 

Source
Expand description

MainFrame and BareFrame views over the active Instance’s cnode.

Per v3 spec §3 and §22:

  • MainFrame: the active Instance’s root cnode (256 slots). Holds all caps accessible to apply — both user-mutable slots and Image-declared pinned slots.

  • BareFrame: the read-only subset of the MainFrame consisting of the Image’s declared pinned slots. These are kernel-issued caps (SetGasMeter, OOGMarker, …) at chain init, or Image-baked Data/Image references injected at set_image. The kernel rejects mutations to these slots.

Both are lightweight borrow views; the data lives on InstanceEntry::{root_cnode, pinned_slots} plus the CacheDirectory that resolves nested-cnode walks. The MGMT dispatcher (Stage 3.6) uses these views to:

  1. Resolve a SlotPath to a cap target (CapHashOrRef).
  2. Enforce pinned-slot read-only semantics on writes.
  3. Expose pinned-cap content to host calls that need it (e.g., host_yield reads the Cap::Instance[YieldCatcher] from the Image-declared yield_marker_slot).

Structs§

BareFrame
Read-only view of just the pinned slots of an Instance’s MainFrame. This is the “BareFrame” surface in §22: kernel-issued caps live here, addressed by SlotIdx matching the Image’s pinning declarations.
MainFrame
Read-only view of an active Instance’s MainFrame cnode.