Expand description
§RVF Boot Loading for RuVix Cognition Kernel
This crate provides the RVF (RuVector Format) boot loading infrastructure for the RuVix Cognition Kernel as specified in ADR-087.
§Boot Sequence (ADR-087 Section 9.1)
The kernel boot follows a five-stage process:
| Stage | Name | Description |
|---|---|---|
| 0 | Hardware Init | Platform-specific initialization (mocked in Phase A) |
| 1 | RVF Verify | Parse manifest + ML-DSA-65 signature verification |
| 2 | Object Create | Create root task, regions, queues, witness log |
| 3 | Component Mount | Mount components + distribute capabilities |
| 4 | First Attestation | Boot attestation to witness log |
§Security (SEC-001)
This crate implements critical security fixes:
- Signature failure: PANIC IMMEDIATELY, no fallback boot path
- Root task capability drop: After Stage 3, root task drops to minimum set
- Witness log integrity: Append-only, cryptographically linked
§Features
std: Enable standard library support (default)alloc: Enable alloc crate supportmetrics: Enable boot metrics collectionverbose: Enable verbose boot loggingbaremetal: Phase B bare metal (no std, no libc)
§Example
ⓘ
use ruvix_boot::{BootLoader, BootConfig};
let config = BootConfig::default();
let mut loader = BootLoader::new(config);
// Load and verify the RVF boot image
let manifest_bytes = include_bytes!("boot.rvf.manifest");
let signature = include_bytes!("boot.rvf.sig");
// This will PANIC if signature verification fails (SEC-001)
loader.boot(manifest_bytes, signature)?;Modules§
- stage
- Boot stage constants.
Structs§
- Attestation
Entry - Witness log entry for attestation.
- Boot
Attestation - Boot attestation entry recorded as the first witness log entry.
- Boot
Capability Set - The complete set of initial capabilities for the root task.
- Boot
Config - Boot loader configuration.
- Boot
Loader - Main boot loader.
- Boot
Result - Boot result containing all boot artifacts.
- Capability
Distribution - Capability distribution result from Stage 3.
- Component
Decl - Component declaration within an RVF package.
- Component
Graph - Component graph representing the DAG of WASM components.
- Initial
Capability - Initial capability descriptor for boot-time creation.
- Memory
Schema - Memory schema containing region declarations.
- Minimum
Capability Set - Minimum capability set for root task after SEC-001 drop.
- Mount
Config - Configuration for RVF mount operations.
- Mount
Result - Result of an RVF mount operation.
- Proof
Attestation - A proof attestation recorded in the kernel witness log.
- Proof
Policy - Proof policy containing per-component tier requirements.
- Queue
Wiring - Queue wiring between components.
- Region
Handle - Handle to a memory region.
- Rollback
Hook - Rollback hook (WASM function for state rollback).
- Root
Capability Drop - Root capability drop operation per SEC-001.
- RvfManifest
- RVF Manifest containing the complete package description.
- RvfMount
- RVF mount operation handler.
- RvfMount
Handle - Handle to a mounted RVF package.
- Signature
Verifier - Signature verifier for RVF packages.
- Stage0
Hardware - Stage 0: Hardware initialization.
- Stage1
Verify - Stage 1: RVF manifest parse + signature verification.
- Stage2
Create - Stage 2: Kernel object creation.
- Stage3
Mount - Stage 3: Component mount + capability distribution.
- Stage4
Attest - Stage 4: First attestation (boot attestation to witness log).
- Task
Handle - Handle to a task (unit of concurrent execution).
- Witness
Log - Witness log for boot and runtime attestation.
- Witness
LogConfig - Witness log configuration.
- Witness
LogEntry - Complete witness log entry (header + payload).
- Witness
LogPolicy - Witness log policy configuration.
Enums§
- Boot
Stage - Boot stage enumeration.
- Kernel
Error - Kernel error codes.
- Proof
Tier - Proof tier determining verification complexity.
- Region
Policy - Memory region access policy.
- RvfVerify
Status - RVF package verification status.
- Task
Priority - Task scheduling priority.
- Verify
Result - Result of signature verification.
Constants§
- MAX_
COMPONENTS - Maximum number of components in an RVF package.
- MAX_
MANIFEST_ SIZE - Maximum manifest size in bytes.
- MAX_
QUEUE_ WIRINGS - Maximum queue wiring connections per manifest.
- MAX_
REGION_ DECLS - Maximum region declarations per manifest.
- ML_
DSA_ 65_ PUBLIC_ KEY_ SIZE - ML-DSA-65 public key size in bytes.
- ML_
DSA_ 65_ SIGNATURE_ SIZE - ML-DSA-65 signature size in bytes (NIST FIPS 204).
Type Aliases§
- Result
- Result type for boot operations.