foundry
Foundry OS: the operating system built on the Rustbelt kernel
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | # Foundry OS build settings. The Makefile includes this file; you can also
# override any value on the command line: `make KERNEL_DIR=~/rk test`.
# ---- The kernel we build against ------------------------------------------
# Foundry OS runs on the Rustbelt kernel. We never build "whatever is checked
# out": we export one exact commit (KERNEL_REV) from the kernel's git store
# into out/kernel-src and build it there, with its own target dir. Bump
# KERNEL_REV deliberately (and re-run `make test`) when the kernel moves on.
KERNEL_DIR ?= /workspace/rust-kernel
KERNEL_REV ?= 5291332
KERNEL_VERSION ?= 0.20.0
# The first line the kernel prints (also `ver` and uname's "version"). The
# self-test checks for it, so it changes with every pin bump; see
# docs/bumping-the-kernel.md.
KERNEL_BANNER ?= Rustbelt 0.20.0 (stage 20: gcc -static and timerfd)
# ---- The image -------------------------------------------------------------
ARCH ?= x86_64
# Boot contract version (docs/boot-contract.md). v1 = today's layout:
# GPT + one FAT32 partition, programs in /bin, kernel runs /mnt/disk0/bin/sh.
CONTRACT ?= v1
IMAGE_NAME ?= foundry.img
IMAGE_MIB ?= 64
# FAT volume label. Kept as the kernel's TYLERDISK under contract v1 so the
# image is the same as the kernel's own disk.img.
IMAGE_LABEL ?= TYLERDISK
# ---- Programs in /bin ------------------------------------------------------
# Built from this repo (rust/):
RUST_PROGRAMS := sh ls cat wc grep mkdir rm touch cp sleep \
ifconfig ping host fetch httpd getty tile random sysinfo
# ABI test fixtures that stay in the kernel repo (proposal section 7). For
# contract v1 the image still carries them (the self-test runs them), so
# they are compiled from the pinned kernel source in out/kernel-src/user.
FIXTURE_RUST := hello evil spin demo child overflow forktest cowtest \
mmaptest sigtest threads echoserver ptytest nbtest \
fputest pathtest libctest coretest unixtest
FIXTURE_C := rawabi
# name:kind[:source], kind = pie (musl-gcc -static-pie), exec (plain
# musl-gcc -static, an ET_EXEC at 0x400000; works since 0.20.0) or dyn
# (dynamic; Rustbelt must refuse it). source defaults to name.
FIXTURE_MUSL := vdsotest:exec piehello:pie piethreads:pie dynhello:dyn remaptest:pie \
exechello:exec execthreads:exec:piethreads timerfdtest:exec
# The order programs are copied into /bin: the same order as the kernel's
# build.rs (PROGRAMS, then C_PROGRAMS, then MUSL_PROGRAMS), so `ls` lists
# them the same way.
BIN_ORDER := sh ls cat wc grep mkdir rm touch cp sleep \
hello evil spin demo child sysinfo overflow \
ifconfig ping host fetch httpd random getty tile \
forktest cowtest mmaptest sigtest threads echoserver ptytest nbtest \
fputest pathtest libctest coretest unixtest \
rawabi vdsotest piehello piethreads dynhello remaptest \
exechello execthreads timerfdtest
# Foundry OS's own C programs (c/NAME.c), built with toolchain/foundry-cc
# as static-PIEs against our musl (milestone M2). They go to /bin after the
# programs above, and the self-test runs them (rootfs/scripts/selftest.sh,
# the "Foundry OS" block; expected lines in scripts/expect-foundry.txt).
FOUNDRY_C := hello-musl fprobe
# ---- Toolchain pins (downloaded into cache/, checked by SHA256) -----------
MUSL_VERSION ?= 1.2.5
|