Files
makronix/mobile/userland/AGENTS.md
T
lotherkandClaude Sonnet 5.5 73c9de51a6 licence: the CNCL line in every file Makronix wrote (tools, docs, www, mobile, top level)
consmirror.c: the BSD notice is replaced (Makronix's own file).  Files with
changes of other sessions pending are left for their commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 11:50:26 +00:00

2.9 KiB

mobile/userland/ -- NetBSD programs for the phone (the port frame)

What this is for: programs of our src/ built for the phone's Linux (aarch64, glibc), one directory per program. Plan: ../docs/NETBSD-USERLAND.md; how to port one program: ../docs/PORTING-USERLAND.md. Read both before you add or change a port.

Two ways exist to build src/ for the phone:

  • the normal build: make src DIR=<dir under src/> (tools/mxsrc.sh; tooldir nbmake-evbarm64, conf/mk.conf, libmxlinux in src/lib/libmxlinux, sysroot as DESTDIR). This is the direction: it builds src/bin and more as NetBSD does.
  • the port frame, this directory: make userland [PROG=x]. The ports here are the first ones; the frame is being replaced by the normal build.

What is in it:

Makefile           steps mx-dirs, mx-compat, mx-lib, every port (found, not
                   listed)
mk/mx.prog.mk      the frame a port includes (src/tools/Makefile.host with
                   the phone as "host"); mk/mx.dist, the destdir hierarchy
lib/mxlinux/       the frame's build of libmxlinux (its sources are
                   `src/lib/libmxlinux`, see its Makefile)
<prog>/Makefile    `MX_SRCDIR= <dir under src/>`, include ../mk/mx.prog.mk
                   (or `MX_LOCALSRC` for a program of our own)
<prog>/test.sh     the port's test: NetBSD's own (src/tests/...) in plain sh
                   plus the man page's cases; `make userland-test PROG=x`
<prog>/REPLACES    the Void file and package the port supersedes
<prog>/AGENTS.md   first line `state: <state>`, then `item:`; read by
                   `tools/userland-status.sh`

States: claimed, builds, runs-qemu, runs-phone, done, blocked: . A port's directory belongs to the agent that claimed it; look first with tools/userland-status.sh.

What may be changed and how:

  • A NetBSD interface glibc lacks goes into src/lib/libmxlinux, not into a port, as soon as it is not specific to one program (NetBSD's source through .PATH if it runs on glibc, else an mx_*.c; its declaration in mxlinux.h with the NetBSD header line).
  • mk/ and the libmxlinux step are shared by every port: change them only with every done port rebuilt and its test green (make userland, then make userland-test PROG=<each>), and say so in the commit.
  • A new port: its own directory with Makefile, test.sh, REPLACES, AGENTS.md (what it is, the src/ path, anything special). Commit with explicit paths only (other agents share the index).

What must not be touched from here:

  • src/ beyond a change behind __linux__ that keeps the NetBSD build green (root AGENTS.md: a broken NetBSD convention is a finding, not a quiet change). Prefer libmxlinux.
  • The phone's /system and boot slots: a port is tested in /tmp/userland-test on the phone (tools/userland-test.sh), nothing else.