diff options
| author | user <user@clank> | 2026-09-24 23:08:54 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-09-24 23:08:54 +0200 |
| commit | be1a8f74e48d4ed2ae3a0b78a7137b4bc41a2969 (patch) | |
| tree | 25477cc16331b6e919deab918eecfcc4edebc0cb /README.md | |
| parent | usr: sort, cmp, strings, du, time (diff) | |
| download | gbos-be1a8f74e48d4ed2ae3a0b78a7137b4bc41a2969.tar.gz gbos-be1a8f74e48d4ed2ae3a0b78a7137b4bc41a2969.tar.xz gbos-be1a8f74e48d4ed2ae3a0b78a7137b4bc41a2969.zip | |
An MBC5 cart has no RTC, so SNTP is the only route to a wall clock. ntpdate
does one 48-byte UDP exchange on port 123 and hands the stamp to the kernel;
SYS_SETTIME keeps it with the tick it arrived at, and SYS_GETTIME adds the
elapsed ticks back, so date(1) is just formatting.
/# ntpdate
ntpdate: clock set from pool.ntp.org
/# date
Sep 24 21:01:23 UTC 2026 (host said 21:01:26)
The clock does not survive a power cycle - which is exactly what /rc is for:
`ntpdate` there and the machine boots knowing the time.
All of it is bounded subtraction, no long division or shifts: SDCC pulls those
from sm83.lib, whose modules link into the $A000 RAM window. The month tables
are string literals for the same family of reason - an initialized array goes
to _INITIALIZED at $A000 and the image overflows its bank ("buffer too small"
out of makebin), which is how this first failed to link.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -22,7 +22,10 @@ into the on-screen console. Regenerate it anytime with `tools/gbdemo` (below).* `more` to page anything longer than the 18-row screen. - **Shell scripts**: a shell fed from a file (`sh < script`) runs it with no prompt and no echo, and init runs **`/rc`** at boot if the cart has one — - so a Game Boy can come up with its own startup script. + so a Game Boy can come up with its own startup script (`dhcp`, then + `ntpdate`, and it knows the date). +- **A real clock**: no RTC on the cart, so `ntpdate` fetches the time over + SNTP and `date` prints it — verified against the host's clock to the second. - **Networking, for real**: the kernel owns SLIP over the link port, IPv4, ICMP, UDP and TCP; userland gets BSD-ish sockets via one syscall. On top: `dhcp` (boot-time lease), `ping`, `nslookup` (real DNS), `wget` (HTTP), @@ -44,7 +47,8 @@ into the on-screen console. Regenerate it anytime with `tools/gbdemo` (below).* - **40×18 color terminal** on the LCD (4×8 font, two chars per tile, ANSI-ish colors) + an **on-screen keyboard** on the window layer (SELECT toggles it). - **Persistent filesystem** on battery-backed cart RAM: inodes, nested - directories, per-process cwd — survives power-off (files up to 3 KiB). + directories, hard links (`ln`), per-process cwd — survives power-off + (files up to 3 KiB). `ls -l` and `df` report sizes and free space; `poweroff` is the only safe way to stop the machine (the battery save is written on a clean exit). - **`/bin` in the tree**: the builtins are not files on the disk, but they @@ -53,8 +57,8 @@ into the on-screen console. Regenerate it anytime with `tools/gbdemo` (below).* bank. Read-only, since it is ROM. - **A C toolchain**: userland is plain C compiled with SDCC (`sm83`); ~50 tools ship in `usr/` (`cat`, `wc`, `head`, `tail`, `grep`, `cp`, `mv`, - `tee`, `tr`, `cut`, `uniq`, `rev`, `more`, `ls`, `df`, `xxd`, - `touch`, `sleep`, `uptime`, …) — `help` lists them all on + `tee`, `tr`, `cut`, `uniq`, `rev`, `sort`, `cmp`, `strings`, `more`, `ls`, + `ln`, `df`, `du`, `xxd`, `touch`, `sleep`, `time`, `clear`, `uptime`, …) — `help` lists them all on the Game Boy itself. Adding a program is one `.c` file + a table entry. ## Quick start |
