Building from source
The kernel builds on plain nightly. Userspace is the awkward part: it links a real
std, which means a custom toolchain.
Host packages
Section titled “Host packages”xorriso, sgdisk, mtools, and QEMU. On Debian or Ubuntu:
sudo apt install xorriso gdisk mtools qemu-system-x86 ovmfThe kernel alone
Section titled “The kernel alone”git clone https://github.com/edg-l/edos-v2cd edos-v2make -C kernel checkThat works with nothing but a Rust nightly, and is enough for kernel-only work.
Userspace: the edos toolchain
Section titled “Userspace: the edos toolchain”Userspace targets x86_64-unknown-edos and links a forked std. Build and link the
toolchain once:
git clone -b edos_std_v2 https://github.com/edg-l/rust.gitcd rust./x installrustup 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.
Build targets
Section titled “Build targets”| 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 |
The disk image
Section titled “The disk image”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.
Kernel features
Section titled “Kernel features”| 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 |
Changing edos_rt
Section titled “Changing edos_rt”A change to the runtime crate only reaches userspace once it is published and the fork’s pin moves. The whole loop:
- Patch
edos_rt, bump the version,cargo publish. - Bump
edos_rt = "0.0.z"inlibrary/std/Cargo.tomlin the fork. cargo +nightly update --manifest-path library/Cargo.toml -p edos_rt../x installin the fork.cargo +edos cleaninprograms/, thenmake programs.
A 0.0.z requirement is exact, so a skipped pin bump silently ships the old crate.