ecmaOS
ecmaOS : A Web Machine
Made with ❤️ by Jay Mathis
ecmaOS is a Linux-like machine that runs in a browser tab. Open ecmaos.sh and you get a login prompt, a shell, and a filesystem that is still there tomorrow. No install, no account, no server: the machine lives in your browser's storage, and the browser's sandbox is what contains it.
It is not a toy shell. Every command is a real process with a pid, signals, exit codes and a controlling terminal. /sbin/init starts the system from /etc/inittab, getty logs you in, and your programs run as you, with su and sudo. The shell is checked against bash, the coreutils against GNU output, and the programs you would reach for are the real ones, built to WebAssembly: Vim, nano, GNU make, bash, CPython, Perl, tmux, ssh, sqlite3, jq, Lua and more.
python3 -u -m http.server 8000 & # CPython's own server, in the background
curl -si http://localhost:8000/ # and a client talking to it over loopback
ps aux # real processes, real pids
vim notes.txt # the real Vim
install axios # a package from npm
What sets it apart is that the browser is part of the machine. WebUSB, Web Serial, WebHID, Web Bluetooth, cameras, speakers and MIDI show up as ordinary Linux device files (/dev/ttyACM0, /dev/hidraw0, /dev/video0, /dev/snd/pcmC0D0p), so microcom -s 115200 /dev/ttyACM0 talks to a board you plugged in, and aplay song.wav plays through your speakers. There is a desktop (startx), and the same kernel runs in Node (@ecmaos/node), where other ecmaOS machines can log in to it.
Early days. ecmaOS 1.0 is a first stable release of young software that keeps your machine in your browser. Clearing the site's data destroys it, so copy out anything that matters. Chromium-based browsers get the most; see Browser support, Known gaps and Early Days.
It is not a Linux kernel written in JavaScript, and it does not run Linux. It follows Linux's interfaces closely where a browser allows (execve, /proc, /sys, ioctl, evdev, ALSA, V4L2) so that real programs and your habits carry over, and it says plainly where they do not.
"The computer can be used as a tool to liberate and protect people, rather than to control them." — Hal Finney
Features
- Real processes. Every command runs through a worker-hosted
execve, with real pids, signals, exit codes, sessions and controlling terminals;/sbin/init,getty, runlevels and an orderlyreboot,haltandpoweroff - A real user system.
/etc/passwd,/etc/groupand/etc/shadowin the Linux format,suandsudoas setuid programs,useraddand friends, storage quotas and POSIX ACLs - Two shells, checked against bash. The built-in one and
/bin/ecmash(/bin/sh), with heredocs, arrays, functions, job control,trap, completion and a readline editor; GNU bash is there too, as one of the copyleft programs - Real programs. Vim, nano, GNU make, CPython and
pip, Perl, Lua, MicroPython, QuickJS, sqlite3, jq, tmux, ssh and scp (Dropbear), rsync and the compressors, with WebAssembly as the native executable format (# ./hello.wasm --world); copyleft programs ship with their source - GNU-compatible coreutils. More than 380 commands compared against GNU output, and a
manpage for nearly everything - Devices are files. WebBluetooth, WebSerial, WebHID, WebUSB, cameras, sound, MIDI, gamepads and sensors appear under
/devthe way Linux names them, and come and go as hardware does - A desktop and graphics.
startx, Linux framebuffers and evdev input, a Wayland compositor (wlcomp), and SDL 3 with OpenGL ES, enough to playdoom - Networking. POSIX sockets between programs, and a gateway (
gateway up) for real TCP and UDP;ss,ip,digandpingreport the machine honestly - Node and peers. The same kernel in a Node process (
ecmaos --listen), which other ecmaOS machines can log in to, mount from and attach devices of;Peeris the wire protocol they speak - Filesystems and modules. Multiple backends powered by zenfs, and kernel modules loaded with
insmodandmodprobe - Extensible. Install any client-side npm package (
# install axios), write apps, and run an API server inside a service worker withSWAPI(Hono); the terminal is xterm.js, text is translated with i18next
Basic Concepts
Accessibility
- Screen reader mode. The terminal is xterm.js. In its screen reader mode what is printed is also kept in an accessibility tree (a live region) that a screen reader announces. It is off by default. Turn it on for one visit with
?screenreaderin the address (?screenreader=0turns it off), or for good withscreenReaderMode = truein/etc/terminal.tomlor~/.config/terminal.toml - The address works from the first prompt, so the profile question and the login are announced too; the file is read at login
- What is not known. This has been checked only as far as the option being set and xterm building its accessibility tree; it has not been used with a screen reader. Windows of the desktop and the apps in them are drawn by their own programs and have had no accessibility work at all. Reports and fixes are welcome
Apps
- An app is a program that opens a window:
code(Monaco),webamp, thestartxdesktop. A command-line tool is not an app; it is an ordinary program (a Node script or a WebAssembly build) and needs no ecmaOS-specific header - An app is an npm package whose bin file starts with the shebang line
#!/bin/app(see App Development);/bin/apponly runs a file that belongs to root and that no one else can write, which is what a package root installs is. Its default export (or exportedmainfunction) is called with theProcessEntryParamsobject - An app is trusted code. Its
mainruns on the page's main thread with the livekernel, so that it can build DOM and windows.params.shellacts as the user who started it, butparams.kernel(filesystem,users,windows...) has the kernel's own authority whoever that was: a file that user cannot read, the app can. Install an app only from a source you trust. A?screen=page and the Node host run an app in a sandboxed frame instead, where it reaches the machine only through theAppSdk - The
@ecmaos-appsnpm scope is where ecmaOS publishes its signed packages, programs such asvimandjqincluded; being in it does not make a package an app. Refer to the full list on npm, and to APPS.md for community apps (submit a PR to add yours) - Install one from the terminal with
install, e.g.# install @ecmaos-apps/code, and run it by name (bins are linked to/usr/bin):# code /root/hello.js - During development, it can be useful to run a Verdaccio server to test local packages:
# npm publish --registry http://localhost:4873in your app's directory, then inside ecmaOS# install @myscope/mypackage --registry http://localhost:4873
Execution Model
Every runnable file in ecmaOS - a coreutil, a kernel command, an app, a WASM binary - is dispatched the same way: Kernel.execute reads the file's header (a shebang or magic bytes) and routes it to a real, worker-hosted execve process (from @zenfs/linux's process/thread model). That process has a real pid, real signals, and a real exit code, and can be killed, waited on (proc_wait), and listed (ps) like any other process.
/bin/node(/core/kernel/src/bin/node.mjs) runs any plain JavaScript program (#!/usr/bin/env node, or a coreutil with no shebang) inside the worker, with a smallglobalThis.ecmaosSyscallsbridge to the real syscall table. This is how every@ecmaos/coreutilscommand runs -cat,ls,grep,free, and the rest are just JS files executed this way, not special-cased kernel code.- npm packages run. A program that
requires orimports files, packages or Node's own modules (CommonJS, or an ES module; any#!/usr/bin/env nodecommand) is run by/bin/node's loader (/core/kernel/src/bin/loader) instead of being imported whole. It resolves as Node does:node_moduleswalked up from the real file (installlinks each package's dependencies into itsnode_modules, so a package finds the versions it was installed with),exportsandimportsmaps with their conditions,mainandindex, and, for a package installed beforenode_moduleswas laid out, the highest version in/usr/libor~/.local/lib. Each module runs once, in a registry keyed by its real path, so a cycle sees the exports so far. An ES module is converted withsucrase(live bindings, top-levelawait,import.meta,import()), loaded only when a program has one to run. The program stays alive until its timers, children, requests and reads are done, and ends withprocess.exitCode, as Node's does. The Node modules are CommonJS files in/usr/lib/node/builtins, bundled at build time (src/bin/node-builtins) and written at boot behind one stamp:process,fs(andfs/promises, streams),path,events,buffer,util(withparseArgs),url,os,stream,child_process(spawn,exec, the*Syncforms, piped stdio overproc_spawn),readline,timers,crypto,zlib,assert,vm,httpandhttpsclients overfetch,module,tty,string_decoder,querystring,punycode,perf_hooks,async_hooks,worker_threads(the main thread only),v8,inspector,diagnostics_channel,dns, and stubs that load and say they are unavailable when used fornet,tls,dgram,http2andcluster(andhttp.createServer). A program with nothing to resolve (a bundle, even one with top-levelawait) is imported as it always was. /bin/wali(/core/kernel/src/bin/wali.mjs) runs WALI-format WebAssembly modules - musl compiled to call@zenfs/linux's real kernel syscalls (SYS_open,SYS_read, ...) directly, not through a WASI ABI. WALI and WASI Preview 1 are different, incompatible module formats.utils/check-wali.shbuilds and pins the toolchain for them: WALI's musl with ecmaOS's patches (utils/wali/patches), the Linux UAPI headers (linux/*.h), compiler-rt, and libc++, libc++abi and libunwind, with C++ exceptions andsetjmp/longjmpon WebAssembly exception handling. Such a program is Linux to itself (Linuxerrnovalues and structures, a realsyscall()), and returning frommainflushes its output and runs itsatexithandlers; an exception it does not catch ends it bySIGABRT. ecmaOS adds to the dependency's host what it lacks (/core/kernel/src/bin/wali-host.mjs): the*atcalls against a directory descriptor,fcntldescriptor flags,getdents64that reaches the end,mmapthat reuses freed ranges and fills private file mappings, shared mappings of files and devices (a framebuffer) kept in step with them at calls, as the Emscripten programs' are,memfd_create(a file in/dev/shm, unlinked as it is made) andfallocate(which grows a file), and the input, framebuffer and GL devices' ioctls. Processes and signals are POSIX's:posix_spawn(andsystemandpopenon it) starts a child with a copy of the caller's descriptors, close-on-exec flags and file actions applied as a forked child would,waitpidandexecvework, the ignored signals and the mask carry into a child and across an exec, and a handler runs when the call the program is in returns, withEINTRor a restart (SA_RESTART) for a call it interrupted;sleep,pause,sigsuspend,sigprocmaskandraisebehave as on Linux, and a write nothing will read raisesSIGPIPE. Job control is Linux's: a stopped process stays stopped untilSIGCONT(which continues it whether or not it catches it), aWUNTRACEDwait reports the signal that stopped it, and a process reading its controlling terminal from the background getsSIGTTIN(EIO when it ignores or blocks it), withSIGTTOUfor changing the terminal's settings or writing withTOSTOP; ptys (posix_openpt,ptsname,TIOCSWINSZ, andTIOCPKTpacket mode with its data byte) work, and a process sets its user and group ids withsetuid,setreuid,setresuidand the group calls, by Linux's rules (root sets any; another user only to an id it holds), withgetresuid,getgroupsandsetgroups.forkworks only in a program built with Asyncify (CPython, Perl, GNU screen, bash, tmux and dropbear are): the call unwinds the program's stack and resumes it in the child, and any other program has noforkand usesposix_spawn. Threads are POSIX threads: each runs in a worker of its own on the program's one shared memory, with the process's descriptors, working directory, credentials, allocator and signal dispositions (its signal mask is its own), futexes onAtomics, andexit()or a fault in any thread ending the process. Stream sockets are files: one descriptor the kernel reads, writes and polls, which a child can inherit, forsocketpair,AF_UNIX(a socket bound to a path is a socket file there too, whichstatandlsshow ass, thatchmodandunlinkchange, and that a path already in use refuses withEADDRINUSE; closing it leaves the file, as on Linux), andAF_INET/AF_INET6on loopback or through the gateway, withepoll,MSG_PEEK,MSG_DONTWAITandO_NONBLOCK(whichfcntlnow sets on the open file, so it also holds for pipes); a connection still talks to an Emscripten program ornodeholding it as a pair of pipes. Datagram sockets (UDP,sendmsg/recvmsg) work, and a local socket passes descriptors (SCM_RIGHTS) and says who is at the other end (SO_PEERCRED). The programs ecmaOS ships are built this way (wasm/<name>/build.shincore/utilsorcore/utils-copyleft): the Wayland compositorwlcomp,doom(doomgeneric in a window, on SDL 3's Wayland driver, with libwayland and libxkbcommon built the same way), the desktop demos (wldemoon libwayland-client;sdlsnake,sdlpaint,sdlclip,sdlpad,sdlglandsdlgearson SDL 3),vim(andvi; Vim 9.1 with a subset of its runtime: syntax highlighting and filetype detection for common languages, no:help),sqlite3(the SQLite shell, with linenoise history),jq,lua(Lua 5.4),qjs(QuickJS, withos.execandos.Worker),bc(anddc, a link to it),tree,make(GNU make, with-j),nano(with ncurses),htop(with ncurses, reading/proc),perl(Perl 5.44 with the core modules linked in; it forks, so it is built with Asyncify:system, backticks and pipe opens work),screen(GNU screen, with ncurses; it forks, so it is built with Asyncify: windows, detach and reattach,-X, and a board's serial console withscreen /dev/ttyACM0 115200),aplay,arecord,amixerandspeaker-test(ALSA's tools on alsa-lib, which reach the browser's speakers and microphone through/dev/sndas they reach a card on Linux),bzip2,xz,zstdandlz4(withunlz4andlz4cat; the last three compress on threads with-T),brotli,ed,mandoc,ncdu,mg,patch(toybox) andmicropython(MicroPython 1.29, with asyncio, threads (_thread) and a set of micropython-lib modules frozen in; its garbage collector scans the C stack, so the build has Binaryen spill wasm locals to it, seecore/utils/wasm/micropython/build.sh). Where a program forks to run a command (Vim's:!and filters, nano's^T, ncdu'sb, mg's shell commands, make's recipes), it starts it withposix_spawn. Every other WebAssembly program runs as a worker process under/bin/walitoo; see Running other WebAssembly.- The package managers people type.
apt,apt-get,apt-cache,dpkg,pacman,npm,npx,yarnandpnpmare front-ends ofinstall(/core/kernel/src/bin/commands/lib/install): the same engine, database, cache and signature checks under each tool's own commands, flags and output. The distribution tools take their own package names;@ecmaos/package-index(/utils/package-index, an npm package with a copy built in, refreshed byapt update/pacman -Sy) maps each to the npm package that provides it, says which names ecmaOS ships already, and a name it does not know is refused with the npm packages that look close, never guessed at.npm,yarnandpnpminstall into the project:node_modules/NAMElinked tonode_modules/.ecmaos/NAME/VERSION(each with its ownnode_modules), bins innode_modules/.bin,package.jsonkept up to date, scripts run withnode_modules/.binon thePATH;-gisinstall's scope (/usrfor root,~/.localfor anyone else);npxanddlxfetch a package into the cache and run its bin. There is no lockfile.pip/pip3install from PyPI (/core/kernel/src/bin/commands/lib/pip): the JSON API, PEP 440 versions and PEP 508 requirements with their markers evaluated for this machine, pure-Python wheels checked against PyPI's SHA-256 and unpacked into CPython'ssite-packages(the system's as root,~/.localotherwise) with thedist-inforecords Python's own tools read (pip keeps no database of its own); a project with only native wheels or source distributions is refused with the reason. The programs are grouped as meta-packages (@ecmaos-apps/group-*, and the profilesprofile-*of groups), a package can recommend, suggest, conflict with, replace or require a kernel ("ecmaos": { "requires": ... }),install holdandinstall rollbackpin and undo a version,/etc/ecmaos/sources.dmaps scopes to registries, and@ecmaos-appsis checked against an Ed25519-signed index (--allow-unsignedfor a registry of your own). A machine keeps one of four profiles (minimal,standard,developer,everything, in/etc/ecmaos/profile) of those programs: a browser's first boot asks once on the terminal (Standard after 15 seconds, with what each downloads), Node, scripts and tests get Standard (KernelOptions.profile,?profile=andECMAOS_PROFILEpick one), and a machine that already had programs becomes Everything and loses none. The boot records what it installed in the install database (each program aseededentry, then groups and the profile), soapt,pacmanandinstallsee it; installing a program's package replaces the catalog's copy in/bin, andprofile set NAMEchanges the profile, showing what a smaller one removes first. - Emscripten programs run under
/bin/walitoo.core/kernel/src/bin/emscripten.mjs(loaded on demand next towasip1.mjs) translates an ordinary (non-standalone) emcc build'senv.__syscall_*andwasi_snapshot_preview1imports onto the real syscalls, so a C program built withemccruns as a worker process with a pid, signals and a controlling terminal. None of the programs ecmaOS ships is built this way now; the shim answerssystem(),strptime,gmtime/timegm,readdirand advisory file locks for such a program (locks are always granted). libecmaos (core/utils/wasm/lib/ecmaos.sh) is what ecmaOS adds to Emscripten's libc so such a program has processes and signals as a WALI one does:posix_spawn(the same host call, /core/kernel/src/bin/spawn.mjs),execve,waitpid,kill,systemandpopen, its real pid, the kernel's signals run through its handlers,alarmandsetitimer, and sleeps a signal ends; none of the programs shipped now needs it. The binaries are not part of the kernel bundle, whichever way they are built: each is committed in the package that owns it (core/utils-copyleft/programs/for the copyleft ones,core/utils/programs/for the permissively licensed ones, each with amanifest.json), the site serves them under/programs/with a catalog, and boot writes a program into/binonly when the installed copy differs from the catalog's. /bin/app(/core/kernel/src/bin/commands/app.mjs) is the interpreter of the apps, by the#!/bin/appshebang on their bin file, through the main-thread presenter (/core/kernel/src/tree/lib/presenters/app.ts): the real process is still a worker with a pid and signals, but the app'smain(params)runs on the main thread, where it hasdocumentand the livekernel/shell/terminal, and the process lives as long asmaindoes (or until its window closes). On a host with no page of its own (the Node host) the same app runs in a sandboxed window frame and reaches the machine only through theAppSdk(see App Development).- Main-thread custom syscalls. A worker can't reach the DOM, WebAuthn, or the kernel's own singletons directly - only the main thread can.
core/kernel/src/tree/lib/main-thread-syscalls.tsuses@zenfs/linux's publicdefine_syscallto register ecmaOS-specific syscalls (window_create,window_write,window_close,window_list,window_focus,window_move,window_resize,window_set_title,storage_usage,users_lookup,klog,proc_spawn,proc_wait, and more) that a worker-hosted process can call like any other syscall; the handler runs on the main thread and the result crosses back over the sameAtomics.wait-blocking syscall ABI@zenfs/linuxuses for its own syscalls. This is how a worker-hosted coreutil or kernel command reaches main-thread-only capability without itself running on the main thread. - The manifest
syscalls/devicesallowlist. A program at/path/to/programmay ship a sibling/path/to/program.manifest.json:{ "syscalls": ["read", "write", "openat"], "devices": ["tty", "echo"] }. When present,core/kernel/src/tree/lib/syscall-policy.tsrefuses any syscall the manifest doesn't list with-EPERMbefore the real handler runs, andKernel.registerDevices()'s per-major device dispatch enforcesdevicesthe same way at the point a device node is opened. A program with no manifest is unrestricted (today's default), so the allowlist is opt-in per-program rather than mandatory.
Running other WebAssembly
/core/kernel/src/bin/wali.mjs · /core/kernel/src/bin/wasip1.mjs · /core/kernel/src/bin/wasip2.mjs · /core/kernel/src/bin/emscripten.mjs
Every WebAssembly program is a worker process with a pid, signals, a controlling terminal and an exit status, whatever it was built for; there is no main-thread host. /bin/wali reads the module's imports and picks the ABI:
| Built for | Recognized by | Build it with | Notes |
|---|---|---|---|
| WALI (preferred) | imports from wali |
WALI's musl, utils/check-wali.sh |
Linux to itself: real errnos, threads, sockets, posix_spawn, job control |
| WASI Preview 1 | imports wasi_snapshot_preview1 |
wasm32-wasip1 (Rust, wasi-sdk, Go's GOOS=wasip1) |
_start or a reactor's _initialize; preopens are /, . and each top-level directory; sockets, poll_oneoff and proc_exit work, fork and threads do not |
| WASI Preview 2 | a component (\0asm with the component layer) |
wasm32-wasip2 (Rust), wasm-tools component new, jco componentize |
Transpiled by the kernel with jco, run on a wasi:* 0.2 host; see Known gaps |
| Emscripten | imports env.__syscall_* |
emcc (not STANDALONE_WASM) |
A compatibility layer for existing builds; ecmaOS ships none; libecmaos adds processes and signals |
What does not work: a module that exports none of _start, _initialize or main is a library and is refused with a message; a module that imports something the host lacks fails to start and names it; fork (use posix_spawn), WASI 0.3, wasi:http and wasi-threads are not provided.
Run one by path (./hello.wasm) or put it in /bin. wasm info ./hello.wasm names its ABI and lists the imports ecmaOS does not provide; man wasm has the details.
Commands
Commandsare the kernel's own programs, e.g.download,install,load,mount,passwd. Each is a realexecve'd program that reaches main-thread-only capabilities (DOM, WebAuthn, the kernel's singletons) through custom syscalls and presenters, same as any other program in the execution model above.
Coreutils
Coreutilsare similar toCommands, but are provided by the@ecmaos/coreutilspackage, e.g.cat,chmod,cp,echo,git,ls,mkdir,mv,pwd,rm,rmdir,stat,touch, etc. They run under/bin/nodein the execution model above, using plain filesystem/process syscalls - no kernel-singleton access, and no shell-state mutation (a coreutil can't change its own shell's cwd or env; that's what the shell builtins are for).
Devices
- Refer to the full list of official devices on npm
- See the DEVICES.md file for a list of community devices; submit a PR to add your device!
- Devices get loaded on boot, e.g.
/dev/bluetooth,/dev/random,/dev/battery, etc. - A device can support being "run" by a user, e.g.
# /dev/battery status - Devices may also be directly read/written using
fsmethods, and will behave accordingly (or have no effect if not supported) - An individual device module can provide multiple device drivers, e.g.
/dev/usbprovides/dev/usb0,/dev/usb1and so on, one per granted device (see Device Examples)
Desktop and graphics
/apps/desktop · /core/kernel/src/tree/lib/fb.ts · /core/utils/wasm
- Desktop.
startx(in the Standard profile and up;install @ecmaos-apps/desktopotherwise) starts a desktop over the console: a taskbar, a start menu that groups the.desktopentries in/usr/share/applicationsby category (Accessories, Development, Games, Graphics, System...) and has a search box (the boot writes the entries of the programs it installs, fromutils/package-index/launchers.json;installlinks the ones a package ships; an entry whose program is gone is left out, and one markedX-ecmaOS-Wayland=truestartswlcompfirst when it is not running), a window list, terminal windows (a login shell on a pty each), a Login window, workspaces (Alt+Shift+1 to 9; Ctrl+Shift+1 to 9 takes the focused window along), snapping and tiling and a wallpaper, kept in~/.config/ecmaos/desktop.json. A window dragged to the top edge of the work area maximizes, to a side it takes that half, to a corner that quarter (an outline shows where it goes; pulled off again, it gets its old size back). Alt+Shift+Left and Right tile the focused window to a half, Up maximizes it (on a half: its top quarter) and Down puts a maximized window back (on a half: its bottom quarter). The browser and the system keep some key combinations, so the bindings are thekeysofdesktop.json(tileLeft,tileRight,tileUp,tileDown, andworkspace,workspaceMoveandconsole, which are modifiers only: Alt+Shift, Ctrl+Shift and Alt+Shift); a binding needs Ctrl, Alt or Meta. Hot corners and edges are off until mapped:hotZonesindesktop.jsonmapstop-left,top,top-right,left,right,bottom-left,bottomandbottom-righttomenu,overview(every window by workspace, to pick one),show-desktop(minimizes the workspace's windows; again brings them back),next-workspace,previous-workspaceorlaunch:<name of a .desktop file>, after the pointer has stayed there forhotDelaymilliseconds (400 by default). They stay quiet during a window drag, while a button is held, and while a window is fullscreen or has locked the pointer. Alt+Shift+F1 to F8, or Exit, returns to the console.wmctrllists, moves, switches and closes windows from the shell. - Framebuffers.
fbwinopens a window with a Linux framebuffer device,/dev/fb<N>(major 29, up to 32): writexrgb8888pixels to it, ormmapitMAP_SHAREDfrom a WebAssembly program.FBIOGET_VSCREENINFOandFBIOGET_FSCREENINFOdescribe it,FBIO_WAITFORVSYNCwaits for the next painted frame, andfbwin -rmakes a screen that follows the window's size. - Input.
/dev/input/event0(keyboard) andevent1(pointer) are evdev nodes fed from the page, withinput_eventrecords,polland theEVIOCG*ioctls; each framebuffer window adds one of its own (event<2+N>) for the input it receives. Each gamepad the browser shows (once a button has been pressed on it) isevent<N>fromevent34up and/dev/input/js<N>, with Linux's gamepad codes (BTN_SOUTHand the rest, sticks and analog triggers asABS_*axes, the d-pad as a hat),EV_FFrumble, the joystick API'sJSIOC*ioctls and names under/dev/input/by-id; it goes when the pad does, and a program that still has it open getsENODEV.evtestshows any of them. - Wayland.
wlcomp &is a Wayland compositor:wl_compositor,wl_shm, xdg-shell toplevels,wl_seat(pointer and keyboard), cursor shapes and images, maximize, fullscreen and minimize, and a clipboard shared with the browser. Each toplevel is a framebuffer window. libwayland-client and libxkbcommon are built for WebAssembly programs (core/utils/wasm/lib). - SDL 3 and OpenGL ES. SDL 3 runs on its Wayland driver, with audio to
/dev/dsp1, joysticks through its own Linux driver on/dev/input/event<N>, and OpenGL ES 2 through/dev/gl<N>(major 227), a context each drawn by the browser's WebGL2. The demos arewldemo,sdlsnake,sdlpaint,sdlclip,sdlpad,sdlglandsdlgears, anddoom(@ecmaos/coreutils-copyleft; bring your own WAD, Freedoom works) runs on the same stack. Each has a man page. - Other screens. In the Node host (
ecmaos), windows open as host windows through a loopback display server (the system web view when@webviewjs/webviewis installed), and apps with a display entry (code,webamp) run in a sandboxed frame there. A browser page at?screen=HOSTis a screen of a machine started withecmaos --listen: it logs in with a key of its own and draws that machine's windows.
Filesystems
ecmaOS supports multiple filesystem backends powered by zenfs, allowing you to mount various storage types into the virtual filesystem.
One tab per machine
The root filesystem is an IndexedDB store that each tab loads whole into its own memory, and new files take their ids from that copy, so two tabs on one store would overwrite each other's files. The kernel therefore holds a Web Lock named for the store (ecmaos:machine:zenfs) for as long as it runs, taken before the store is loaded. A second tab on the same origin shows "This machine is running in another tab" and starts by itself when the first closes, crashes or halts; "Use it here instead" takes the machine over, and the first tab then stops (its writes are fenced off, its programs killed) and offers "Take it back", which reloads it with what the other tab saved. reboot, halt and poweroff wait for pending writes to reach IndexedDB first. There is no guard for a host without Web Locks (the Node host, tests) or a root that is not the default IndexedDB store. Guest session. The notice's third button runs a scratch machine in that tab: the root is in memory, the stamps that say what is installed are throwaway keys (removed when the tab goes), nothing is saved, format refuses (it would otherwise wipe the other tab's machine), and a badge in the corner says so. Closing the tab ends it; the other tab is untouched. fsck reads the whole root and reports what two tabs sharing one store leave behind (one inode number used by unrelated files, a directory reached twice, with --read a file shorter or longer than its inode says); it changes nothing. A pagehide flush is not provided: writes are issued as the program makes them, so a closing page has nothing buffered to flush, and a page cannot wait for IndexedDB while it unloads.
Consoles in other tabs. The notice's "Open a console on it" button, or the address ?display=N (N is 0 to 7, with &machine=NAME for another machine), turns a second tab into a display of one of the running machine's terminals: no kernel or filesystem runs in it. The tab that owns the machine mirrors that terminal's output over a BroadcastChannel and takes the keys, the window size and the tab's presence (a Web Lock the display holds) back, so login, shells and programs behave as at its own screen. A tty with several displays is as big as the smallest. Browser calls that need the page the user is at (xclip, notify-send, say, open of a URL or a file to download, upload) are done by the display the user last typed at, since the owner's tab may be in the background (the owner reads the file for a download and writes what upload picked, so the display needs no filesystem). A display notices when the machine goes away (the owner reloaded, closed or halted) and attaches again, from a fresh screen, when one answers. It is an experiment: the session token travels on a channel any page of the origin can read, which is no boundary since such a page can read the machine's IndexedDB root anyway; Ctrl+Shift+N in a display attaches it to that tty (the tab reloads onto it); video and audio play in a full-page overlay of the display (the owner sends the file); a program that opens a window with the machine's own window manager (edit, web) still opens it in the owner's tab.
Several machines on one origin. ?machine=NAME (lowercase letters, digits and dashes, up to 32) runs a separate machine with its own files in the IndexedDB store zenfs-NAME, with its own lock, so it runs beside the default machine in another tab. No parameter, or ?machine=root, is the default machine (the store zenfs, as ever). The few localStorage keys that describe a store (what was installed into it, first boot) are kept per machine, and format wipes only the machine it runs on. The "another tab" notice offers to open a new machine. Machines cannot see each other's files; mount or attach over --listen is how they would share.
Supported Filesystem Types
- memory: In-memory filesystem (temporary, lost on page reload)
- indexeddb: IndexedDB-backed persistent filesystem
- webstorage: WebStorage-backed filesystem (localStorage or sessionStorage)
- webaccess: File System Access API filesystem (requires user interaction)
- singlebuffer: Filesystem backed by a single buffer
- fetch: Remote filesystem via HTTP fetch
- xml: DOM XML filesystem (WIP)
- zip: Read-only filesystem from a zip archive (file or URL)
- iso: Read-only filesystem from an ISO image (file or URL)
- tar: Read-only filesystem from a tar archive, gzipped or not (file or URL)
With a source and no -t, an image's type is found from its first bytes (or a URL's name), so mount -o loop disk.iso /mnt/iso works as on Linux.
- dropbox: Dropbox filesystem (module
cloud) - googledrive: Google Drive filesystem (module
cloud)
Basic Usage
# Mount a memory filesystem
mount -t memory /mnt/tmp
# Mount an IndexedDB store
mount -t indexeddb mydb /mnt/db
# Mount WebStorage (localStorage by default)
mount -t webstorage /mnt/storage
# Mount WebStorage using sessionStorage
mount -t webstorage /mnt/storage -o storage=sessionStorage
# Mount a zip archive
mount -t zip /tmp/archive.zip /mnt/zip
# Mount from a remote URL
mount -t zip https://example.com/archive.zip /mnt/zip
# Mount an image, its type found from its contents
mount -o loop /tmp/site.tar.gz /mnt/site
# Mount a fetch filesystem (see utils/fetch-fs-server.js)
mount -t fetch index.json /mnt/api -o baseUrl=http://localhost:30808
# List all mounted filesystems
mount -l
# Unmount a filesystem
umount /mnt/tmp
/etc/fstab
The kernel automatically processes /etc/fstab during boot to mount filesystems. The fstab format is space or tab-separated:
source target type [options]
Format:
source: Device/URL/database name (usenonefor filesystems that don't require a source)target: Mount point (absolute path)type: Filesystem typeoptions: Optional comma-separated key=value pairs
Example /etc/fstab:
# ecmaOS fstab - Filesystem mount table
# Format: source target type [options]
# Memory filesystem for temporary data
none /mnt/tmp memory
# IndexedDB filesystem for persistent storage
mydb /mnt/db indexeddb
# WebStorage filesystem using localStorage
none /mnt/storage webstorage storage=localStorage
# Fetch filesystem from a remote API
index.json /mnt/api fetch baseUrl=http://localhost:30808
Generators
- Generators are used to scaffold new apps, devices, modules, etc.
- They are located in the
turbo/generatorsdirectory of the repository - They are used by the
turbo gencommand, e.g.turbo gen app,turbo gen device,turbo gen module, etc.
Internationalization
- Built-in translations are in the /core/kernel/locales directory and compiled into the kernel at build time
- Translations can be defined and loaded from the filesystem at runtime
- Override or add translations in
/usr/share/locales/{lang}/{namespace}.json- e.g.
/usr/share/locales/en/kernel.json
- e.g.
- System locale can be set from the
/etc/default/localefile - User locale can be set from the
LANGenvironment variable kernel.i18n.tis the primary translation function for the kernelkernel.i18n.nsprovides access to translation functions for specific namespaces- e.g.
kernel.i18n.ns.common('Hello')
- e.g.
Kernel
- The kernel ties together the various components of the system into a cohesive whole
- Authentication (Passwords, Passkeys, Credentials)
- Components (Web Components/Custom Elements)
- Coreutils (Built-in commands)
- Devices (Web Hardware APIs)
- DOM (DOM Utilities and Interfaces)
- Events (CustomEvents)
- Filesystem (ZenFS)
- Internationalization (i18next)
- Interval Manager (setInterval and cron scheduling)
- Log Manager (tslog)
- Memory Manager (Abstractions)
- Execution (worker-hosted
execveprocesses via@zenfs/linux, real pids/signals/exit codes - see Execution Model) - Protocol Handlers (web+ecmaos://...)
- Service Worker Manager
- Shell
- Sockets (loopback POSIX sockets,
AF_UNIX/AF_INET; see Sockets) - Storage (IndexedDB, localStorage, sessionStorage, etc.)
- Telemetry (OpenTelemetry)
- Terminal (xterm.js)
- User Manager
- WASM Loader (WALI and Emscripten programs as processes via
/bin/wali; WASI Preview 1 mostly complete; WASI Preview 2 (0.2) components as processes too) - Web Workers
- Window server (state) with a WinBox renderer
Node
- Runs the same kernel in a Node process, with the terminal on stdin and stdout and the machine kept in a SQLite file
ecmaos --listenlets other ecmaOS machines log in with a key and get a shell;connectis the client- Logins are over
@ecmaos/peer; see the package READMEs andSECURITY.mdfor what is and is not protected
Modules
- Refer to the full list of official modules on npm
- See the MODULES.md file for a list of community modules; submit a PR to add your module!
- A module is one file,
NAME.ko.mjs, that starts with a comment block ofkey=valuelines (name,version,license,kernel_api,depends,parm) and exportsinit(ctx)and an optionalexit() insmod [-f] FILE [name=value ...]loads it,rmmod [-f] NAMEunloads it,lsmod(or/proc/modules) lists the loaded ones andmodinfo FILE|NAMEshows what a module says about itself without running it (NAME may be a loaded module, or one installed in/lib/modulesby name or alias);insmodandrmmodneed root- A loaded module is in
/proc/modulesand/sys/module/NAME(withparameters/); it taints the kernel (Oout-of-tree,Eunsigned,Fforced), which/proc/sys/kernel/taintedshows, and writing 1 to/proc/sys/kernel/modules_disabledstops loading and unloading until reboot - A module reaches the kernel through
ctxonly:ctx.param,ctx.log,ctx.exportandctx.import(symbols listed in/proc/kallsyms, a user holds its provider), andctx.onExitfor whatrmmodmust undo; the types are the interface - A JS module runs in the kernel and is not confined: load only what you trust
depmodreads everyNAME.ko.mjsunder/lib/modules/RELEASE(uname -r) and writesmodules.depandmodules.alias;modprobe [-nvr] NAMEloads a module, or analiasof one, with what it depends on, andmodprobe -runloads it and what it needed that nothing else holds; the file name must be the module name/etc/modprobe.d/*.conftakesoptions NAME name=value,alias PATTERN NAME,blacklist NAME(stops loading by alias only),softdep NAME pre: A post: B, andinstall NAME COMMANDandremove NAME COMMAND(modprobe --ignore-installskips them);/etc/modules-load.d/*.conflists one module a line to load at boot, and a failure is logged and does not stop the boot- A module can add files, all removed when it unloads and each in a directory of the kernel's, never over a name that exists (
EEXIST):ctx.proc(path, {show, store?})makes/proc/PATH;ctx.sys(path, {attr: {show, store?}})makes/sys/kernel/PATH;ctx.debugfs.file(path, {read, write})andctx.debugfs.value(path, 'u32', ref)(alsou8 u16 u64 x8 x16 x32 x64 bool str) make files in/sys/kernel/debug/NAME(root only);ctx.configfs.subsystem({name, attributes, make})makes/sys/kernel/config/NAME, wheremkdircallsmakeandrmdirdrops the item;ctx.command(name, source)writes the program/usr/bin/NAME, which never replaces a command already on the PATH - A
storethat throws is logged (as a warning from the module) and the write still succeeds, because procfs, sysfs and debugfs fail every later close of a file whose write threw; a module that wants a write refused ignores it - A module can change what the kernel does:
ctx.filesystem({name, backend, source?, config?})adds a type tomount -tand/proc/filesystems(backendis a ZenFSBackend, taken fromctx.import('zenfs.core'); the module cannot unload while one is mounted);ctx.binfmt({name, matches, interpreter})teachesexecvea program format, tried after the#!and WebAssembly formats and before JavaScript;ctx.syscall(name, handler)adds a syscall a program makes withecmaosSyscalls.custom;ctx.syscallPolicy(fn)can refuse any syscall withEPERM(it can only deny, and one that throws is logged and ignored). Each is undone when the module unloads, and a name that exists fails withEEXIST request_module:mount -t TYPEwith a type nobody has loads the module with the aliasfs-TYPE, and running a file the kernel cannot run loads the one with the aliasbinfmt-EXTENSION;modprobedoes it as root,modprobe.dblacklist and options apply, and nothing is asked for oncemodules_disabledis 1- A module can also be a WebAssembly component,
NAME.ko.wasm, of the world incore/kernel/wit/ecmaos-module.wit: it exportslifecycle(init,exit) andhooks, and importskernel(log,proc,sys,debugfs-file,syscall,syscall-policy,binfmt, which do what the context's methods do and call back intohooksto read, write and answer; parameters arrive as the argument ofinit, and an import never returns text, only an error number, because a guest cannot safely free memory a WASI 0.3 host gives it). It is sandboxed by its imports: the WASI interfaces a toolchain adds get a clock, random bytes and a place to write log lines (stdout and stderr becomedmesglines), and the filesystem, the network and HTTP are refused, so a wasm module can do only what its world lets it.modinfoprintskind: wasm. The file is the component plus a custom sectionecmaos-modulewith the modinfo (thekey=valuelines of a JS module's header), made bynode core/kernel/scripts/wasm-module.mjs pack COMPONENT.wasm INFO.json OUT.ko.wasm(orbuild SOURCE.js ..., which componentizes a JavaScript module with jco; seecore/kernel/examples/wasm-hello);sign-modulesigns it by appending a last sectionecmaos-module-signature, andinsmod,modinfo,depmodandmodprobetake it like a JS module - A WebAssembly module can be written for WASI 0.2 or 0.3 (the kernel tells by the interfaces the component imports). A 0.2 component answers every hook at once. A 0.3 component's exports are all asynchronous under jco, and the kernel's
/proc,/sysand debugfs reads, the syscall policy and the program-format check must answer at once, so a 0.3 module's files are served from the last text its hook returned (filled onceinitis done, refreshed after each read, so a read can be one behind) and a 0.3 module cannot add a syscall policy or a program format (syscall-policyandbinfmtreturn 38, ENOSYS, and log why). Its syscalls,initandexitare asynchronous without trouble.examples/wasm-hello-rustis a Rust module for 0.3 (node core/kernel/scripts/build-wasm-rust.mjs core/kernel/examples/wasm-hello-rust OUT.ko.wasm; it needsrustup toolchain install nightly-2026-10-25 --profile minimal -t wasm32-wasip3, whichrust-toolchain.tomlthere selects for that directory only, andwasm-toolsfromECMAOS_WASM_TOOLSor the PATH); it is 70 KB where the JavaScript example is 12 MB - A WebAssembly module of the world
filesystem-modulealso exportsfilesystem(mount,stat,readdir,read,write,create,unlink,rmdir,rename,link,get-attributes,set-attributes,touch, on paths from the root of the mount; a failure is an error number;statsays how many names a file has, and a hard link is a second path to one file) and callskernel.filesystem(name, source)ininitto add a type tomount -tand/proc/filesystems. The kernel runs it as a ZenFSAsyncfilesystem: the calls that cannot wait are answered from a copy of the tree in memory and every change is passed on to the module, so the module's calls may be asynchronous (a WASI 0.3 component's all are). The kernel numbers the inodes, since a module has none to give, and the module cannot unload while it is mounted.mount -o lazykeeps no copy at all: nothing is read at mount and every call goes to the module, for a tree too big to hold in memory, but the calls that cannot wait (statSyncand the like) then fail withENOTSUP.core/kernel/examples/wasm-ramfs-rustis a Rust filesystem,mount -t wasmram /mnt/x, a tree kept in the module's memory (106 KB) - The
zip,tarandisotypes (modulearchives) and thedropboxandgoogledrivetypes (modulecloud) are not in the boot bundle:mount -tfetches the module from the site's catalog (/modules/index.json;modulesin the kernel options orECMAOS_MODULESchanges it,falseornoneturns it off) the first time it is asked for, keeps it in/lib/modules/RELEASE/kernel/, and loads it.modules.builtinlists the types the kernel has without a module (modprobehas nothing to load for those).pnpm --filter @ecmaos/kernel buildbuilds them (scripts/build-modules.mjs; the sources arecore/kernel/modules/NAME/), taking ZenFS and its helpers from the kernel (ctx.import('lib:@zenfs/core')) and bundling the rest - To sign the in-tree modules, run
node core/kernel/scripts/module-key.mjs DIRonce (it writesecmaos.key, which stays private, andecmaos.pub), build withECMAOS_MODULE_KEY=DIR/ecmaos.keyso each module gets a signature, and put the base64 line ofecmaos.pubincore/kernel/src/tree/lib/module-release-key.json(or setECMAOS_MODULE_PUBKEYfor one build): boot writes it to/etc/modules-keys/ecmaos.pub, so those modules load with only theOtaint. The key comes from the kernel's own build, never from the catalog - Signing:
sign-module --genkey NAMEmakesNAME.keyandNAME.pub,sign-module -k NAME.key FILEappends an Ed25519 signature to the module, and a key copied to/etc/modules-keysis trusted; a module signed by a trusted key does not taintE, a signature that does not match is refused, and writing 1 to/proc/sys/kernel/module_sig_enforcerefuses every module that is not signed by a trusted key until reboot kernel_apiis a semver range of the module API (1.0.0); a module that asks for another version fails withENOEXEC, andinsmod -floads it anyway- A package ships a module by listing it in its
package.json,"ecmaos": { "modules": ["dist/NAME.ko.mjs"] }(.ko.mjsor.ko.wasmfiles inside the package):installcopies each into/lib/modules/RELEASE/and runsdepmod, somodprobe NAMEfinds it, anduninstalltakes them away again (root only, likeinsmod).turbo gen moduleasks whether the module is TypeScript (build.mjsbundlessrc/index.tswith esbuild intodist/NAME.ko.mjsunder the modinfo header made frommodule.json, andpnpm testloads it) or Rust (a WASI 0.3 component built byscripts/build-wasm-rust.mjs);modules/boilerplateis the TypeScript one; both builds sign the module whenECMAOS_MODULE_KEYnames a private key file (node core/kernel/scripts/module-key.mjs DIRmakes one;ECMAOS_MODULE_SIGNERnames the signer), and unsigned they load with theEtaint
Packages
- Packages are NPM packages that are installed into the ecmaOS environment
- They can be installed from the terminal using the
installcommand, e.g.# install @ecmaos-apps/ai - Client-side packages should work well
- Packages run on
/bin/node's loader, which resolves modules as Node does (see above); Node's own modules are emulated, not all of them completely - NPM version specifiers are supported, e.g.:
# install jquery@3.7.1# install jquery@^3.7.1# install jquery@latest
- JSR may be used with the NPM compatibility layer:
# install @jsr/defaude__hello-jsr --registry https://npm.jsr.io
Screensavers
- Current options:
blank,matrix,toasters - Screensavers are built into the kernel
- You can start the screensaver with the
screensavercommand - You can set the default screensaver with the
screensaver --set <name>command - The screensaver timeout can be set with a
screensaver-timeoutlocalStoragekey with the value in milliseconds (default: 60000)
Shell
- The shell manages the environment, filesystem context, execution, and terminal interface
- System-wide terminal configuration is stored in
/etc/terminal.toml - User-specific terminal configuration is stored in
~/.config/terminal.toml - Startup files are run at login, in order:
/etc/profile,/etc/profile.d/*.sh, the first of~/.bash_profile,~/.ecmash_profileor~/.profile,/etc/ecmashrc,~/.bashrc,~/.ecmashrc
Sockets
- A real
socket()/bind()/listen()/connect()/accept()POSIX socket implementation runs natively in the worker (AF_UNIX, and loopbackAF_INETandAF_INET6between programs on the machine). Aconnect()to any other IPv4 or IPv6 address goes through the gateway ifgateway uphas made one (see Network gateway) and fails with-ENETUNREACHotherwise. - For an actual external connection, use
nc(which speaks WebSocket under the hood) or thesocketscommand/kernel.socketsmanager, both of which create realWebSocket/WebTransportconnections on the main thread and bridge them to a worker-hosted process's stdio. - See Known gaps for what this does and doesn't cover, and
man socketsfor the full address-family breakdown once installed.
Network gateway
/core/kernel/src/tree/lib/remote-gateway.ts, /core/node/src/gateway.ts
- A browser tab cannot open a TCP socket, so the machine borrows one:
gateway up root@host:30022(root only) logs in to an ecmaOS machine started withecmaos --listen --gatewayand keeps the link. From then on a program'sconnect()to an IPv4 or IPv6 address that is not this machine (a WASM program'ssocket()/connect(), for one) is a flow through that machine, which makes the real connection; the program reads, writes, polls and closes an ordinary socket. - Without a gateway, a program that tries to reach another machine is refused (
ENETUNREACH, "Network is unreachable"). If it then fails, the terminal it runs on adds a line naminggateway up USER@HOST(root only), once per program, so a firstsshdoes not end in a bare error. A program that carries on and succeeds is told nothing - The host decides what is reachable: its own network, private ranges and metadata addresses are refused unless a rule names them, and every flow is logged there. A refusal reaches the program as
EACCES, a dead destination asECONNREFUSED/EHOSTUNREACH/ETIMEDOUT, and no gateway asENETUNREACH.gateway downcloses the link;gatewayshows it.nc -gis the one-command form. Seeman gateway. - Names:
getaddrinfo()/gethostbyname()in a WASM program read/etc/hosts(shipped withlocalhost), then ask the gateway, which resolves with its own resolver and does not hand out addresses it would not connect to. With no gateway a name that is not in/etc/hostsfails withEAI_AGAIN. A program built on musl (python3, perl) does its own lookups against/etc/resolv.conf, which names 127.0.0.1: the kernel answers A and AAAA queries sent to loopback port 53 the same way (dns-stub.ts), unless a program has bound that port itself. - UDP: a program's
SOCK_DGRAMsocket gets a flow to one peer (connect()or the firstsendto()), one datagram per message with boundaries kept; it is not flow controlled, so datagrams are dropped when the link falls behind. - Inbound:
gateway expose 3000 8080(root) asks the gateway's host to open port 8080 and forward each connection to port 3000 on this machine, where a program listens on loopback (an ordinarybind()/listen()/accept(); the program is unchanged). The host opens nothing unless its operator named ports (--gateway-listen), binds to its own loopback unless told otherwise, and logs each connection. The host's--gateway-listen-allowlimits which clients may connect, andaccept()/recvfrom()report the real client address.gateway expose -u 5300 5353does the same for UDP: datagrams to the host's port reach a program thatbind()ed 5300, naming each sender, andsendto()answers any of them from the one socket.gateway unexpose 8080stops it;gatewaylists what is exposed. A connection with nothing listening on the port is dropped. - IPv6:
AF_INET6sockets work as on a dual-stack Linux machine.sockaddr_in6is read and written everywhere (bind,connect,accept,getsockname,getpeername,sendto,recvfrom,sendmsg,recvmsg),getaddrinfo()returns AAAA answers (IPv4 first when no family is asked for) andgetnameinfo()answers from/etc/hosts. An IPv6 socket bound to::also takes IPv4 clients, shown as::ffff:a.b.c.d, unlessIPV6_V6ONLYis set;::1and::are this machine, and an IPv4 port and an IPv6-only port with the same number do not collide. Beyond the machine an IPv6 address is a flow through the gateway like any other,gateway exposecan open an IPv6 address on the host (--gateway-listen-address ::1), and a client's real IPv6 address reachesaccept()/recvfrom(). The loopback model is shared: a UDP port is one name for both families. - Ancillary data: on a local
AF_UNIXconnection (bind/listen/connect/accept; emscripten's libc has nosocketpair)sendmsg/recvmsgpass descriptors withSCM_RIGHTS: files, pipes, ttys and connected sockets, between two programs or within one. A descriptor stays open while it is in flight even if the sender closes it, arrives in the receiver's table at its lowest free number, and travels with the first byte of the message it was sent with: a read never runs across such a message, an ordinaryread()past it drops the descriptor, and a control buffer too small givesMSG_CTRUNC.SO_PEERCREDgives the other program's pid, uid and gid, andSO_PASSCREDhas them arrive with each message asSCM_CREDENTIALS. Other kinds (IP_PKTINFOand the rest) are ignored on send and absent on receive, and rights on any other kind of socket fail withEINVAL. Descriptors pass between an Emscripten program and a WALI one as between two of a kind: the kernel hands them across (a WALI Wayland client and the compositor share keymaps andwl_shmpools that way); an Emscripten program's socket sent to a WALI one is refused withEINVAL.
SWAPI
- The SWAPI is an API server running completely inside a service worker using Hono
- It allows for various operations including the
fsroute to fetch files via URL - e.g.,
# fetch /swapi/fs/home/user/hello.txt - e.g.,
# fetch /swapi/fake/person/fullName
Telemetry
- OpenTelemetry is used for collecting and analyzing telemetry data from the kernel and applications
- It is only active if the ECMAOS_OPENTELEMETRY_ENDPOINT environment variable is set when building the kernel
- There is a simple test server included in the
utils/opentelemetrydirectory that can be used to test the telemetry system:python3 utils/opentelemetry/otlp-server.py
Updates
- Every build writes a
version.json({ "version", "build" }) beside the site, wherebuildis the commit it was made from (ECMAOS_BUILD_IDsets it) and changes on every deploy, not only on a release - A page that is open fetches it 30 seconds after boot and every 30 minutes, never from a cache, and says once per build, in a toast, that an update is there. It does not reload by itself: a reload stops the programs that are running, and keeps the files
- Only a production build in a browser does this; the
updateskernel option names another address, orfalsefor none. A host that has noversion.jsonis left alone: a missing file, a page that is not JSON and a network error all mean "no update"
Utils
- Utilities and configuration used during development
Important Files and Directories
/bin/: Built-in commands/sbin/init: pid 1, the first process; it runs/etc/inittab/sbin/getty: the login prompt on one terminal, run by init for each of the eight (it asks for the user name and runs/bin/login, which asks for the password and runs the shell)/boot/init: A script that runs on boot, as asysinitentry of/etc/inittab/etc/inittab: What init runs and keeps running (BusyBox format; seeman @ecmaos/coreutils/inittab)/dev/: All devices are here/etc/crontab: System-wide crontab file (loaded on boot)/etc/packages: A list of installed packages to load on boot/etc/terminal.toml: System-wide terminal configuration/etc/profile,/etc/profile.d/*.sh,/etc/ecmashrc: System-wide shell startup files/home/: Contains user home directories~/.config/crontab: User-specific crontab file (loaded on login)~/.profile,~/.bash_profile,~/.ecmash_profile,~/.bashrc,~/.ecmashrc: User-specific shell startup files~/.config/terminal.toml: User-specific terminal configuration/proc/: Contains various dynamic system information/root/: The home directory for the root user/usr/bin/: Executable packages get linked here/usr/lib/: All installed packages are here/usr/share/licenses/: License texts, and the source offer for each copyleft program/var/log/kernel.log: The kernel log
Command Examples
ai "Despite all my rage" # use `env OPENAI_API_KEY=`
cat /var/log/kernel.lo
cd /tmp
echo "Hello, world!" > hello.txt
chmod 700 hello.txt
chown user hello.txt
clear
cp /tmp/hello.txt /tmp/hi.txt
cron add "* * * * *" "echo hello" # add a cron job
cron reload # reload crontabs from files
cron list # list all cron jobs
download hello.txt
edit hello.txt
env hello=world ; env
fetch https://ipecho.net/plain > /tmp/myip.txt
fetch -o /tmp/initfs.tar.gz /initfs.tar.gz
fetch /initfs.tar.gz | head | xxd
fetch /xkcd-os.sixel # xterm.js includes sixel support
fetch /swapi/fs/home/user/hello.txt # fetch a file from the filesystem via SWAPI
fetch /swapi/fake/person/fullName # fetch a random person from the SWAPI
install jquery
install @ecmaos-apps/boilerplate
ls /dev
mkdir /tmp/zip ; cd /tmp/zip
upload
mount -t zip myuploaded.zip /mnt/zip
cd .. ; pwd
unzip zip/myuploaded.zip
mv zip/myuploaded.zip /tmp/backup.zip
passwd old new
play /root/test.mp3
ps
rm /tmp/backup.zip
screensaver
snake
stat /tmp/hello.txt
touch /tmp/test.bin
umount /mnt/zip
user add user
su user
sudo cat /etc/shadow
video /root/video.mp4
zip /root/tmp.zip /tmp
Device Examples
/dev/audio test
/dev/battery status
/dev/bluetooth scan
/dev/bluetooth list
cat /dev/ble0
echo hello > /dev/ble0
cat /dev/battery | xxd
cat /dev/geo
cat /dev/sensor-accelerometer
cat song.mp3 > /dev/audio
cat /dev/usb0
/dev/gamepad list
/dev/geo position
/dev/gpu test
/dev/hid list
/dev/midi list
/dev/presentation start https://wikipedia.org
/dev/sensors list
/dev/serialctl devices
/dev/usb list
/dev/webgpu test
echo "Goodbye" > /dev/null
echo "This will error" > /dev/full
head -c 32 /dev/random > /tmp/random.txt
head -c 32 /dev/zero > /dev/null
Bluetooth LE devices are byte streams once paired: /dev/bluetooth scan pairs one (this needs a click, as the browser requires), and after a reload each paired device is /dev/ble0, /dev/ble1 and so on. Reading a node returns what the device sends and writing sends bytes to it. Which GATT service and characteristics carry the stream comes from /etc/bluetooth.toml; without it the Nordic UART service is used, which most serial-over-BLE modules speak. The same file can set a different service for one device, by name or id:
chunk = 20
[device."HM-10"]
service = "ffe0"
notify = "ffe1"
write = "ffe1"
/dev/bluetooth also has connect, disconnect, services, characteristics, read, write and notify for working with any characteristic directly. A paired device keeps its /dev/ble<N> number when others are forgotten (see below).
Other devices that have a live source are nodes too, and a node's session is opened when a program opens it and closed with the last descriptor, so nothing runs while nobody reads:
/dev/batteryand/dev/geogive one reading and then the end of the file, socatreturns.batteryis 18 bytes (level 0 to 100, charging 0 or 1, then seconds to full and to empty as little-endian float64, Infinity when unknown);geois one JSON line with latitude, longitude, accuracy and the rest, and waits for a fix./dev/sensor-<kind>(accelerometer,gyroscope,magnetometer,linear,gravity,orientation,light) exists for each Generic Sensor class the browser has, and streams a JSON line per reading until the reader goes away. The permission has to be granted first; a refusal reads asEACCES./dev/rtc0(and/dev/rtc) is the real-time clock, which is the browser's:RTC_RD_TIMEgives the time in UTC,RTC_UIE_ONmakes a read wait for each new second, andhwclockreads it. It cannot be set./dev/hwrnggives random bytes from the browser's generator, as many as are asked for. Both are root's alone, as on Linux./dev/audioplays what is written to it: write a whole audio file (up to 64 MiB, any format the browser decodes) and it is decoded and played when the file is closed./dev/dsptakes raw signed 16-bit mono samples (16000 Hz) to the speakers,/dev/dsp1the same as interleaved stereo at 48000 Hz (what SDL programs play to), and/dev/dspingives the microphone in the same format./dev/usb0,/dev/usb1are the USB devices you have granted (/dev/usb request), as byte streams: reads return what the device's IN endpoint sends and writes go to its OUT endpoint. By default the first bulk or interrupt endpoints of the interface are used;/etc/usb.tomlchanges that, for every device or for one byvendor:productid or product name:
interface = 0
[device."2341:0043"]
in = 1
out = 2
/dev/hidraw<N>and/dev/midi<N>are the HID devices and MIDI ports the browser has already allowed; the gamepads are under/dev/input(see Input, above)./dev/ttyACM<N>,/dev/ttyUSB<N>and/dev/rfcomm<N>are the serial ports: a board that speaks CDC ACM (an Arduino, a Raspberry Pi Pico, an ESP32 with native USB), one behind a USB-serial chip (FTDI, CP210x, CH340, PL2303) and a Bluetooth serial port, named as Linux names them. Each is a terminal, with the line discipline and ac_cflagthat sets the port's speed, character size, parity, stop bits and flow control (stty -F /dev/ttyACM0 115200 raw,microcom -s 115200 /dev/ttyACM0). A port gets its node when it is granted (serial request) or plugged in, with the lowest free number as on Linux, and loses it when it is unplugged; a program that still has it open reads the end of the file./dev/serial/by-id/usb-<vendor>_<product>-if00is a name that stays with the device.
Each driver with several nodes also has a control node (/dev/usb, /dev/serialctl, /dev/hid and so on) that is always there, even where the browser lacks the API, so its command can be run. The number in a usb<N>, ble<N> or hidraw<N> name stays with its device: each is remembered by what identifies it (ids and serial number, or the Bluetooth device id) in /var/lib/ecmaos/<driver>-minors.json. Forgetting a device leaves a gap and the others keep their names; a new device gets a number that was never used. Devices that look the same (no serial number) are told apart by the order the browser lists them in. MIDI ports are numbered by position. /dev/serial is not the control node: as on Linux it is a directory, holding the by-id names of the USB serial ports.
Code Execution Example
echo "window.alert('Hello, world!')" > /root/hello.js
load /root/hello.js
Scripting
#!/bin/sh
echo "Hello, world!"
install jquery
Startup
/sbin/initis pid 1. It reads/etc/inittab, runs/boot/initand any othersysinitandwaitentries, then starts theonceandrespawnones (crondand onegettyper terminal arerespawnentries). It restarts what dies, reaps every child and orphan, and takes the system down in order onreboot,haltorpoweroff/etc/crontabis loaded on boot and contains system-wide scheduled tasks~/.config/crontabis loaded on user login and contains user-specific scheduled tasks/etc/packagesis a list of already installed packages to load on boot; one per line
Backup and restore
The machine is stored in the browser, and clearing the site data destroys it, so keep a copy.
backupsaves/root,/home,/etcand/usr/local(or the paths you give it) as a gzipped tar, with owners and modes, and the browser downloads it.backup -o FILEwritesFILEand stops, which is how to keep a large one on a mounted disk; without-othe archive is made in/tmp, which is in memory- The archive holds the password hashes of
/etc/shadow, so keep it private.backup --no-shadowleaves them out, and a machine restored from that has no passwords restore FILElists what an archive holds, andrestore --yes FILEunpacks it over the machine (-C DIRunpacks underDIRinstead). Bring an archive in withupload /tmp, which opens the browser's file picker. Files not in the archive are left alone- Programs installed for the whole system under
/usrare not in the archive;installfetches them again. The archive is a plain tar, sotar -tzfshows what is in it and nothing about it needs ecmaOS to read
Rescue boot
When a machine will not start properly (a bad line in /etc/profile or ~/.ecmashrc, a broken /etc/inittab, a forgotten root password), open the site with ?rescue (for example https://ecmaos.sh/?rescue, and &machine=NAME for another machine) instead of clearing the site data, which destroys the machine.
- It boots to a root shell with no login and no password, so anyone who can open the page in this browser profile can do it; the data was already theirs, since it is stored in their browser
- No
/etc/inittabentry runs (nogetty, nocrond, no/boot/init), none of the startup files are read, and nothing is installed or asked about - The filesystem is mounted as it is, so
passwd, an editor,tarandmountwork on it as usual. If/etc/passwdis damaged it still gives uid 0 - Reload the page without
?rescueto boot normally. In Node, pass therescueoption to the kernel - It does not help with a failure earlier in boot, such as the filesystem not mounting
App Development
The apps directory in the repository contains examples. An app is for something that needs a window or the page's DOM; a command-line tool should be a plain program instead (a Node script with a #!/usr/bin/env node line, or a WebAssembly build), which gets real file descriptors, a real terminal and process.* like any other program.
@ecmaos-apps/code: a Monaco code editor, with adisplayentry; the reference for a windowed app@ecmaos-apps/webamp: Webamp, a frameless windowed app with only adisplayentry: it always runs sandboxed@ecmaos-apps/desktop: thestartxdesktop, which useskernel.windowsheavily
Your package's bin file has a main (or unnamed default) function export, and its first line is #!/bin/app (turbo gen app makes one). The kernel runs it as a process of /bin/app (pid, signals, exit code) with main on the main thread. params, of type ProcessEntryParams from @ecmaos/types, has the live kernel, shell, terminal and instance, args, command, cwd, uid/gid/pid, and document is there to use. The return value (a number) becomes the exit code, and instance.keepAlive() and instance.exit(code) keep the process alive after main returns and end it later.
What an app is trusted with. params.shell is the shell of the user who started the app, so what it reads and runs through the shell is checked against that user. params.kernel is not: it is the kernel, and its filesystem, user database and windows act with the kernel's authority (core/kernel/tests/tree/app-privilege.test.ts pins this down: that reach is the privilege, which is why /bin/app only runs a root-owned file no one else can write). Treat installing an app as giving it root's reach, and prefer params.shell for anything done on the user's behalf.
Apps on a host with no page. The Node host (ecmaos) and a ?screen= page have no kernel page for main to run in, so an app runs in a sandboxed frame in its window instead, with no access to the kernel, only to the AppSdk (core/types/sdk.ts) that it is passed. Such an app exports display(sdk); an app with only main(params) fails to start there. The SDK has fs (read, write, append, mkdir, readdir, stat, access, unlink, rename, all as the user who started the app), args, cwd, env, pid/uid/gid, window.setTitle/close/setDirty, toast, log, exit and onDispose. code exports both main and display; webamp exports only display, so it runs in the sandbox on every host.
Shebangs. A shebang is a real one: a path that names what runs the file (#!/bin/sh, #!/usr/bin/env node, #!/bin/app). The #!ecmaos: header that 0.x used (bin:app, bin:program, bin:script, bin:command) is gone: a file that still starts with one exits 126 and says it is from 0.x. A program needs no header (a plain Node file, or WebAssembly); a script that should run in the built-in shell needs none either, and /boot/init is #!/bin/sh, run by init like any other script.
Who may be an app. An app is sandboxed unless its package asks otherwise: its display(sdk) runs in a frame with no authority of its own, and everything it does goes through the sdk as the user who started it. A package can describe its window in its package.json, under ecmaos.app (title, width, height, frameless). "privileged": true runs main(params) on the main thread with the live kernel, and /bin/app honours it only for a file root owns that no one else can write, in a package whose package.json is the same (the check is made on the main thread, where a program that asks for a window itself cannot skip it). A sandboxed app has no network: its frame carries a Content-Security-Policy that blocks every outbound request. A package can name the origins it needs under ecmaos.app.permissions.network (["https://api.example.com", "https://*.cdn.example.com"]), and that is honoured only when root owns the package.json, like privileged. The site is cross-origin isolated, so a listed origin has to answer a page that is not its own (CORS headers, or Cross-Origin-Resource-Policy: cross-origin); a server that does not is blocked by the browser, listed or not. A package that root installs is root's, so an app a person wrote in their own directory is always sandboxed, whatever it asks for.
App/Kernel Interface Example
See the docs for more information
A windowed app, which runs on the main thread:
#!/bin/app
export default async function main(params: ProcessEntryParams) {
const { args, kernel, shell, terminal } = params
kernel.log.info('Hello, world!')
kernel.log.debug(args)
terminal.writeln('Hello, world!')
// as the user who started the app; kernel.filesystem.fs would act with the kernel's authority
await shell.context.fs.promises.writeFile('/tmp/hello.txt', 'Hello, world!')
const win = kernel.windows.create({ title: 'Example', width: 800, height: 600 })
const container = document.createElement('div')
container.innerHTML = '<h1>Hello, world!</h1>'
win.mount(container)
}
The same app for a host with no page, which reaches the machine only through the SDK:
import type { AppSdk } from '@ecmaos/types'
export const display = async (sdk: AppSdk) => {
await sdk.fs.writeFile('/tmp/hello.txt', 'Hello, world!')
document.body.innerHTML = '<h1>Hello, world!</h1>'
await sdk.window.setTitle('Example')
sdk.onDispose(() => sdk.log('closed'))
}
Known gaps
- The root filesystem lives in memory. The IndexedDB root is loaded whole at boot and each file is one record, so every file costs its size in RAM (measured: about 1:1, up to 2 GB in a 32 GB desktop Chrome, a 1 GB store booting in 4.9 s), and changing a file rewrites all of it (a 1-byte edit of a 400 MB file stalls the page for about 1.7 s; for a record of 256 KiB or more the write to IndexedDB is put off for 100 ms and merged, so a program appending in small pieces writes the file once per window instead of once per piece, with the in-memory copy always current and
reboot,haltand a takeover flushing first). Very large files will exhaust a tab, a phone sooner, so a file past a limit is refused withEFBIG(default 512 MiB on a device reporting 8 GB or more, 256, 128 or 64 MiB below that) and a warning is logged when the total held crosses twice that; setlimits: { maxFileBytes, warnResidentBytes }in the kernel options (falseturns one off)./tmp,/mediaand/mntare in memory by design and not limited.dfshows what every mount holds in memory and the limits./etc/quota(alice 100M) gives users a storage quota on the root, enforced asEDQUOTon a write or truncate that would go over it; seeman quota.
ecmaOS 1.0.0 runs its execution model on real execve processes, but a number of things are deliberately not done, either because the browser can't support them or because they're scoped past this release:
- No copy-on-write
fork(). A worker has no cheap way to clone memory the way a real OS does, sofork()is emulated: a program built with Asyncify (CPython, Perl, GNU screen, bash, tmux, dropbear) unwinds its stack and is resumed in the child, which costs a copy of its memory. Every other program has nofork()and starts children withposix_spawn(execve). - The site always boots on IndexedDB. The root is whatever the kernel's
filesystem.mounts['/']option names (the Node host passes anode:sqlitestore, a guest session a memory one), but the site has no setting for it, and the one-tab lock and the?machine=stores only apply to the default IndexedDB root. socket()reaches the network only through a gateway.AF_UNIXand loopbackAF_INET/AF_INET6sockets work natively in the worker. Browsers expose no raw TCP/UDP, so aconnect()to another IPv4 or IPv6 address needsgateway up(a link to an ecmaOS machine started with--listen --gateway, which does the connecting and decides what is reachable); without one it fails withENETUNREACH. Names resolve through/etc/hostsand then the gateway, and UDP works withsendto/recvfrom/sendmsg/recvmsg: a socket that is not connected talks to any number of peers (it takes a port on first send), aconnect()ed one keeps to its peer;AF_INET6works the same way, dual-stack as on Linux. A program listening on loopback can be reached from outside only throughgateway expose, if the gateway's operator opened ports for it.ncandsockets_connectstill reach WebSocket/WebTransport servers directly. See Sockets.- WASI Preview 2 is 0.2 only, and a component's exit status is success or failure. A component is transpiled by the kernel with jco (too large to bundle into the worker) and run as a worker process under
/bin/walion its own host for thewasi:*0.2 interfaces (core/kernel/src/bin/wasip2.mjsandwasip2-sockets.mjs): it has a pid, is killable and preemptible, and gets the working directory and preopens (/,.and each top-level directory, as Preview 1 does), the shell's pipes and redirections or the tty on stdio, a clock, random bytes, TCP and UDP sockets and name lookup (loopback and a local listener directly, anything else through the gateway whengateway upmade one). WASI 0.2'sexitonly says success or failure, so a nonzero status arrives as 1. A component another program starts is transpiled by the kernel when its worker asks.wasi:httpis not provided, and a component that imports it, or anything else the host lacks, fails to start with a message. WASI Preview 3 (0.3) is not supported; the interface table is keyed by version so one can be added. stracelogs; it is notptrace. It records the system calls a process makes (strace CMD,strace -p PID), but never stops, steps or inspects the program, and shows arguments as strings and bytes rather than pointers. Seeman strace.- initfs isn't extracted via a real
tar.extractTarballruns before syscalls, processes, or/bin/taritself exist on the filesystem - the tarball being extracted is what provides/bin/tarin the first place, so boot uses a small bootstrap extractor instead of the real coreutil. A genuine fix needs a two-phase boot (a tiny bootstrap tarball extracted the current way, then everything else through the real/bin/tar). The tarball is/initfs.tar.gzeverywhere, the dev server included (ECMAOS_INITFSoverrides it,noneturns it off); a new filesystem gets all of it, and an existing one gets/usr/share(docs, licenses, the Vim runtime) again whenever the tarball changes, leaving/etc,/rootand/homealone. - init is deliberately small. It is a BusyBox-style init: runlevels only when
/etc/inittabhas aninitdefaultentry (withtelinitandrunlevel), no service dependencies, noctrlaltdelaction, and the login prompt is/sbin/gettyon each terminal (when the kernel is not given credentials to log in with; then it logs that user in itself).gettyandloginare a login prompt only: no serial lines, nologin -f, no PAM.poweroffstops the kernel and then tries to close the page, which a browser usually refuses, so in an ordinary tab it behaves likehalt.
Browser support
Chromium-based browsers (Chrome, Edge, Brave) are the supported way to run ecmaOS. The other two engines are tested, but to a narrower standard.
- Cross-origin isolation is required. The site has to be served with
Cross-Origin-Opener-Policy: same-originandCross-Origin-Embedder-Policy: require-corp(the configs in /hosting set them); a page without them says which headers are missing instead of booting. - Tested on every push, in headless Chromium, Firefox and WebKit (Playwright, /core/kernel/tests/e2e): a first boot from an empty profile, typing at the prompt, a pipeline, a WebAssembly program run as a process, and a file kept across a reload.
- Tested in Chromium only: the desktop (windows, WebGL2 graphics), WASI Preview 2 components, and anything that uses a device. A Firefox or WebKit user may find that these do not work.
- Safari itself is not tested. The WebKit run uses Playwright's build of Safari's engine on Linux, which is not the same thing; it says nothing about macOS, iOS or iPadOS, or about a phone or tablet in any browser.
- Hardware needs the browser's own support. WebUSB, Web Bluetooth, Web Serial and WebHID (
/dev/usb<N>,/dev/ble<N>,/dev/ttyACM<N>,/dev/hidraw<N>) and the File System Access API (mount -t webaccess) are APIs that Firefox and Safari do not provide at the time of writing, so those devices and that mount have nothing to work with there.
Early Days
ecmaOS 1.0 is a first stable release, but it is young software that stores your machine in your browser. There still may be breaking changes in minor version bumps. Copy anything that matters out of the machine, and use it at your own risk.
Things to keep in mind:
- Clearing your browser's site data for ecmaOS destroys the machine stored there, so treat it as a last resort
- The kernel runs in a browser, where it has the most to offer, or in Node (
@ecmaos/node); it does not need a DOM, but terminals, windows and devices come from whichever host it runs in - Chromium-based browsers get the most; see Browser support
- Many things are implemented in a non-optimal way; see Known gaps
- The coreutils are checked against GNU output, but not every command or option exists;
manand--helpsay what a command supports
History
ecmaOS is the successor of web3os. Where web3os was a desktop-style environment for web apps, ecmaOS 1.0 is built around the kernel: processes, users, devices and the Linux interfaces real programs expect. Apps and games are still welcome on top of it (see Apps), but they are one use among many.
Development
Turborepo is used to manage the monorepo, and pnpm is used for package management.
PNPM Workspaces:
A good place to start is viewing the scripts property of package.json in the root of the repository.
# Clone
git clone https://github.com/ecmaos/ecmaos.git
# Install dependencies
cd ecmaos && pnpm install
# Run the dev server
pnpm run dev:kernel
# Run the docs server (optional)
pnpm run dev:docs
# Build
pnpm run build
# Run tests
pnpm run test
pnpm run test:watch
pnpm run test:coverage
pnpm run test:bench
pnpm run test:ui
# Generate modules
turbo gen app # generate a new app template
turbo gen device # generate a new device template
turbo gen module # generate a new module template
Also see turbo.json and CONTRIBUTING.md for more information.
Licensing
ecmaOS itself (the kernel, @ecmaos/coreutils, and the other packages here) is MIT OR Apache-2.0. Some programs it runs are other people's software, built to WebAssembly, and keep their own licenses; they are kept in separate packages and separate files so the license of each is never in doubt.
@ecmaos/coreutils(core/utils) ships the JavaScript commands and the permissively licensed programs:bc/dc(BSD-2-Clause),jq(MIT and others),lua(MIT),sqlite3(public domain, with BSD-2-Clause linenoise),bzip2,xz(0BSD),zstd(BSD-3-Clause),brotli(MIT),mandoc(ISC),qjs(MIT),patch(0BSD),ncdu(MIT),mg(public domain) andmicropython(MIT, with the Python License for the frozen modules derived from CPython), and the desktop demos:wldemoand the SDL programs (sdlsnake,sdlpaint,sdlclip,sdlpad,sdlgl,sdlgears) link libwayland-client and the xdg-shell protocol code (MIT) and libxkbcommon (MIT), and the SDL ones SDL 3 (zlib). Their notices are incore/utils/licenses/.@ecmaos/coreutils-copyleft(core/utils-copyleft) ships the copyleft programs: GNUmake, GNUnanoand GNUscreen(GPL-3.0-or-later), GNUed,lz4,tree,doom(GPL-2.0-or-later; doomgeneric, linked with SDL 3, libwayland and libxkbcommon) and the ALSA toolsaplay,arecord,amixerandspeaker-test(GPL-2.0-or-later; alsa-lib, LGPL-2.1-or-later, linked in),vim(the Vim license) andperl(the Artistic License or the GPL). It carries their license texts, the build scripts and the changes ecmaOS made, and the upstream source archives (sources/, pinned by sha256 in its manifest). A site that serves these binaries serves that source at/sources/too;licenses/<program>/SOURCEis the written offer.- The kernel bundle contains none of them. Programs are separate
.wasmfiles served under/programs/with a catalog, and each is run as a process of its own, never imported as a library; that is what keeps them separate works from the kernel.@ecmaos/kerneldoes not publish them. - A build without copyleft programs: set
ECMAOS_COPYLEFT=0when building the kernel (or leave@ecmaos/coreutils-copyleftout). The site then serves only the permissive ones.
Everything is also in the running system: the texts are in /usr/share/licenses/@ecmaos/, one directory per package and program.
Third-party notices
- ZenFS (
@zenfs/core,@zenfs/linux,@zenfs/dom,@zenfs/archives,@zenfs/cloud,@zenfs/emscripten,@zenfs/streams), Copyright © James Prevett and other ZenFS contributors, licensed under the LGPL 3.0 or later and COPYING.md. ecmaOS is built on it and is grateful to it. It is a dependency, bundled by the build and not copied into this repository. One package is modified:@zenfs/core, whichpatches/@zenfs__core@2.8.3.patch(applied by pnpm at install) extends with POSIX ACLs (dist/internal/acl.js, and hooks in the inode and VFS code). The patch is that modified source, offered under the same LGPL; every other ZenFS package,utiliumandmemiumare unmodified. - utilium and memium, by the same author and also bundled, are the LGPL 3.0 or later with no web-application exception.
- What carries them: the site (a web application, which the ZenFS exception covers), the Node host
@ecmaos/node(ZenFS and the two libraries are bundled intodist/ecmaos.mjs). The Node host ships the library texts in alicenses/folder, and every distribution has them in the running system, in/usr/share/licenses/(licenseslists them and prints any of them). - Using your own copy. To build ecmaOS (the site, the Node host or the desktop app) against a modified copy of any of these libraries, point the dependency at your copy and rebuild; the steps are in
/usr/share/licenses/@zenfs/README.md(the same file is in the repository undercore/kernel/public/initfs/). - The rest of the dependency tree (about 300 packages in production) is MIT, Apache-2.0, BSD, ISC, MPL-2.0 (
lightningcss, a build tool, unmodified) or similar;pnpm check:licensesfails when a dependency is under a license that is not on the list inscripts/license-allowlist.json.
Contributing and license checks
Contributions are licensed under the license of the directory they touch (MIT OR Apache-2.0, and the program's own license under core/utils-copyleft), and each commit carries a Signed-off-by line (the Developer Certificate of Origin); see CONTRIBUTING.md. REUSE.toml states the license of every file, and CI runs reuse lint, pnpm check:licenses (dependencies) and pnpm check:license-boundary (the kernel and @ecmaos/coreutils never import the copyleft package).
Security Vulnerabilities
See SECURITY.md for more information.
If you find a serious security vulnerability, please submit a new Draft Security Advisory or contact the project maintainer directly at code@mathis.network.