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

37impl VmSnapshot {
38 /// The architectural RAM image at capture time.
39 pub fn ram(&self) -> &[u8] {
40 &self.ram
41 }
42
43 /// Framebuffer pixel planes at capture time (bulk, delta-compressed by the session).
44 pub fn fb_image(&self) -> Vec<u8> {
45 self.devices.fb_image()
46 }
47
48 /// This snapshot with both bulk images dropped (RAM and framebuffer planes).
49 pub fn without_bulk(&self) -> Self {
50 Self {

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