The guest joins a tailnet from Node or the page: ts2021 control over
WebSocket, DERP relays, WireGuard and the packet filter in JS, loaded as
a separate chunk only when the option is used. SDK net option, CLI
--tailscale* flags and a page panel. Relay only; exit nodes, IPv6 and
real peer traffic are not covered yet.
The README and the SDK docs now say what a guest sees over Wisp: no
half-close (a client that waits for the server to see end of file
hangs), placeholder addresses for every name, no connect
acknowledgement. wispBackend() takes a `lookup` resolver for real
addresses, and its fake address table now evicts the least recently
used name instead of wrapping. The default server is
wss://wisp.unkernel.dev:6680/.
The live Wisp test waited for its marker anywhere in the screen, so the
shell's echo of the command satisfied it; it now waits for the marker at
the start of a line.
Refs #44
A page build with a release that carries page.json downloads only that
and points the page at mirror.unkernel.dev's copy of the release assets
(CORS, Range, immutable); nothing is copied into the output. The release
workflow now also publishes a gzipped copy of every .wasm, which the SDK
gunzips when a body starts with gzip's magic (the mirror sends files as
they are).
Sessions and the console run as user in /home/user on Debian and Alpine (doas with a sudo shim there); the host asks for another user with SpawnOptions.user, the CLI's --user or kw.user=. The shims, the command-not-found installers, poweroff and the page's launcher and demos reach root through sudo, and apt, apt-get and apk typed by the user are aliases to it. /usr/lib/kw/shrc gives nested shells, sudo -s and sudo -i the prompt, the command-not-found handler and PATH that only login shells had. The framebuffer, input and sound devices are group-accessible, and host mounts show as the user's.
Worker mode is the default where the page is cross-origin isolated; a default worker that does not start reloads once on the page's thread. The CPUs default to the suggested count: half the threads, at most 4 on desktops and 2 in Firefox, one on phones and in WebKit (Safari ran parallel work slower with every CPU). The CPUs slider goes up to the device's threads and turns red past the suggestion. /profile.html boots each configuration, times everyday guest work and frame gaps, and checks the browser's own threads.
?distro= picks an image (or none, the base shell); images are served with
Range and content-addressed names. The Doom demo's fbdoom build and patches
move under web/. Reset of the data disk survives a reload.
User space is now unmodified aarch64 Linux ELF. kwemu gets an A64
interpreter (src/a64): integer, scalar and vector floating point,
AdvSIMD, exclusives and load-acquire/store-release, the EL0 system
registers, AES, PMULL, SHA1, SHA256 and CRC32. The kernel runs arm64
user space (signal frames, HWCAP, ptrace regsets, the arm64 syscall ABI),
and the guest image, the bundle, kwtest and the page's texts are built
for aarch64.
Off by default: one CPU loads the UP bundle as before. With several the
page loads the SMP bundle (only then) and boots it in worker mode. The
choices are disabled with the reason where the page cannot (no SMP
kernel in the bundle, no cross-origin isolation, no Atomics.waitAsync),
and a failed SMP download or start reloads once on one CPU. Suspend is
hidden with several CPUs; a suspended session is offered to resume on
one CPU.
alpine.sh always writes alpine-test.cpio: the image followed by a second
cpio archive with kwtest and kwbench, which the kernel unpacks after the
first. alpine.cpio, which build.sh bundles, is the same, or with
KW_RELEASE=1 the image alone. The choice is in alpine.sh because build.sh
is part of the release workflow's cache keys.
The release workflow sets KW_RELEASE=1, so the GitHub release bundle, the
npm package and the deployed page have no test programs. Its kwtest steps
boot the release bundle's kernel with --initrd alpine-test. wasi-node.ts
uses alpine-test.cpio, and the headless lowmem scenario boots to the
shell instead of running kwtest, since the built page runs a release
kernel.
The status line's fx button (or Ctrl-A f, or ?fx at load) runs libfx's
wasm fx terminal in a panel docked right of the stage, over it on narrow
screens. Its shell tool runs each command in the guest through
vm.exec(). The sign-in, settings and history stay in module memory only.
vercel.com sends its OAuth discovery document without CORS headers, so
fx's fetch falls back to a copy of the fields it reads. The launcher's
fx demo (the x86_64 binary under qemu) is hidden.