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 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | # 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 ?= 6bb2b25
KERNEL_VERSION ?= 0.21.1
# 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.21.1 (stage 21: root partition and init)
# ---- The image -------------------------------------------------------------
ARCH ?= x86_64
# Boot contract version (docs/boot-contract.md), picks what `make image`,
# `make run` and `make test` use:
# v2 (default since M3, Rustbelt 0.21+): one GPT disk with an ext2 root
# (A: = /), a FAT32 data partition (B: = /mnt/disk0) and an exFAT
# share (C: = /mnt/share); the kernel runs our /sbin/init as pid 1.
# Image: out/foundry.img (scripts/mkimage-v2.sh).
# v1 (the old layout, kept for `make test-v1` and `make compare`): GPT +
# one FAT32 partition, programs in /bin, the kernel runs
# /mnt/disk0/bin/sh. Image: out/foundry-v1.img (scripts/mkimage.sh).
CONTRACT ?= v2
IMAGE_NAME ?= foundry.img
IMAGE_V1_NAME ?= foundry-v1.img
# v1 only: image size, and the FAT volume label. Kept as the kernel's
# TYLERDISK so the v1 image is the same as the kernel's own disk.img.
IMAGE_MIB ?= 64
IMAGE_LABEL ?= TYLERDISK
# v2 only: partition sizes in MiB (the disk is 2 MiB bigger: GPT + backup).
ROOT_MIB ?= 32
DATA_MIB ?= 40
SHARE_MIB ?= 16
# ---- 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 orphan
# Third-party programs from ports/NAME (pinned tarball in cache/, built
# static-PIE with foundry-cc), installed as /bin/NAME.
FOUNDRY_PORTS := dash
# Files outside /bin that only Foundry OS's v1 image has (make compare skips them).
FOUNDRY_FILES := scripts/dash-test.sh
# ---- Toolchain pins (downloaded into cache/, checked by SHA256) -----------
MUSL_VERSION ?= 1.2.5
|