nx_emu_ppc64le_main.nx source
↩ module page · 17 lines · 621 B
1// nx_emu_ppc64le_main.nx -- CLI for NX-EMU ppc64le: load + run a static
2// PPC64LE ELF. Usage: nx_emu_ppc64le <prog.elf> (exit = guest exit).
3// Nishi CARRIES ppc64le on its own interpreter -- NO qemu (qemu = bench).
4// license_tier: ORIGINAL
5
6import "nx_emu_ppc64le.nx"
7import "nx_syscalls_x86_64.nx"
8
9func main(argc: i64, argv: *i64) -> i64 {
10 if argc < 2 { return 200 }
11 let path: *u8 = argv[1] as *u8
12 let lenbox: *i64 = sys_mmap(16) as *i64
13 let buf: *u8 = sys_read_file_x86_64(path, lenbox)
14 if (buf as i64) == 0 { return 201 }
15 let r: i64 = emu_ppc64le_load_elf(buf, lenbox[0])
16 return r
17}