MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / new_kernel

Method new_kernel

crates/virtual-machine/src/virtual_machine.rs:39–47  ·  view source on GitHub ↗

Create a VM from a kernel assembled output. Loads the kernel ELF into RAM at `RAM_BASE`, then resets the CPU to `ROM_BASE` (0x0) so the ROM `_start` boot stub runs first. `_start` sets up PMP + delegation and `mret`s into S-mode at `RAM_BASE`.

(assembled: &AssembledOutput)

Source from the content-addressed store, hash-verified

37 bus: SystemBus,
38}
39
40#[derive(Debug, Clone, PartialEq, Eq)]
41pub enum FunctionalStepOutcome {
42 Continue(RetireEvent),
43 Halted { code: i64, event: RetireEvent },
44}
45
46/// A machine checkpoint: CPU pipeline, MMIO devices, and the RAM image. The session
47/// delta-compresses bulk RAM and framebuffer data via `without_bulk`/`with_bulk`.
48#[derive(Clone)]
49pub struct VmSnapshot {
50 cpu: Cpu,

Callers

nothing calls this directly

Calls 4

to_elf_with_entryMethod · 0.80
peek_pcMethod · 0.45
reset_pcMethod · 0.45
set_boot_entryMethod · 0.45

Tested by

no test coverage detected