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

Function boot_kernel

tests/integration/kernel_integration.rs:123–133  ·  view source on GitHub ↗
(
    kernel: &AssembledOutput,
    user: Option<&AssembledOutput>,
    fs_image: Option<&[u8]>,
    input: &str,
    max_steps: u64,
)

Source from the content-addressed store, hash-verified

121 cap: u64,
122 done: impl Fn(&str) -> bool,
123) -> (StepOutcome, String) {
124 const CHUNK: u64 = 1_000_000;
125 let mut uart = String::new();
126 let mut outcome = StepOutcome::Continue;
127 let mut steps = 0u64;
128 while steps < cap && !done(&uart) {
129 let r = vm.run(CHUNK.min(cap - steps));
130 uart.push_str(&r.uart_output);
131 steps += CHUNK;
132 outcome = r.outcome;
133 if matches!(outcome, StepOutcome::Halted(_)) {
134 break;
135 }
136 }

Calls 2

setup_kernel_vmFunction · 0.85
runMethod · 0.45