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

Function compile_and_link

src/cli/main.rs:411–434  ·  view source on GitHub ↗

Compile HLL source -> IR -> tokens, then link with stdlib and assemble.

(
    src: &str,
    mode: TargetMode,
    stem: &str,
    source_path: Option<&str>,
)

Source from the content-addressed store, hash-verified

409) -> Result<ExitCode, CliError> {
410 let boot = engine
411 .boot_kernel_config(config)
412 .map_err(map_session_error)?;
413 eprintln!(
414 "fsc: built boot FS: {} entries, {} byte image",
415 boot.fs_entries.len(),
416 boot.fs_image.len()
417 );
418 let mut live = LiveMachine::new_kernel(
419 &boot.build.artifacts,
420 Some(&boot.init),
421 Some(&boot.fs_image),
422 &config.run.autorun,
423 )
424 .map_err(CliError::Assemble)?;
425
426 while live.steps < max_steps && matches!(live.state, MachineState::Running) {
427 let remaining = max_steps - live.steps;
428 live.drive(
429 remaining.min(config.run.max_steps_per_frame.max(1)),
430 Duration::from_secs(1),
431 );
432 }
433
434 print!("{}", live.uart_log);
435 match live.state {
436 MachineState::Exited(code) => {
437 eprintln!("fsc: kernel exited with code {code}");

Callers 1

assemble_from_hll_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected