()
| 1460 | uart.contains("HELLO"), |
| 1461 | "`la` + .asciz did not print the data-section string; uart={uart:?}" |
| 1462 | ); |
| 1463 | assert!( |
| 1464 | uart.contains("[exit 42]"), |
| 1465 | "call/ret did not produce exit 42; uart={uart:?}" |
| 1466 | ); |
| 1467 | assert!( |
| 1468 | matches!(outcome, StepOutcome::Halted(0)), |
| 1469 | "shell did not survive the run and exit cleanly; outcome={outcome:?} uart={uart:?}" |
| 1470 | ); |
| 1471 | } |
| 1472 | |
| 1473 | // Host-built static ELFs must run unmodified: sys_exec maps each PT_LOAD at its |
| 1474 | // p_vaddr, zeroes BSS, and jumps e_entry. |
| 1475 | #[test] |
| 1476 | fn kernel_loads_and_runs_elf() { |
| 1477 | let shell = compile_hosted_program("shell"); |
| 1478 | let prog = compile_hosted( |
| 1479 | "external console_writeln: (s: u8*)\n\ |
| 1480 | main: () -> i32 {\n\ |
| 1481 | \tconsole_writeln(\"elf ok\".ptr)\n\ |
| 1482 | \treturn 7\n\ |
| 1483 | }\n", |
| 1484 | ); |
| 1485 | // Link at the same base the kernel maps user code to, so e_entry / p_vaddr |
| 1486 | // land in the user code region. |
nothing calls this directly
no test coverage detected