code wiki / _hdl_build / nx_shell_run.nx

nx_shell_run.nx

buildroot/runtime/_hdl_build/nx_shell_run.nx

2347 B42 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic shell
docsdependenciesstructsconstsfunctions

about

nx_shell_run.nx -- the DRIVABLE sovereign Nishi shell: reads a script (knowledge/shell/run.nsh) and executes each line via the GENERAL nx_shell_lib's full executor (pipelines | + control flow ; && ||). This is the working bash replacement -- write a .nsh, run this, get output. Exits with the last line's exit code. (lines starting with # = comments) expect_exit: 0 Sovereign: nx_shell_lib (+ nx_syscalls). NEVER-BRICK: spawns userspace, 0 firmware.

dependencies 2 imports · 0 importers

nx_shell_lib.nx nx_syscalls.nx nx_shell_run.nx

imports: nx_shell_lib.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_puts sys_write sys_mmap sys_openat_rd sys_exit sys_read sys_close run_line g_puts ↻ sys_write ↻ sh_exec_full sys_mmap ↻ sh_split_ops sh_run_pipeline sys_mmap ↻ sh_split_pipe sh_exec_one sys_mmap ↻ sh_tokenize sh_builtin sh_streq sys_chdir g_puts ↻ sh_run sys_fork sys_execve sys_exit ↻ sys_mmap ↻ sys_wait4 wait_exit_code sys_pipe2 sys_fork ↻ sys_dup3 sys_close ↻ sh_stage_exec sys_mmap ↻ sh_tokenize ↻ sys_exit ↻ sh_streq ↻

structs

none

consts

7const K_MAGIC_65536: i64 = 65536
8const K_MAGIC_4096: i64 = 4096

functions

10func run_line(buf: *u8, start: i64, end: i64, line: *u8) -> i64
called by 1: main calls 3: g_putssys_writesh_exec_full
19func main(argc: i64, argv: *i64) -> i64