| |
|
|
|
|
|
|
|
|
|
| |
- libc: add putc, puts, strlen, getargs (args string), EOF (=4) for readc.
- args: shell splits the command line at the first space ("cmd\0args\0" at
$A000, inherited by the child via fork); getargs() returns the arg string.
- shell: exit on Ctrl-D/EOF; $ prompt over a clean read loop.
- tools (c/): echo (argv), cat (stdin->stdout to EOF), uname, pid (decimal
print), true, false. Each built to a ROM-bank blob and registered.
- Makefile: CBLOBS list builds all C programs.
- README: document libc + the tool set.
|
|
|
- c/{gbos.h,crt0.s,libc.s,build.sh}: SDCC sm83 -> ROM-bank blob toolchain.
libc syscall wrappers save/restore BC/DE/HL around rst $30 (trap clobbers
them; SDCC expects them preserved).
- build via SDCC native asxxxx path (sdasgb/sdldgb), crt0 linked first so
_start is the $4000 entry; blob INCBIN'd into a ROM bank.
- chello.c: prints a message + getpid() -> runs as 'chello' shell command.
- Makefile: auto-build c/*.bin, track as a dep of programs.o; gitignore blobs.
- README: document the C toolchain + the SDCC --asm=rgbds codegen bug that
forced the native-toolchain approach.
- verified: '$ chello' -> 'hello from C on gbos!' / 'my pid is 2'.
|