Skip to content

Building from source

The kernel builds on plain nightly. Userspace is the awkward part: it links a real std, which means a custom toolchain.

xorriso, sgdisk, mtools, and QEMU. On Debian or Ubuntu:

Terminal window
sudo apt install xorriso gdisk mtools qemu-system-x86 ovmf
Terminal window
git clone https://github.com/edg-l/edos-v2
cd edos-v2
make -C kernel check

That works with nothing but a Rust nightly, and is enough for kernel-only work.

Userspace targets x86_64-unknown-edos and links a forked std. Build and link the toolchain once:

Terminal window
git clone -b edos_std_v2 https://github.com/edg-l/rust.git
cd rust
./x install
rustup toolchain link edos <install-prefix>

The fork is edg-l/rust, branch edos_std_v2. Its runtime crate is edos_rt, published to crates.io and pinned exactly by the fork’s library/std/Cargo.toml.

Without the edos toolchain, make programs and make all fail.

Target What it does
make all programs, kernel, bootable ISO
make kernel kernel only, which depends on programs
make programs userspace only, into filesystem/bin/
make check type-check the kernel
make fmt format the kernel
make test the in-kernel scheduler and sync test suite, headless
make sata-disk.img build the 5G root filesystem image
make clean-sata drop it

sata-disk.img is a 5G qcow2: a raw image is partitioned with sgdisk, the host-side efs-mkfs formats the partition as EFS, and it is populated from filesystem/.

filesystem/ is gitignored. make filesystem creates the directory skeleton and make programs puts binaries into filesystem/bin/. Changing anything under filesystem/, tools/efs-mkfs/ or libs/efs-common/ rebuilds the image.

Feature What it turns on
trace per-CPU trace buffers, dumped on panic
sched-test the in-kernel scheduler and sync-primitive test suite
lock-order-self-test exercises the lock-order tracker
lock-order-self-test-inversion deliberately inverts an order and panics; run it with make run-single

A change to the runtime crate only reaches userspace once it is published and the fork’s pin moves. The whole loop:

  1. Patch edos_rt, bump the version, cargo publish.
  2. Bump edos_rt = "0.0.z" in library/std/Cargo.toml in the fork.
  3. cargo +nightly update --manifest-path library/Cargo.toml -p edos_rt.
  4. ./x install in the fork.
  5. cargo +edos clean in programs/, then make programs.

A 0.0.z requirement is exact, so a skipped pin bump silently ships the old crate.