Expand description
JAR program blob format — capability manifest.
The blob is a capability manifest: a list of initial capabilities (CODE and DATA) with their contents, plus invocation directives.
Layout:
Header:
magic: u32 'JAR\x02'
memory_pages: u32 total Untyped budget
cap_count: u8 number of initial capabilities
init_cap: u8 cap_index of the **initialize CODE cap**
run by Vault.initialize. The init program
is responsible for placing a callable-shaped
FrameRef at bare-Frame slot 4 before halting.
Capabilities[cap_count]:
cap[i]: {
cap_index: u8 slot in VM's cap table
cap_type: u8 0 = CODE, 1 = DATA
page_count: u32 number of pages (DATA only)
data_offset: u32 offset into blob's data section
data_len: u32 bytes of initial data (0 = zero-filled)
}
Data section:
(variable-length, referenced by capabilities)In the v3 model the kernel will eventually consume Image.memory_mappings
to set up DATA-cap mappings declaratively at instance init. Until that
lands, transpiled chain Images carry an empty mapping list; the SP
value baked into EndpointDef.initial_regs makes the metadata
correct for when mappings come online.
Structs§
- CapManifest
Entry - A single capability entry in the manifest. DATA caps carry only
(cap_index, page_count, data_offset, data_len); v3 chain Images will eventually express their data regions viaImage.memory_mappingsdirectly. - Parsed
Blob - Parsed JAR blob.
- Parsed
Code Blob - Parsed code sub-blob (within a CODE cap’s data section).
- Program
Header - Parsed JAR header.
Enums§
- Access
- Memory-mapping access mode tracked by
ProgramLayoutfor the stack / ro / rw / heap regions. Persistent mappings (declarativeImage.memory_mappings) will translate this into the correspondingMappingSource::Persistent(...)entries. - CapEntry
Type - Cap type discriminator.
Constants§
- JAR_
MAGIC - JAR magic: ‘J’,‘A’,‘R’, 0x02.
Functions§
- build_
blob - Build a JAR blob from components.
- build_
simple_ blob - Build a minimal JAR blob with a single CODE cap from raw components. Useful for tests — no DATA caps, small memory budget.
- cap_
data - Get the data slice for a capability entry from the data section.
- parse_
blob - Parse a JAR program blob.
- parse_
code_ blob - Parse a CODE cap’s data section into jump table, code, and bitmask. Format: jump_len(4) + entry_size(1) + code_len(4) + jump_entries + code + packed_bitmask