Skip to content

Userspace

Userspace programs are ordinary std Rust binaries with a main(). They target x86_64-unknown-edos and link a forked Rust std, so String, Vec, std::fs, std::thread and std::net are all there and mean what you expect.

That is the point of the fork: no #![no_std], no custom C library, no bespoke entry macro.

75 binaries land in /bin:

Session: edos-init, edos-wm, edos-taskbar, edos-terminal, edos-sh, edos-vi

Coreutils: cat, cp, mv, rm, mkdir, rmdir, ls, touch, stat, file, head, tail, wc, cut, tr, sort, uniq, tee, grep, diff, find, du, df, xargs, seq, yes, true, false, echo, env, basename, dirname, sha256sum, hexdump, cal, sleep, sync, hello

System: ps, kill, free, uname, dmesg, mount, write, shutdown, efs-mkfs, edos-install

Network: ping, dns, dnsprobe, http, wget

Media: play, which pushes WAV data at /dev/dsp

Tests: alloctest, forktest, exectest, killtest, threadtest, iotest, mmaptest, evicttest, inflighttest, lockordertest, tcptest, vectest, wintest, fstest, fsbench

The test programs are not toys: they are the regression suite, and several of the nastiest kernel bugs were found by running them in a loop.

edos-sh has job control and a scripting language. Blocks end with end, so there is no fi, done or esac.

#!/bin/sh
for file in $(ls /bin)
if [ -f /bin/$file ]
echo "program: $file"
end
end

It supports variables and export, $?, $0, $1$9, $#, $@, tilde expansion, command substitution with $(...), &&, ||, ;, pipes, >, >>, <, if/elif/ else, while, for, break, continue, test (and [), and set -e.

Control flow works in scripts, not in interactive mode.

The full reference is doc/scripting.txt.

edos-vi is a vi-like modal editor: normal and insert modes, the usual motions, and :w, :q, :q!.

The EDOS editor in normal mode, editing a file, with the mode, path and cursor position on the status line.

Crate What it gives you
edos_lib syscall wrappers the fork does not surface through std: networking extras, shared memory, process control, timing, keymaps
edos_render textures, a widget toolkit with layout, and the window syscalls
edos_rt the runtime the std fork is built on, published to crates.io

See Writing a program.