diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c78a48..90dd66b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -332,12 +332,66 @@ jobs: set -e grep -q 'uefi ok: \[1, 2, 3\] \["one", "two three", "a b"\]' run.log || { echo "::error::the application's output or arguments"; exit 1; } grep -q 'files: true' run.log || { echo "::error::a file was not renamed or a listing shortened its name (release profile)"; exit 1; } + # A start of a program (0.32.0, openkal-uefi 0.13.0): LoadImage and StartImage. + grep -q 'starts: child 3' run.log || { echo "::error::the application did not start itself and read its status"; exit 1; } [ "$status" -eq 42 ] || { echo "::error::the application returned $status, not 42"; exit 1; } p=$(find target/x86_64-uefi -path '*bin/uefi.efi' -type f | head -1) file "$p" file "$p" | grep -q 'PE32+' && file "$p" | grep -q 'EFI application' \ || { echo "::error::x86_64-uefi is not a PE32+ EFI application"; exit 1; } + # THE MACHINE WITH NO OPERATING SYSTEM ABOVE RISC-V SBI (0.32.0): `riscv64-none-musl', a C program + # and a C++ program that throws and catches, built over openkal-opensbi and run by QEMU's `virt' + # with OpenSBI; each status leaves the machine through its test finisher. A row a platform defines + # with no system is read by mcpp from the release after 2026.11.22.1 (mcpp-community/mcpp#1006), + # which MCPP_SOURCE_REF names until it is released. + sbi: + needs: resolves + name: riscv64-none-musl (built on Linux x86_64, run under QEMU virt with OpenSBI) + runs-on: ubuntu-24.04 + timeout-minutes: 90 + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + + - uses: mcpp-community/setup-mcpp@v1 + with: + version: ${{ env.MCPP_VERSION }} + xlings-version: ${{ env.XLINGS_VERSION }} + + - name: The mcpp under cross-validation + run: | + [ -n "${MCPP_SOURCE_REF:-}" ] || exit 0 + src="$RUNNER_TEMP/mcpp-src" + git clone --quiet --depth 1 --branch "$MCPP_SOURCE_REF" https://github.com/mcpp-community/mcpp.git "$src" + rm -f "$src/.xlings.json" + ( cd "$src" && mcpp build --release ) + built=$(find "$src/target" -type f -name mcpp -path '*/bin/*' | head -1) + [ -n "$built" ] || { echo "::error::mcpp did not build from $MCPP_SOURCE_REF"; exit 1; } + echo "$(cd "$(dirname "$built")" && pwd)" >> "$GITHUB_PATH" + echo "under review: $("$built" --version) (from $MCPP_SOURCE_REF)" + + - name: A C program and a C++ program that throws, on the machine + working-directory: checks/sbi + run: | + mcpp --version + for p in sbi-c:7 sbi-cxx:9; do + bin=${p%%:*}; want=${p##*:} + set +e + timeout 600 mcpp run "$bin" --target riscv64-none-musl | tee "$bin.log" + status=${PIPESTATUS[0]} + set -e + [ "$status" -eq "$want" ] || { echo "::error::$bin ended with $status, not $want"; exit 1; } + done + grep -q 'sbi c: a mebibyte allocated, the clock advances' sbi-c.log || { echo "::error::the C program's output"; exit 1; } + grep -q 'sbi cxx: \["alpha", "mu", "zeta"\]' sbi-cxx.log && grep -q 'caught: across frames, 3 unwound' sbi-cxx.log \ + || { echo "::error::the C++ program's output, or its exception"; exit 1; } + p=$(find target/riscv64-none-musl -path '*bin/sbi-cxx' -type f | head -1) + file "$p" + file "$p" | grep -q 'ELF 64-bit LSB executable, UCB RISC-V' || { echo "::error::not a RISC-V executable"; exit 1; } + # I686-OPENKAL (0.28.0): the ok image of i386 (ELF32, REL), built from # checks/i386 in both modes, checked by okld, and run by okrun built for # i686-linux-musl from the openkal-image release this group names. @@ -389,6 +443,18 @@ jobs: [ "$status" -eq 7 ] || { echo "::error::the image returned $status, not 7 ($mode)"; exit 1; } done + # The row's runner is the carrier, packed by mcpp (0.31.3, openkal-image#46): an + # image that starts itself is entered through the carrier as its loader. + - name: An image starts itself through the row's runner + working-directory: checks/starts + run: | + set +e + mcpp run --target i686-openkal | tee run.log + status=${PIPESTATUS[0]} + set -e + [ "$status" -eq 0 ] && grep -qx 'starts: child 3' run.log \ + || { echo "::error::an i386 image's start of itself through the carrier (status $status)"; exit 1; } + # System V Release 4 on i386 (0.30.0): a program of i686-svr4-musl (openkal-musl # over openkal-svr4) built in both modes and run by the provider's runner, # ibcs-us in a user namespace; then the same executable under the two other @@ -494,6 +560,7 @@ jobs: grep -q 'dos ok: \["one", "two"\]' run.log && grep -q 'caught: across a frame' run.log \ && grep -q 'deep: 2080' run.log \ && grep -q 'files: true' run.log \ + && grep -q 'starts: child 3' run.log \ || { echo "::error::the DOS program's output ($mode)"; exit 1; } [ "$status" -eq 7 ] || { echo "::error::the DOS program returned $status, not 7 ($mode)"; exit 1; } done diff --git a/README.md b/README.md index a80747f..56ff6a5 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,29 @@ builds openkal-run's core runner as a program of the DOS row below, with the image in its `.oke` section. Measured under DOSBox Staging: the image sorted its arguments, caught its exception, read DOS's `PATH` and returned 7. +Platform 0.32.0 is a minor release of the group. A program of the firmware and +of DOS starts programs: openkal-uefi 0.13.0 provides `openkal.process` through +`LoadImage` and `StartImage`, and openkal-dos and openkal-dos-tools 0.3.0 +through EXEC, each a started program run to its end before the start returns +(openkal clause 7.19), so `x86_64-uefi` and `i686-dos-musl` state the interface +and a program's `posix_spawn` and `waitpid` start and wait for a program there. +openkal-musl 0.30.1 names them. openkal-windows 0.23.1: a program without +memory for its arguments and variables ends with that reason. `checks/uefi` and +`checks/dos` start themselves through the rows' runners in CI and read the +status 3. A row is added for a machine with no operating system above RISC-V SBI +firmware, `riscv64-none-musl` (below), with openkal-opensbi 0.10.1 joining the +group. It holds 0.31.3's member, openkal-image 0.7.3. + +Platform 0.31.3 is a patch of the group with one member. openkal-image 0.7.3: +okrun's command line is a function of the runner (`okrun_main`), and the +carrier, as a package's runner, is that function, so it names itself the +loader through which an image's start of an image file goes. Under 0.31.2 the +carrier named no loader: on `i686-openkal`, whose runner is the carrier, an +image that started an image was refused (`ENOEXEC` from `posix_spawn`, status +127 in a copy that called exec; openkal-image#46). `checks/starts` starts +itself on that row in CI. The carrier and the tools are 0.7.3. No other member +changes. + Platform 0.31.2 is a patch of the group with one member. openkal-image 0.7.2: a copy of the program ends as the copy ends itself. A library composes `fork` by starting a context in a copy of the address space (openkal.space); the copy @@ -230,7 +253,7 @@ until a project or this machine does: ```toml [target.x86_64-freebsd-musl] -platform = "openkal-platform@0.31.2" +platform = "openkal-platform@0.32.0" runner = { enabled = true } ``` @@ -333,6 +356,39 @@ own openkal implementation (`checks/hosted`). `[host] platform` selects it for the host graph: build programs are then compiled as ok images of the machine's architecture and run by okrun (`checks/host-graph`). +## A machine with no operating system, above RISC-V SBI (0.32.0) + +`riscv64-none-musl` is a row this platform defines and serves: a program that +OpenSBI starts on a RISC-V machine, on the same C library and C++ run-time over +openkal-opensbi, so it is written in C or in C++23 with `import std`. + +```toml +[target.riscv64-none-musl] +platform = "openkal-platform@0.32.0" +runner = { enabled = true } +``` + +```sh +mcpp run --target riscv64-none-musl # QEMU's virt with the OpenSBI it bundles; the status comes back +``` + +The row is the family's row with no system (`cfg(os = "none")`): what +openkal-musl and openkal-llvm-runtime state for a machine with no operating +system applies, among it the unwinder that finds its tables through the symbols +the linker script defines, since the program headers lie below the address the +firmware enters and are not loaded. openkal-opensbi supplies the entry, the +memory map (`board.ld`: the image at 0x80200000, a stack and a heap past it) and +the console. The machine description is the built-in `riscv64-none-elf` row's: +RV64GC, LP64D, the medium-any code model. A program's status leaves the machine +through the test finisher its device tree describes (openkal-opensbi 0.10.1); +SBI gives a program no arguments, and it receives none. The runner (xim's +`qemu-riscv`) boots a machine and is enabled by the project. An engine reads a +row a platform defines with no system from the release after mcpp 2026.11.22.1. + +`checks/sbi` runs in CI: a C program allocates, reads the clock and ends with 7; +a C++ program sorts, throws across three frames with a destructor in each and +catches, and ends with 9. + ## UEFI applications (0.28.0) `x86_64-uefi` is a row this platform defines and serves (`[[platform.define]]`, @@ -342,7 +398,7 @@ with `import std`: ```toml [target.x86_64-uefi] -platform = "openkal-platform@0.31.2" +platform = "openkal-platform@0.32.0" runner = { enabled = true } ``` @@ -378,7 +434,7 @@ and C++ run-time over openkal-svr4, so it is written in C++23 with `import std`: ```toml [target.i686-svr4-musl] -platform = "openkal-platform@0.31.2" +platform = "openkal-platform@0.32.0" runner = { enabled = true } ``` @@ -432,7 +488,7 @@ run-time over openkal-dos, so it is written in C++23 with `import std`: ```toml [target.i686-dos-musl] -platform = "openkal-platform@0.31.2" +platform = "openkal-platform@0.32.0" ``` The row is TECHNICAL EXPERIMENT ONLY (openkal-dos's README). A program is the diff --git a/carrier/main.cpp b/carrier/main.cpp index 7900a97..9c75a87 100644 --- a/carrier/main.cpp +++ b/carrier/main.cpp @@ -3,8 +3,9 @@ // `mcpp_carried_end`, and its name at `mcpp_carried_name`: // // nothing the program is a package's runner -// (`libexec/okrun/-/okrun`): it runs the image, or the -// okb, its first argument names, as okrun does; +// (`libexec/okrun/-/okrun`): it is okrun's command +// line (okrun_main, openkal-run 0.7.3), and so the loader an +// image's start of an image file goes through; // a zip the images of a program (a single file): the entry and the // images it needs run from memory, nothing written to disk; // an image the image runs from memory, as its own program (M3). @@ -20,15 +21,11 @@ int main(int argc, char** argv) { okrun_options options{}; const auto size = static_cast(mcpp_carried_end - mcpp_carried_begin); const auto args = const_cast(argv); - if (size == 0) { - if (argc < 2) { - std::fprintf(stderr, "usage: %s [arguments...]\n", argv[0]); - return 2; - } - okrun_run_file(argv[1], argc - 1, args + 1, &options, why, sizeof why); - std::fprintf(stderr, "%s: %s\n", argv[1], why); - return 127; - } + // A RUNNER NAMES ITSELF THE LOADER (0.31.3, openkal-image#46). With default + // options it named none, and an image's start of an image file was refused: + // on i686-openkal, whose runner this is, `posix_spawn` of the image itself + // gave ENOEXEC, and a copy that called exec ended with 127. + if (size == 0) return okrun_main(argc, argv); options.carried = 1; // the program is the image's name, and what starts it again if (size >= 4 && std::memcmp(mcpp_carried_begin, "PK\x03\x04", 4) == 0) okrun_run_okb_bytes(mcpp_carried_begin, size, mcpp_carried_name, argc, args, &options, diff --git a/checks/dos/src/main.cpp b/checks/dos/src/main.cpp index a4ad230..5f54254 100644 --- a/checks/dos/src/main.cpp +++ b/checks/dos/src/main.cpp @@ -3,6 +3,11 @@ // (0.29.1, `-z stack-size'), which openkal-dos 0.1.1's stub reads from PT_GNU_STACK. import std; +#include +#include + +extern "C" char** environ; + int deep(int n) { volatile char frame[8192]; frame[0] = static_cast(n); @@ -33,7 +38,20 @@ bool files() { return names == std::vector{"g1.txt"}; } +// A START OF A PROGRAM (0.32.0): the program starts itself by posix_spawn with `child', which ends +// with 3, and waitpid reads the status; the row's implementation provides openkal.process, a +// started program run to its end before the start returns (openkal clause 7.19). +int starts(const char* self) { + pid_t pid; + char* args[] = {const_cast(self), const_cast("child"), nullptr}; + if (posix_spawn(&pid, self, nullptr, nullptr, args, environ) != 0) return -1; + int status = 0; + if (waitpid(pid, &status, 0) != pid) return -2; + return WIFEXITED(status) ? WEXITSTATUS(status) : -3; +} + int main(int argc, char** argv) { + if (argc >= 2 && std::string_view(argv[1]) == "child") return 3; std::vector v(argv + 1, argv + argc); std::ranges::sort(v); std::println("dos ok: {}", v); @@ -42,5 +60,6 @@ int main(int argc, char** argv) { std::println("PATH set: {}", std::getenv("PATH") != nullptr); std::println("deep: {}", deep(64)); std::println("files: {}", files()); + std::println("starts: child {}", starts(argv[0])); return 7; } diff --git a/checks/sbi/mcpp.toml b/checks/sbi/mcpp.toml new file mode 100644 index 0000000..dec03f3 --- /dev/null +++ b/checks/sbi/mcpp.toml @@ -0,0 +1,19 @@ +# The machine with no operating system above RISC-V SBI (0.32.0): a C program and a C++ program +# that throws and catches, on the family's C library and C++ run-time over openkal-opensbi, run by +# QEMU's `virt' with OpenSBI. The platform is the directory above. +[package] +name = "sbi" +version = "0.1.0" + +[targets.sbi-c] +kind = "bin" +main = "src/c.c" + +[targets.sbi-cxx] +kind = "bin" +main = "src/cxx.cpp" + +[target.riscv64-none-musl] +platform = { path = "../.." } +# The runner boots a machine and is enabled by the project (0.29.0). +runner = { enabled = true } diff --git a/checks/sbi/src/c.c b/checks/sbi/src/c.c new file mode 100644 index 0000000..3380bcd --- /dev/null +++ b/checks/sbi/src/c.c @@ -0,0 +1,17 @@ +/* C on the machine: the console, the allocator, the clock, and a status the machine ends with. */ +#include +#include +#include +#include + +int main(void) { + char* p = malloc(1 << 20); + if (p) memset(p, 1, 1 << 20); + struct timespec a, b; + clock_gettime(CLOCK_MONOTONIC, &a); + clock_gettime(CLOCK_MONOTONIC, &b); + printf("sbi c: %s, the clock %s\n", p ? "a mebibyte allocated" : "no memory", + (b.tv_sec > a.tv_sec || b.tv_nsec >= a.tv_nsec) ? "advances" : "runs back"); + free(p); + return 7; +} diff --git a/checks/sbi/src/cxx.cpp b/checks/sbi/src/cxx.cpp new file mode 100644 index 0000000..f104f8e --- /dev/null +++ b/checks/sbi/src/cxx.cpp @@ -0,0 +1,21 @@ +// C++23 on the machine: `import std', containers and ranges, an exception thrown across frames and +// caught with a destructor run on the way, and a status the machine ends with. +import std; + +namespace { +int unwound = 0; +struct guard { ~guard() { ++unwound; } }; +[[gnu::noinline]] void thrower(int depth) { + guard g; + if (depth == 0) throw std::runtime_error("across frames"); + thrower(depth - 1); +} +} // namespace + +int main() { + std::vector v{"zeta", "alpha", "mu"}; + std::ranges::sort(v); + std::println("sbi cxx: {}", v); + try { thrower(2); } catch (const std::exception& e) { std::println("caught: {}, {} unwound", e.what(), unwound); } + return 9; +} diff --git a/checks/starts/mcpp.toml b/checks/starts/mcpp.toml new file mode 100644 index 0000000..4600e7c --- /dev/null +++ b/checks/starts/mcpp.toml @@ -0,0 +1,13 @@ +# An image that starts itself (0.31.3, openkal-image#46): built for i686-openkal and run by the +# row's runner, the carrier as its package's runner, which names itself the loader of an +# image's start of an image file. The platform is the directory above. +[package] +name = "starts" +version = "0.1.0" + +[targets.starts] +kind = "bin" +main = "src/main.c" + +[target.i686-openkal] +platform = { path = "../.." } diff --git a/checks/starts/src/main.c b/checks/starts/src/main.c new file mode 100644 index 0000000..a3a72b0 --- /dev/null +++ b/checks/starts/src/main.c @@ -0,0 +1,20 @@ +/* Started with no argument, the image starts itself with `child' by posix_spawn and + * writes the child's status; started with `child', it ends with 3. */ +#include +#include +#include +#include + +extern char** environ; + +int main(int argc, char** argv) { + if (argc > 1 && strcmp(argv[1], "child") == 0) return 3; + pid_t pid; + char* args[] = { argv[0], "child", NULL }; + const int rc = posix_spawn(&pid, argv[0], NULL, NULL, args, environ); + if (rc != 0) { printf("starts: posix_spawn %d\n", rc); return 1; } + int status = 0; + if (waitpid(pid, &status, 0) != pid) { printf("starts: waitpid\n"); return 1; } + printf("starts: child %d\n", WIFEXITED(status) ? WEXITSTATUS(status) : -1); + return 0; +} diff --git a/checks/uefi/src/main.cpp b/checks/uefi/src/main.cpp index c35eba7..4abb168 100644 --- a/checks/uefi/src/main.cpp +++ b/checks/uefi/src/main.cpp @@ -4,6 +4,11 @@ // returned to the machine that ran it. import std; +#include +#include + +extern "C" char** environ; + // A directory made, a file written, renamed and listed by its whole name, and removed (0.29.2): // on the release profile openkal-uefi 0.11.1 listed `g1.' for `g1.txt' and renamed nothing, and // under DOS a listing after 32 changes of working directory found nothing (openkal-musl 0.29.8). @@ -28,11 +33,29 @@ bool files() { return names == std::vector{"g1.txt"}; } +// A START OF A PROGRAM (0.32.0): the program starts itself by posix_spawn with `child', which ends +// with 3, and waitpid reads the status; the row's implementation provides openkal.process, a +// started program run to its end before the start returns (openkal clause 7.19). +int starts(const char* self) { + pid_t pid; + char* args[] = {const_cast(self), const_cast("child"), nullptr}; + if (posix_spawn(&pid, self, nullptr, nullptr, args, environ) != 0) return -1; + int status = 0; + if (waitpid(pid, &status, 0) != pid) return -2; + return WIFEXITED(status) ? WEXITSTATUS(status) : -3; +} + int main(int argc, char** argv) { + if (argc >= 2 && std::string_view(argv[1]) == "child") return 3; std::vector v{3, 1, 2}; std::ranges::sort(v); std::vector args(argv + 1, argv + argc); std::println("uefi ok: {} {}", v, args); std::println("files: {}", files()); + // The Shell names the program by the path it resolved (`FS0:\\APP.EFI'); beneath the root it is + // the last component. + const std::string_view a0 = argv[0]; + const std::string self = "/" + std::string(a0.substr(a0.find_last_of("\\:/") + 1)); + std::println("starts: child {}", starts(self.c_str())); return 42; } diff --git a/mcpp.toml b/mcpp.toml index f254ec3..f0bdde4 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -12,7 +12,7 @@ [package] namespace = "mcpplibs" name = "openkal-platform" -version = "0.31.2" +version = "0.32.0" description = "The platform of ok images (-openkal): their toolchain, C library and C++ run-time, tools, compile and link conventions, seal, runner and carrier, as one versioned statement mcpp reads." license = "Apache-2.0" authors = ["mcpplibs"] @@ -59,7 +59,7 @@ toolchain = "llvm@23.1.3" runner = { cmd = ["okrun", "{}"], host = "same-arch", hosts = ["linux-x86_64", "linux-aarch64", "linux-i686", "macos-aarch64", "macos-x86_64", "windows-x86_64", "freebsd-x86_64", "freebsd-aarch64", "uefi-x86_64", "dos-i686"], built-as = { "freebsd-x86_64" = "x86_64-freebsd-musl", "freebsd-aarch64" = "aarch64-freebsd-musl", "linux-i686" = "i686-linux-musl" } } # `mcpp pack --mode self-contained`: a program of the packing machine that # carries the image in a section and runs it through libokrun (M3). -carrier = { package = "openkal-run@0.7.2", section = ".oke", main = "carrier/main.cpp" } +carrier = { package = "openkal-run@0.7.3", section = ".oke", main = "carrier/main.cpp" } # The `okb` package format (`mcpp pack --pkg-format okb`): the images of every # architecture as one file okrun runs (openkal-image docs/okb.md). plugin = "build.mcpp" @@ -73,18 +73,18 @@ debuggee = ["okrun", "--debugger", "{}"] [platform.layers] compiler-runtime = "openkal-llvm-runtime@0.21.0" "c++-abi" = "openkal-llvm-runtime@0.21.0" -c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mimalloc"] } +c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } # Built for the building machine: `okld` writes and checks the notes, `okrun` # runs an image, `okprof` reads what a measured run recorded (0.23.0: the # order of a start's first executions, which a producer lays its code out by # and writes as the touch note). [platform.tools] -okld = "openkal-tools@0.7.2" -okrun = "openkal-tools@0.7.2" -okprof = "openkal-tools@0.7.2" +okld = "openkal-tools@0.7.3" +okrun = "openkal-tools@0.7.3" +okprof = "openkal-tools@0.7.3" # The seal of the DOS row (0.28.0): the stub of openkal-dos before an executable. -okdos = "openkal-dos-tools@0.2.0" +okdos = "openkal-dos-tools@0.3.0" # Every unit of an image (SPEC 12.2): # -fPIC the image is ET_DYN and has no text relocation; @@ -222,7 +222,7 @@ toolchain = "llvm@23.1.3" [platform.hosted.layers] compiler-runtime = "openkal-llvm-runtime@0.21.0" "c++-abi" = "openkal-llvm-runtime@0.21.0" -c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mimalloc"] } +c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } # THE HOSTED ROWS' RUNNERS ON ANOTHER SYSTEM (0.29.0; mcpp 2026.11.16.1 reads a # runner's `enabled`). A FreeBSD program runs in the FreeBSD virtual machine of @@ -240,7 +240,7 @@ serves = ["x86_64-freebsd-musl"] hosted = true base = "none" toolchain = "llvm@23.1.3" -layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } } runner = { cmd = ["dirun", "--profile", "{pkg:freebsd-disk-image}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--", "{}"], host = "any", hosts = ["linux-x86_64"], requires = ["xim:dirun@0.6.0", "xim:freebsd-disk-image@14.5-1", "xim:qemu-x86@9.2.4-1"], enabled = false } [[platform.provider]] @@ -249,7 +249,7 @@ serves = ["aarch64-freebsd-musl"] hosted = true base = "none" toolchain = "llvm@23.1.3" -layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } } runner = { cmd = ["dirun", "--profile", "{pkg:aarch64-freebsd-disk-image}/dirun.toml", "--var", "firmware={pkg:ovmf}/share/edk2/edk2-aarch64-code.fd", "--emulator", "{pkg:qemu-system}/bin/qemu-system-aarch64", "--", "{}"], host = "any", hosts = ["linux-x86_64"], requires = ["xim:dirun@0.6.0", "xim:aarch64-freebsd-disk-image@14.5-1", "xim:ovmf@9.2.4-4", "xim:qemu-system@9.2.4"], enabled = false } [[platform.provider]] @@ -258,7 +258,7 @@ serves = ["x86_64-windows-musl"] hosted = true base = "none" toolchain = "llvm@23.1.3" -layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } } runner = { cmd = ["wine", "{}"], host = "same-arch", hosts = ["linux-x86_64"], requires = ["xim:wine@11.0"], enabled = false } # The runners require dirun 0.5.0 and ovmf 9.2.4-3 (0.29.0): ovmf's profile states the UEFI @@ -293,7 +293,7 @@ serves = ["x86_64-uefi"] base = "none" hosted = true -layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mimalloc"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mimalloc"] } } link = { driver = "lld", start = "efi_main", flags = ["--subsystem", "efi_application", "--gc-sections"], exe = "{name}.efi", inputs = [{ file = "board/qemu-exit.S" }], seal = [] } runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:ovmf}/dirun.toml", "--emulator", "{pkg:qemu-x86}/bin/qemu-system-x86_64", "--memory", "2048", "--"], hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64"], requires = ["xim:dirun@0.6.0", "xim:qemu-x86@9.2.4-1", "xim:ovmf@9.2.4-4"], enabled = false } @@ -332,10 +332,47 @@ serves = ["i686-dos-musl"] base = "none" hosted = true -layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mallocng"] } } +layers = { compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mallocng"] } } link = { driver = "lld", start = "okdos_entry", flags = ["-static", "--image-base=0x1000", "-z", "norelro", "-z", "stack-size=1048576", "--gc-sections", "--eh-frame-hdr"], seal = [["okdos", "seal", "{}"]] } runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:dosbox-staging}/dirun.toml", "--"], hosts = ["linux-x86_64", "macos-aarch64", "windows-x86_64"], requires = ["xim:dirun@0.6.0", "xim:dosbox-staging@0.83.0-2"], enabled = false } +# A MACHINE WITH NO OPERATING SYSTEM, ABOVE RISC-V SBI FIRMWARE (0.32.0): programs OpenSBI starts +# on a RISC-V machine (QEMU's `virt' with `-bios default', or a board whose firmware is OpenSBI), on +# the same C library and C++ run-time over openkal-opensbi. The row is the no-system row of the +# family: `cfg(os = "none")' selects what openkal-musl and openkal-llvm-runtime state for a machine +# with no operating system --- no files, programs or contexts, the unwinder that reads its tables +# through the symbols the linker script defines (the program headers lie below the address the +# firmware enters, so they are not loaded), the C++ run-time's freestanding configuration --- and +# openkal-opensbi supplies the entry, the memory map (`board.ld': the image at 0x80200000, a stack +# and a heap past it) and the console. The machine description is the built-in `riscv64-none-elf' +# row's: RV64GC, the LP64D convention, the medium-any code model. The program's status leaves the +# machine through the test finisher its device tree describes (openkal-opensbi 0.10.1); a program +# receives no arguments, SBI having none to give. The runner is QEMU's `virt' machine with the +# OpenSBI it bundles (xim's `qemu-riscv'). The row links through the compiler, as the built-in +# no-system rows do: the freestanding link words (no start files, no default libraries, a static +# image) are the engine's, and what the layer suppliers state for the link (`-Wl,--eh-frame-hdr', +# the board's `-T board.ld') is in the compiler driver's words, which `ld.lld' refuses. +[[platform.define]] +triple = "riscv64-none-musl" +clang-triple = "riscv64-unknown-none-elf" +object-format = "elf" +data-model = "lp64" +execution = "none" +tier = "preview" +march = "rv64gc" +mabi = "lp64d" +code-model = "medany" +flags = ["-fasynchronous-unwind-tables", "-ffunction-sections", "-fdata-sections"] + +[[platform.provider]] +name = "sbi" +serves = ["riscv64-none-musl"] +base = "none" +hosted = true + +layers = { "kernel-abi" = { name = "openkal-opensbi", version = "0.10.1", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mallocng"] } } +runner = { cmd = ["{pkg:qemu-riscv}/bin/qemu-system-riscv64", "-machine", "virt", "-nographic", "-no-reboot", "-bios", "default", "-kernel", "{}"], hosts = ["linux-x86_64", "linux-aarch64", "macos-aarch64", "windows-x86_64"], requires = ["xim:qemu-riscv@9.2.4-1"], enabled = false } + # UNIX SYSTEM V RELEASE 4 AND ITS DESCENDANTS ON i386 (0.30.0): programs of the # kernel's own system-call interface, on the same C library and C++ run-time over # openkal-svr4. Nothing of a system is linked or read: the program is one static @@ -390,7 +427,7 @@ serves = ["i686-svr4-musl"] base = "none" hosted = true -layers = { "kernel-abi" = { name = "openkal-svr4", version = "0.3.0", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.0", default-features = false, features = ["posix", "malloc-mallocng"] } } +layers = { "kernel-abi" = { name = "openkal-svr4", version = "0.3.0", features = ["standalone"] }, compiler-runtime = "openkal-llvm-runtime@0.21.0", "c++-abi" = "openkal-llvm-runtime@0.21.0", c-abi = { name = "openkal-musl", version = "0.30.1", default-features = false, features = ["posix", "malloc-mallocng"] } } link = { driver = "lld", script = "link/svr4.ld", flags = ["-static", "-z", "norelro", "--gc-sections", "--eh-frame-hdr"] } runner = { cmd = ["unshare", "-Ur", "{pkg:ibcs-us}/bin/ibcs-us", "{}"], hosts = ["linux-x86_64"], requires = ["xim:ibcs-us@4.3-2"], enabled = false } @@ -477,7 +514,14 @@ runner = { cmd = ["unshare", "-Ur", "{pkg:ibcs-us}/bin/ibcs-us", "{}"], hosts = # than the first ends the program as the request); 0.31.2, openkal-image 0.7.2 # (a copy of the program, which a library's fork makes, ends as it ends itself, # where under 0.7.1 its kal_exit waited for the runner's task, which the copy -# does not have: openkal-image#44). From 0.24.1 the members name +# does not have: openkal-image#44); 0.31.3, openkal-image 0.7.3 (the carrier, +# as a package's runner, is okrun's command line and names itself the loader of +# an image's start of an image file: openkal-image#46); 0.32.0, a program of the +# firmware and of DOS starts programs (openkal-uefi 0.13.0 through LoadImage and +# StartImage, openkal-dos and openkal-dos-tools 0.3.0 through EXEC, each a +# started program run to its end first, openkal clause 7.19), openkal-musl 0.30.1 +# naming them, and openkal-windows 0.23.1 (a program without memory for its +# arguments ends with the reason). From 0.24.1 the members name # one another by compatible ranges (`^0.28.0`) and this group chooses the # versions: mcpp 2026.11.7.1 resolves within it, and a fix of one member is that # member's release and a patch of this group, released together through one @@ -486,17 +530,18 @@ runner = { cmd = ["unshare", "-Ur", "{pkg:ibcs-us}/bin/ibcs-us", "{}"], hosts = openkal = "0.26.0" openkal-linux = "0.27.0" openkal-macos = "0.24.1" -openkal-windows = "0.23.0" +openkal-windows = "0.23.1" openkal-freebsd = "0.2.0" -openkal-uefi = "0.12.0" -openkal-dos = "0.2.0" -openkal-dos-tools = "0.2.0" +openkal-uefi = "0.13.0" +openkal-dos = "0.3.0" +openkal-dos-tools = "0.3.0" openkal-svr4 = "0.3.0" -openkal-musl = "0.30.0" +openkal-opensbi = "0.10.1" +openkal-musl = "0.30.1" openkal-llvm-runtime = "0.21.0" -openkal-ld = "0.7.2" -openkal-run = "0.7.2" -openkal-tools = "0.7.2" +openkal-ld = "0.7.3" +openkal-run = "0.7.3" +openkal-tools = "0.7.3" # The plugin's tool, `okld bundle`, which writes the okb, and its library, the # provider of a package format (mcpp.plugins.platform). mcpp.plugins 0.26.1 @@ -504,7 +549,7 @@ openkal-tools = "0.7.2" # mcpplibs.os 0.4.4, whose openkal ends at 0.25, and the version group's 0.26.0 # could not share a build with it. [build-dependencies] -openkal-tools = { version = "0.7.2", tools = ["okld"] } +openkal-tools = { version = "0.7.3", tools = ["okld"] } [build-dependencies.mcpp] plugins = { version = "0.26.1", features = ["plugins-platform"], host-module = true }