<feed xmlns='http://www.w3.org/2005/Atom'>
<title>gbos.git/sl0ppty.layout.kdl, branch master</title>
<subtitle>gbos - a tiny Unix-flavored OS for the Game Boy Color (kernel, shell, coreutils in C, RAM filesystem)</subtitle>
<id>https://git.sl0p.foo/gbos.git/atom/sl0ppty.layout.kdl?h=master</id>
<link rel='self' href='https://git.sl0p.foo/gbos.git/atom/sl0ppty.layout.kdl?h=master'/>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/gbos.git/'/>
<updated>2026-09-24T21:08:54Z</updated>
<entry>
<title>usr: ntpdate + date - the Game Boy knows what day it is</title>
<updated>2026-09-24T21:08:54Z</updated>
<author>
<name>user</name>
<email>user@clank</email>
</author>
<published>2026-09-24T21:08:54Z</published>
<link rel='alternate' type='text/html' href='https://git.sl0p.foo/gbos.git/commit/?id=be1a8f74e48d4ed2ae3a0b78a7137b4bc41a2969'/>
<id>urn:sha1:be1a8f74e48d4ed2ae3a0b78a7137b4bc41a2969</id>
<content type='text'>
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.
</content>
</entry>
</feed>
