From 3599bf48d62f4f1a0c19cde82c7a251dfbdc3678 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 19 Nov 2026 00:12:48 +0000 Subject: [PATCH] web: make the launcher demos right for the aarch64 guest The demos' texts called the guest riscv64 (and its CPU a RISC-V emulator); they now say aarch64. The SQLite demo read the riscv ISA string from /proc/cpuinfo; it now loads the Features line and groups it (FP and SIMD, crypto, CRC, LSE atomics). Doom's first run builds in under a minute, which its README and tile say. Every visible demo's run.sh was run on the aarch64 guest through the SDK (2026-11-18): .agents/web.md lists the first-run times. The stand-ins and qemu-user (x86_64, riscv64, i386, arm) were rechecked too. --- .agents/status.md | 16 ++++++++-------- .agents/web.md | 26 +++++++++++++++++++++++++- kernel/README.md | 5 +++-- web/src/demos/aquarium.ts | 2 +- web/src/demos/doom.ts | 4 ++-- web/src/demos/dos.ts | 10 +++++----- web/src/demos/git.ts | 2 +- web/src/demos/mc.ts | 6 +++--- web/src/demos/nginx.ts | 2 +- web/src/demos/nitro.ts | 4 ++-- web/src/demos/node.ts | 10 +++++----- web/src/demos/nvim.ts | 4 ++-- web/src/demos/postgres.ts | 2 +- web/src/demos/python.ts | 6 +++--- web/src/demos/radio.ts | 8 +++++--- web/src/demos/speak.ts | 11 ++++++----- web/src/demos/sqlite.ts | 27 ++++++++++++--------------- web/src/demos/sshfs.ts | 2 +- web/src/demos/tmux.ts | 2 +- web/src/demos/valkey.ts | 4 ++-- web/src/fx.ts | 2 +- 21 files changed, 90 insertions(+), 65 deletions(-) diff --git a/.agents/status.md b/.agents/status.md index 6f0da30..a509e69 100644 --- a/.agents/status.md +++ b/.agents/status.md @@ -592,14 +592,14 @@ for aarch64 (11.0.3); the demo has not been run on the aarch64 guest. sums the PCM chunks 300 ms after glimmer's "test sound done" and then misses the last one (65966 or 65919 of 66150 frames), while `test/glimmer-check.mjs --run` gets all 66150, sample exact (3 of 3). -- **aarch64 image: not yet rerun.** The Ubuntu arm64 disk, x86_64, i386 - and arm binaries through qemu-user (riscv64 works: a static riscv64 - program installed qemu-riscv64 and its library root on first run, 60 s, - and then ran in 0.4 s, 2026-11-17), and the page. The page's fx, - claude and opencode stand-ins (web.md, Stand-ins) are checked through - the SDK only; in a browser, writing claude's 357 MB and opencode's - 248 MB to the IndexedDB data disk has not been timed. The ubuntu and - sqlite demos are still written for riscv64. +- **aarch64 page: not yet opened in a browser.** The launcher demos (web.md, + Launcher), the stand-ins (web.md, Stand-ins) and qemu-user are checked + through the Node SDK only (2026-11-18): static busybox binaries of + x86_64, riscv64, i386 and armv7 each installed their qemu and library + root on first run in 8-9 s and then ran in 0.2-0.3 s. In a browser, + writing claude's 357 MB and opencode's 248 MB to the IndexedDB data disk + has not been timed, and every demo's first run there waits on Wisp + instead of the host's network. - **GNU ld binaries exec slower.** Alpine links everything with GNU ld, whose one R+X segment for code and read-only data cost about 0.5 ms per exec under riscv64 kwemu against lld's layout; on aarch64 about 0.07 diff --git a/.agents/web.md b/.agents/web.md index 19c450d..bfe4fd8 100644 --- a/.agents/web.md +++ b/.agents/web.md @@ -536,7 +536,9 @@ both files describe the rest at their top: 4.5 MB download, 6.9 MB, first call 2.5 s, later ones 0.01 s; claude 2.1.327 127 MB (`.zst`), 357 MB, 23 s, then `--version` 0.2 s, `--help` 6 s; opencode 2.3.2 120 MB, 248 MB, 22 s, then `--version` 6 s (its own - startup). All three also run at 256 MiB. Without a data disk the root is + startup); rechecked the same day on a fresh data disk (fx 0.0.17, claude + 2.1.327, opencode 2.3.2): first calls 2.2, 16.9 and 20.9 s, then 0.0, + 0.1 and 4.3 s. All three also run at 256 MiB. Without a data disk the root is in RAM (230 MiB free at 512 MiB): fx installs, claude and opencode refuse with a message; at 1 GiB claude fits. - claude's own auto-updater is left on: it may download a newer version @@ -615,6 +617,28 @@ window (or its shell exiting) removes `?demo=`; the kernel stopping does not. Failures are toasts. Checked by hand only. +Every demo's run.sh, as the launcher writes it, was run on the aarch64 +guest through the Node SDK on 2026-11-18: a fresh data disk per demo, 512 +MiB, the files written with `vm.exec()` and run.sh in a pty session (the +window's command without the wrapper), the host's network instead of Wisp, +a display or sound card where the demo needs one, and the Ubuntu tarball +pushed as `downloads` does (a scratch harness, not in the repository). +Each reached its working state: the +servers answered over `vm.fetch()` (nitro's echo POST, python's note +POST), postgres's `select version()` said aarch64, glimmer and Doom drew +frames, radio and speak played sound, sshfs mounted Rebex's server. +Seconds from run.sh's start, the `apk add` step (indexes and packages +over the host's network) first, then the time to the working state: +htop 1.6/1.7, tmux 1.8/2.6, mc 2.6/3.0, Neovim 6.8/7.7 (community), Git +2.8/4.9 (clone 1.6 s), sshfs 2.9/4.6 (mounted, tour done), nginx +1.8/2.1, Node.js 5.3/10.5, Nitro 5.9/39.4 (upm install 16 s, `nitro dev` +14 s), Python 4.3/6.2, PostgreSQL 5.7/19.6 (initdb and start 13 s), +SQLite 1.7/2.9, Valkey 2.1/3.3, radio 1.7 (sound about 1 s after a +station is picked), speak 2.4 (the introduction starts at once), +asciiquarium 6.7/6.8 (community), glimmer 0.1 (no packages), Ubuntu 28 +(extracting the pushed tarball; 0.2 later, `apt-get update` 28 s in the +chroot), Doom 22 (tcc install, downloads and a 6 s build; 0.2 later). + `?showcase` (or `?demo=-`) runs `src/showcase.ts` once the guest is up: a fast, hands-off tour of the demos, leaving out the web servers (described at its top). Each step shows a caption and launches its demo without touching `?demo=`. diff --git a/kernel/README.md b/kernel/README.md index 7fc3015..3a8cbf3 100644 --- a/kernel/README.md +++ b/kernel/README.md @@ -827,8 +827,9 @@ from source). Everything is self-hosted except the Wisp fallback. `?simulate=nojspi|oom|lowmem` (documented in `web/src/config.ts`). * **Launcher:** ❯ at the left of the status line (or ⌘K on Apple devices, Ctrl-Shift-O, Ctrl-A o) opens a full-page grid of demos: glimmer, tmux, - htop, Midnight Commander, Neovim, sshfs over FUSE, nginx, Node.js, Python, - PostgreSQL, SQLite, Valkey, internet radio, asciiquarium and Doom. Each + htop, Midnight Commander, Neovim, Git, Ubuntu in a chroot, sshfs over + FUSE, nginx, Node.js, Nitro, Python, PostgreSQL, SQLite, Valkey, internet + radio, speech, asciiquarium and Doom. Each runs in a new terminal window: the page writes its files into the guest, installs its Alpine packages with apk and runs its commands (`web/src/demos/`, one file each); web servers open in the preview. The diff --git a/web/src/demos/aquarium.ts b/web/src/demos/aquarium.ts index c2fd685..b68d8af 100644 --- a/web/src/demos/aquarium.ts +++ b/web/src/demos/aquarium.ts @@ -19,7 +19,7 @@ export default { colors: ["#38bdf8", "#1e3a8a"], community: true, files: { - "README": "asciiquarium: an aquarium animation in perl (Term::Animation), the riscv64\n" + + "README": "asciiquarium: an aquarium animation in perl (Term::Animation), the aarch64\n" + "build from Alpine, running on Linux in this browser tab.\n\n" + " q quits p pauses r redraws (new fish, and the window's new size)\n\n" + "Ctrl-C quits too.\n", diff --git a/web/src/demos/doom.ts b/web/src/demos/doom.ts index 192059d..6d3e728 100644 --- a/web/src/demos/doom.ts +++ b/web/src/demos/doom.ts @@ -25,7 +25,7 @@ keyboard input through evdev and sound effects on /dev/dsp. The first run builds the game here, in the guest: it installs tcc with apk (about 8 MiB), downloads fbDOOM's source and Freedoom (about 24 MiB) and -compiles 81 files, which takes from half a minute to a few minutes. Later +compiles 81 files, which takes under a minute, mostly the downloads. Later runs start at once. With the data disk the game is kept in /data/fbdoom. arrows move Ctrl fire Space open doors @@ -41,7 +41,7 @@ fbdoom --remove-compiler removes tcc. export default { id: "doom", title: "Doom", - desc: "fbDOOM with Freedoom on the framebuffer; the first run builds it in the guest (a few minutes)", + desc: "fbDOOM with Freedoom on the framebuffer; the first run builds it in the guest (under a minute)", // A horned skull (not id Software's logo). icon: { svg: '' }, colors: ["#dc2626", "#451a03"], diff --git a/web/src/demos/dos.ts b/web/src/demos/dos.ts index 6b1f672..3c0f27c 100644 --- a/web/src/demos/dos.ts +++ b/web/src/demos/dos.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa -// DOS: FreeDOS 1.2 booting on a PC emulated by qemu-system-i386, a riscv64 +// DOS: FreeDOS 1.2 booting on a PC emulated by qemu-system-i386, an aarch64 // program on the guest, drawn in the terminal by qemu's curses display // (VGA text mode; a program that switches to graphics shows nothing). // qemu-system-i386 and qemu-ui-curses are in community: about 25 MB to @@ -16,7 +16,7 @@ // costs seconds under two layers of emulation: as shipped, qemu took 6.5 s // to reach the FreeDOS kernel, 19 s more to the shell (the F5/F8 wait, // HIMEMX) and 45 s more for AUTOEXEC.BAT (CD-ROM drivers, LBACACHE, the -// welcome text) (CLI, 2026-11-15). Only FDAPM APMDOS stays: it halts the +// welcome text) (riscv64 guest, CLI, 2026-11-15). Only FDAPM APMDOS stays: it halts the // CPU while DOS waits for a key, so an idle prompt does not keep qemu, and // the tab, at full speed. qemu runs with -nodefaults (no CD-ROM for the // BIOS to probe, no parallel port) and 4 MB of memory. The @@ -44,7 +44,7 @@ import type { Demo } from "../launcher.ts"; const DOS = String.raw`#!/bin/sh -# FreeDOS on an emulated PC: qemu-system-i386 (a riscv64 program) boots the +# FreeDOS on an emulated PC: qemu-system-i386 (an aarch64 program) boots the # FreeDOS 1.2 boot floppy, with its installer removed, to an A:\> prompt. set -e IMG=fdos12.img @@ -81,7 +81,7 @@ FDAPM APMDOS >NUL alias halt=fdapm poweroff alias shutdown=fdapm poweroff cls -echo FreeDOS 1.2, on a PC emulated by qemu-system-i386, a riscv64 program, +echo FreeDOS 1.2, on a PC emulated by qemu-system-i386, an aarch64 program, echo on Linux compiled to WebAssembly, running in your browser. echo. echo Try DIR /W, VER, MEM, or EDIT NOTES.TXT (A: is writable and kept). @@ -147,7 +147,7 @@ export default { // Hidden: too slow for the launcher, even stripped (status.md). hidden: true, title: "FreeDOS", - desc: "FreeDOS 1.2 booting on a PC emulated by qemu-system-i386, inside the riscv64 Linux in your browser", + desc: "FreeDOS 1.2 booting on a PC emulated by qemu-system-i386, inside the aarch64 Linux in your browser", // A floppy disk. icon: { svg: '' }, colors: ["#2563eb", "#0b1d4d"], diff --git a/web/src/demos/git.ts b/web/src/demos/git.ts index 65d8e5e..7d79023 100644 --- a/web/src/demos/git.ts +++ b/web/src/demos/git.ts @@ -4,7 +4,7 @@ // replacement, cloned with git, toured, then browsed with tig. Its whole // history, 163 commits since 2010, is about 224 KB packed (2026-11-15), so // the clone takes a moment even over the page's Wisp connection. git and -// tig are Alpine's riscv64 packages from main (about 6.6 MB to download +// tig are Alpine's aarch64 packages from main (about 6.6 MB to download // with their libraries); git talks HTTPS to GitHub with its own libcurl, // not the image's curl shim. // diff --git a/web/src/demos/mc.ts b/web/src/demos/mc.ts index 717e5ca..4ca47f7 100644 --- a/web/src/demos/mc.ts +++ b/web/src/demos/mc.ts @@ -17,7 +17,7 @@ // archive VFS: Enter on it browses it like a directory. import type { Demo } from "../launcher.ts"; -const README = `Midnight Commander in unkernel: the riscv64 build of mc from Alpine, +const README = `Midnight Commander in unkernel: the aarch64 build of mc from Alpine, running on Linux, compiled to WebAssembly, in this browser tab. The left panel is this directory, the right one is /proc: the kernel's @@ -63,8 +63,8 @@ const UNKERNEL = `unkernel, layer by layer your browser runs one WebAssembly module the kernel Linux, built for arch/wasm with an MMU - user space unmodified riscv64 Alpine Linux binaries - kwemu the RISC-V emulator inside the kernel, with a JIT + user space unmodified aarch64 Alpine Linux binaries + kwemu the aarch64 CPU inside the kernel, with a JIT that turns hot guest code into WebAssembly mc, the shell and everything in /proc come from that stack. Nothing diff --git a/web/src/demos/nginx.ts b/web/src/demos/nginx.ts index beaf5b8..cf25bab 100644 --- a/web/src/demos/nginx.ts +++ b/web/src/demos/nginx.ts @@ -43,7 +43,7 @@ const PAGE = `

Hello from nginx

-

This page is served by nginx, running on Linux in this browser tab. The kernel is WebAssembly, nginx is the riscv64 binary from Alpine, and this request went from the page to the guest over vsock.

+

This page is served by nginx, running on Linux in this browser tab. The kernel is WebAssembly, nginx is the aarch64 binary from Alpine, and this request went from the page to the guest over vsock.

nginx
Guest time
diff --git a/web/src/demos/nitro.ts b/web/src/demos/nitro.ts index 776f1e6..e9b4b31 100644 --- a/web/src/demos/nitro.ts +++ b/web/src/demos/nitro.ts @@ -86,7 +86,7 @@ export default defineHandler(() => { const RUNTIME = `import os from "node:os"; import { defineHandler } from "nitro"; -// The guest's own numbers: Node on riscv64 Linux, compiled to WebAssembly. +// The guest's own numbers: Node on aarch64 Linux, compiled to WebAssembly. export default defineHandler(() => { return { node: process.version, @@ -207,7 +207,7 @@ const PAGE = `

Nitro, running in your browser.

-

A standalone Nitro v3 server. nitro dev runs the ES modules in server/ with no build step, on Alpine's riscv64 Node, on a Linux kernel compiled to WebAssembly.

+

A standalone Nitro v3 server. nitro dev runs the ES modules in server/ with no build step, on Alpine's aarch64 Node, on a Linux kernel compiled to WebAssembly.

connecting...
diff --git a/web/src/demos/node.ts b/web/src/demos/node.ts index 990a658..1389044 100644 --- a/web/src/demos/node.ts +++ b/web/src/demos/node.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa -// Node.js: Alpine's riscv64 nodejs (main, about 25 MB) serving a live +// Node.js: Alpine's aarch64 nodejs (main, about 25 MB) serving a live // dashboard on port 3000 with node:http alone, so no npm install. // // The page polls api/stats every 2 s with fetch: the preview relays plain @@ -54,7 +54,7 @@ function stats() { release: os.release(), hostname: os.hostname(), cpus: cpus.length, - cpuModel: cpus[0] && cpus[0].model !== "unknown" ? cpus[0].model : "", // unknown on riscv64 + cpuModel: cpus[0] && cpus[0].model !== "unknown" ? cpus[0].model : "", // unknown where /proc/cpuinfo names no model (as here) loadavg: os.loadavg(), totalmem: os.totalmem(), freemem: os.freemem(), @@ -75,7 +75,7 @@ function stats() { function bench() { // SHA-256 through OpenSSL for 300 ms, then a sieve in plain JavaScript, - // which V8 compiles to riscv64 code. + // which V8 compiles to arm64 code. const buf = crypto.randomBytes(64 * 1024); let bytes = 0; const t0 = performance.now(); @@ -189,7 +189,7 @@ const PAGE = `
waiting -

This page comes from node:http in server.mjs. Node is Alpine's riscv64 build, unmodified, on a Linux kernel compiled to WebAssembly, in your browser. Every number below is the guest's own, polled every 2 seconds.

+

This page comes from node:http in server.mjs. Node is Alpine's aarch64 build, unmodified, on a Linux kernel compiled to WebAssembly, in your browser. Every number below is the guest's own, polled every 2 seconds.

process.version-
@@ -248,7 +248,7 @@ const PAGE = `

Benchmark

-

SHA-256 through Node's OpenSSL for 300 ms, then a sieve of Eratosthenes in plain JavaScript, which V8 compiles to riscv64 code for the emulator to run.

+

SHA-256 through Node's OpenSSL for 300 ms, then a sieve of Eratosthenes in plain JavaScript, which V8 compiles to arm64 code for the emulated CPU to run.

sha256
-
diff --git a/web/src/demos/nvim.ts b/web/src/demos/nvim.ts index 75934ba..d159cae 100644 --- a/web/src/demos/nvim.ts +++ b/web/src/demos/nvim.ts @@ -315,7 +315,7 @@ vim.keymap.set("n", "", "nohlsearch") const README = `# Neovim on unkernel -Neovim 0.12, the riscv64 build from Alpine, on Linux compiled to +Neovim 0.12, the aarch64 build from Alpine, on Linux compiled to WebAssembly, in this browser tab. The setup is one file with no plugins: config/nvim/init.lua (Space s opens it). @@ -333,7 +333,7 @@ Open hello.c or the config: the highlighting is tree-sitter's. const HELLO = `#include #include -/* Compiled for riscv64, run by the kernel in this tab. */ +/* Compiled for aarch64, run by the kernel in this tab. */ int main(void) { struct utsname u; diff --git a/web/src/demos/postgres.ts b/web/src/demos/postgres.ts index 2ad2e01..3197af7 100644 --- a/web/src/demos/postgres.ts +++ b/web/src/demos/postgres.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa -// PostgreSQL: Alpine's riscv64 postgresql18 (main, about 13 MB to download +// PostgreSQL: Alpine's aarch64 postgresql18 (main, about 13 MB to download // with what it pulls in), a real server in the tab: a small seeded database, // a few showcase queries, then an interactive psql. No ports: there is no // HTTP UI, psql is the interface. diff --git a/web/src/demos/python.ts b/web/src/demos/python.ts index 92c0dc1..4bae50e 100644 --- a/web/src/demos/python.ts +++ b/web/src/demos/python.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa -// Python: Alpine's riscv64 python3 (main, 3.14, about 8.5 MB to download, a +// Python: Alpine's aarch64 python3 (main, 3.14, about 8.5 MB to download, a // little more with the libraries it pulls in) serving a notes wall on port // 8000 from the standard library alone: http.server, sqlite3 and html, so no // pip and no virtualenv. @@ -61,7 +61,7 @@ else: MAX_NAME, MAX_MESSAGE, MAX_BODY, SHOWN = 40, 280, 16384, 100 SEED = [ ("unkernel", "Welcome! This wall is a Python program: http.server and sqlite3 " - "from the standard library, on riscv64 Linux, in your browser tab."), + "from the standard library, on aarch64 Linux, in your browser tab."), ("app.py", "Leave a note below. It goes into SQLite, and the page you get back " "after the redirect lists it here, newest first."), ] @@ -309,7 +309,7 @@ PAGE = string.Template("""
$count -

This page comes from app.py: http.server, sqlite3 and html from the standard library, no pip. Python is Alpine's riscv64 build, unmodified, on a Linux kernel compiled to WebAssembly, in your browser. Notes are stored in SQLite; times are the guest's clock.

+

This page comes from app.py: http.server, sqlite3 and html from the standard library, no pip. Python is Alpine's aarch64 build, unmodified, on a Linux kernel compiled to WebAssembly, in your browser. Notes are stored in SQLite; times are the guest's clock.

diff --git a/web/src/demos/radio.ts b/web/src/demos/radio.ts index 6c8d10e..1a6ee62 100644 --- a/web/src/demos/radio.ts +++ b/web/src/demos/radio.ts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa // Radio: SomaFM's listener-supported internet radio played by mpg123 on the -// guest's sound card. Alpine's riscv64 mpg123 from main pulls in +// guest's sound card. Alpine's aarch64 mpg123 from main pulls in // mpg123-libs and alsa-lib (about 0.8 MB to download). It has the ALSA and // OSS output modules built in (no separate subpackage), and both play on // kwsnd; radio.sh uses ALSA, the card's own interface (OSS is the kernel's @@ -10,8 +10,10 @@ // SomaFM's MP3 streams are 128 kbit/s, 44.1 kHz stereo; everything lower is // AAC, which mpg123 does not decode. That is cheap enough as it is: under // the JIT, mpg123 takes about 5% of the guest's CPU and the whole emulator -// about 6% of a host core (CLI over Wisp, 2026-11-15), so there is no --mono or -2 -// downsampling, and no underruns over Wisp in the runs measured. Each +// about 6% of a host core (riscv64 guest, CLI over Wisp, 2026-11-15), so there +// is no --mono or -2 downsampling; on the aarch64 guest Groove Salad +// started about 1 s after it was picked and played with no underrun (CLI, +// 2026-11-18). Each // station is SomaFM's plain-http playlist (somafm.com/nossl/.pls), the // link SomaFM asks players to use since it does not change. radio.sh fetches // it with wget, since mpg123 -@ exits 0 when the playlist cannot be had, and diff --git a/web/src/demos/speak.ts b/web/src/demos/speak.ts index 0359ff5..abc5662 100644 --- a/web/src/demos/speak.ts +++ b/web/src/demos/speak.ts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa // Speak: the guest talks through its sound card. eSpeak 1.48 (Alpine's -// riscv64 espeak from main) is a formant synthesizer: no recorded voices, +// aarch64 espeak from main) is a formant synthesizer: no recorded voices, // about 70 languages in its 1.2 MB package. With portaudio, alsa-lib and // the JACK client library it pulls in, the download is about 4.9 MB, all // from main, so community stays off. @@ -20,7 +20,8 @@ // they go to /tmp/speak.log, shown only when espeak fails, and // JACK_NO_START_SERVER keeps the JACK client from trying to start one. That // probing is most of espeak's start-up: a sentence plays about 0.45 s -// after espeak starts (CLI, 2026-11-15). Text goes in on stdin, so a line +// after espeak starts (riscv64 guest, CLI, 2026-11-15; on aarch64 a +// one-word espeak call, playback included, takes about 1.0 s, 2026-11-18). Text goes in on stdin, so a line // that starts with a dash is not taken as an option. // // The INT trap (a handler, reset in children) makes Ctrl-C cut espeak off @@ -29,7 +30,7 @@ import type { Demo } from "../launcher.ts"; const SPEAK = String.raw`#!/bin/sh -# The machine speaks: eSpeak, a speech synthesizer, running on riscv64 Linux +# The machine speaks: eSpeak, a speech synthesizer, running on aarch64 Linux # in the browser and playing through the guest's sound card. export JACK_NO_START_SERVER=1 LOG=/tmp/speak.log @@ -65,8 +66,8 @@ intro() { procs=$(ls -d /proc/[0-9]* | wc -l) say "Hello! I am Linux $kver, running in your browser." - whisper "(psst: on an emulated RISC-V processor, inside WebAssembly)" \ - "psst. on an emulated risk five processor, inside WebAssembly." + whisper "(psst: on an emulated Arm processor, inside WebAssembly)" \ + "psst. on an emulated arm processor, inside WebAssembly." say "I have been up for $up, with $procs processes running." } diff --git a/web/src/demos/sqlite.ts b/web/src/demos/sqlite.ts index dffa685..1fbcacd 100644 --- a/web/src/demos/sqlite.ts +++ b/web/src/demos/sqlite.ts @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa -// SQLite: Alpine's riscv64 sqlite (the sqlite3 shell, main, about 1.4 MB to +// SQLite: Alpine's aarch64 sqlite (the sqlite3 shell, main, about 1.4 MB to // download with readline and ncurses), querying the running guest itself: // SQL over the live Linux in the browser, where the postgres demo has a seeded // dataset. No server and no ports: sqlite3 is the interface. @@ -9,7 +9,7 @@ // installed packages from apk's database (/lib/apk/db/installed: P:, V:, T:, // L:, o:, I:, D:, p:, i: and R: lines, records separated by blank lines; // /etc/apk/world), the processes (/proc//status and cmdline), the mounts -// (/proc/mounts) and a few facts (uname, /proc/cpuinfo's ISA string, +// (/proc/mounts) and a few facts (uname, /proc/cpuinfo's feature list, // /proc/meminfo). busybox awk turns each into INSERT statements, quoting with // a q variable since the programs sit in single quotes. The snapshot tables // are dropped and made again, so a rerun sees packages installed meanwhile; @@ -18,7 +18,7 @@ // reboots), with a system.db symlink to it in the demo's directory, else // system.db there itself. // -// Dependencies are kept as written (so:libc.musl-riscv64.so.1, cmd:sh, +// Dependencies are kept as written (so:libc.musl-aarch64.so.1, cmd:sh, // /bin/sh), and the needs view resolves them through provides (each package's // own name plus its p: names) to package-to-package edges. tree.sql walks // them down from a package; apk-del.sql works out what apk del would remove: @@ -139,7 +139,7 @@ facts() { printf 'kernel\t%s\n' "$(uname -sr)" printf 'machine\t%s\n' "$(uname -m)" awk -F': *' '{ k = $1; sub(/[ \t]+$/, "", k) } - (k == "isa" || k == "mmu") && !(k in seen) { seen[k] = 1; print toupper(k) "\t" $2 }' /proc/cpuinfo + k == "Features" && !(k in seen) { seen[k] = 1; print "features\t" $2 }' /proc/cpuinfo awk '/^MemTotal:/ { print "memory\t" int($2 / 1024) " MiB" }' /proc/meminfo awk '{ printf "uptime\t%d min %d s\n", $1 / 60, $1 % 60 }' /proc/uptime printf 'database\t%s\n' "$db" @@ -292,23 +292,20 @@ const SHOWCASE = String.raw`-- Queries over the snapshot snapshot.sh just took, .print .print '── This system: the system table' -SELECT fact, value FROM system WHERE fact <> 'ISA' ORDER BY rowid; +SELECT fact, value FROM system WHERE fact <> 'features' ORDER BY rowid; .print -.print "── The CPU's ISA string from /proc/cpuinfo, split into extensions by a recursive CTE" +.print "── The CPU's features from /proc/cpuinfo, split into a list by a recursive CTE" WITH RECURSIVE split(i, ext, rest) AS ( - SELECT 0, NULL, (SELECT value FROM system WHERE fact = 'ISA') || '_' + SELECT 0, NULL, (SELECT value FROM system WHERE fact = 'features') || ' ' UNION ALL - SELECT i + 1, substr(rest, 1, instr(rest, '_') - 1), substr(rest, instr(rest, '_') + 1) FROM split WHERE rest <> '' + SELECT i + 1, substr(rest, 1, instr(rest, ' ') - 1), substr(rest, instr(rest, ' ') + 1) FROM split WHERE rest <> '' ) SELECT CASE - WHEN ext GLOB 'rv*' THEN 'base and single letters' - WHEN ext GLOB 'zi*' THEN 'CSRs, counters, cache ops, hints' - WHEN ext GLOB 'zb*' THEN 'bit manipulation' - WHEN ext GLOB 'zk*' THEN 'scalar crypto' - WHEN ext GLOB 'za*' THEN 'atomics' - WHEN ext GLOB 'z[fd]*' THEN 'floating point' - WHEN ext GLOB 'zc*' THEN 'compressed' + WHEN ext IN ('fp', 'asimd') THEN 'floating point and SIMD' + WHEN ext IN ('aes', 'pmull', 'sha1', 'sha2', 'sha3', 'sha512') THEN 'crypto' + WHEN ext = 'crc32' THEN 'checksums' + WHEN ext = 'atomics' THEN 'atomics (LSE)' ELSE 'other' END AS kind, count(*) AS n, group_concat(ext, ' ' ORDER BY i) AS extensions diff --git a/web/src/demos/sshfs.ts b/web/src/demos/sshfs.ts index ee8e3ec..cd698cf 100644 --- a/web/src/demos/sshfs.ts +++ b/web/src/demos/sshfs.ts @@ -7,7 +7,7 @@ // openssh-client and glib) and tree, about 4.3 MB to download, and mc // (about 1.7 MB more, since it shares glib) to browse the mount after. // httpdirfs, the other idea (an HTTP directory listing as a file system), -// has no riscv64 build in Alpine v3.24, and rclone's http backend is a +// is not in Alpine v3.24, and rclone's http backend is a // 37 MB download. // // The guest's TCP goes through the page's Wisp server, which lets port 22 diff --git a/web/src/demos/tmux.ts b/web/src/demos/tmux.ts index 0d9d4a7..84ae13c 100644 --- a/web/src/demos/tmux.ts +++ b/web/src/demos/tmux.ts @@ -52,7 +52,7 @@ while :; do done `; -const README = `tmux in unkernel: a terminal multiplexer, the riscv64 build from Alpine, +const README = `tmux in unkernel: a terminal multiplexer, the aarch64 build from Alpine, running on Linux in this browser tab. Ctrl-B % split left and right Ctrl-B " split top and bottom diff --git a/web/src/demos/valkey.ts b/web/src/demos/valkey.ts index 1e93602..8890e62 100644 --- a/web/src/demos/valkey.ts +++ b/web/src/demos/valkey.ts @@ -1,7 +1,7 @@ // SPDX-License-Identifier: MIT // Copyright (C) 2026 Pooya Parsa // Valkey: the BSD-licensed, Redis-compatible key/value server, Alpine's -// riscv64 valkey and valkey-cli from main (about 1.7 MB to download; the +// aarch64 valkey and valkey-cli from main (about 1.7 MB to download; the // libssl3 and libcrypto3 they link are already in the image). Alpine's redis // (about 2.1 MB, AGPL/SSPL) works the same way but is in community, and // enabling community makes every later apk command in the guest about 2 s @@ -150,7 +150,7 @@ cmd() { } section() { printf '\n\033[1m── %s\033[0m\n' "$1"; } -section "The server: INFO server, on riscv64 Linux in your browser" +section "The server: INFO server, on aarch64 Linux in your browser" printf "$P %s\n" "INFO server (some of its lines)" valkey-cli INFO server | tr -d '\r' | grep -E '^(valkey_version|os|arch_bits|process_id|tcp_port|uptime_in_seconds|multiplexing_api|config_file):' diff --git a/web/src/fx.ts b/web/src/fx.ts index c9f09c9..4ba8e61 100644 --- a/web/src/fx.ts +++ b/web/src/fx.ts @@ -57,7 +57,7 @@ machine in the page's other terminal windows. - Each command runs in a fresh \`/bin/sh -lc\` and must finish within your tool's time limit (30 s at most). Start longer work in the background (\`nohup cmd > /tmp/cmd.log 2>&1 &\`) and check on it. -- The CPU is emulated (an aarch64 interpreter, in the browser), +- The CPU is emulated (an aarch64 interpreter with a JIT, in the browser), so builds and installs are slow. Prefer prebuilt packages. - Install software with \`apk add \`; run \`/etc/kw-apk-enable\` first to enable the community repository. The network, when the page has