diff options
| author | user <user@clank> | 2026-09-24 12:48:42 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-09-24 12:48:42 +0200 |
| commit | 62c392178e774c09e42927cfdd0d4daebcd185ce (patch) | |
| tree | 3347624de15c81a80a5e9bad395cbdebf288be61 /src/programs.asm | |
| parent | kernel: stat/fsstat/isatty syscalls, and O_APPEND (diff) | |
| download | gbos-62c392178e774c09e42927cfdd0d4daebcd185ce.tar.gz gbos-62c392178e774c09e42927cfdd0d4daebcd185ce.tar.xz gbos-62c392178e774c09e42927cfdd0d4daebcd185ce.zip | |
sh: run scripts, and >> redirection
`sh < file` already executed the file - and then powered the Game Boy off,
because the read loop treated EOF as "the machine is done". That is right for
init and wrong for everything else, so scripts were unusable.
A shell now asks isatty(): with stdin on a file it prints no prompt, does not
echo the script back, and exits at EOF. Only pid 1 on the console still powers
down. init also runs /rc at boot if the cart has one, so a Game Boy can come
up with its own startup script - verified across a real power cycle (write
/rc, poweroff, reboot the same cart, watch init run it).
`>>` appends instead of truncating, which is what makes writing that script on
the device possible in the first place.
Diffstat (limited to 'src/programs.asm')
0 files changed, 0 insertions, 0 deletions
