From 8f9e67071e747eaccbcd6bbd2548d9302112e25c Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Tue, 17 Nov 2026 04:43:25 +0900 Subject: [PATCH 1/3] 0.29.1: openkal-uefi 0.11.1 and openkal-dos 0.1.1, the DOS row's 1 MiB stack, ovmf 9.2.4-4 and dirun 0.6.0, mcpp.plugins 0.22.0 --- .github/workflows/ci.yml | 17 +++++++++++++++-- README.md | 29 +++++++++++++++++++---------- checks/dos/src/main.cpp | 11 ++++++++++- checks/uefi/src/main.cpp | 3 ++- mcpp.toml | 31 ++++++++++++++++++------------- 5 files changed, 64 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6efa576..b87d4f1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -355,10 +355,10 @@ jobs: working-directory: checks/uefi run: | set +e - mcpp run --release --target x86_64-uefi -- one "two three" | tee run.log + mcpp run --release --target x86_64-uefi -- one "two three" "a b" | tee run.log status=${PIPESTATUS[0]} set -e - grep -q 'uefi ok: \[1, 2, 3\] \["one", "two three"\]' run.log || { echo "::error::the application's output or arguments"; exit 1; } + grep -q 'uefi ok: \[1, 2, 3\] \["one", "two three", "a b"\]' run.log || { echo "::error::the application's output or arguments"; 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" @@ -465,11 +465,24 @@ jobs: status=${PIPESTATUS[0]} set -e grep -q 'dos ok: \["one", "two"\]' run.log && grep -q 'caught: across a frame' run.log \ + && grep -q 'deep: 2080' 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 p=$(find target/i686-dos-musl -path '*bin/dos.exe' -type f | head -1) file "$p" + # The row's stack (0.29.1): the executable after the stub states 1 MiB in PT_GNU_STACK. + python3 - "$p" <<'PY' + import struct, sys + data = open(sys.argv[1], "rb").read() + at = data.find(b"\x7fELF\x01\x01") + phoff, = struct.unpack_from("(n); + return n == 0 ? frame[0] : deep(n - 1) + frame[0]; +} + int main(int argc, char** argv) { std::vector v(argv + 1, argv + argc); std::ranges::sort(v); @@ -8,5 +16,6 @@ int main(int argc, char** argv) { try { throw std::runtime_error("across a frame"); } catch (const std::exception& e) { std::println("caught: {}", e.what()); } std::println("PATH set: {}", std::getenv("PATH") != nullptr); + std::println("deep: {}", deep(64)); return 7; } diff --git a/checks/uefi/src/main.cpp b/checks/uefi/src/main.cpp index 5c2801c..a1b5993 100644 --- a/checks/uefi/src/main.cpp +++ b/checks/uefi/src/main.cpp @@ -1,6 +1,7 @@ // The C++ a UEFI application is written in: the standard library's text, ranges and containers // over openkal-musl and openkal-llvm-runtime, its arguments as the runner passed them (0.29.0: the -// Shell's, an argument with a space whole), and its status returned to the machine that ran it. +// Shell's, an argument with a space whole; 0.29.1: runs of blanks inside one kept), and its status +// returned to the machine that ran it. import std; int main(int argc, char** argv) { diff --git a/mcpp.toml b/mcpp.toml index 00ba205..e59e9d6 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -12,7 +12,7 @@ [package] namespace = "mcpplibs" name = "openkal-platform" -version = "0.29.0" +version = "0.29.1" 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"] @@ -82,7 +82,7 @@ okld = "openkal-tools@0.6.4" okrun = "openkal-tools@0.6.4" okprof = "openkal-tools@0.6.4" # The seal of the DOS row (0.28.0): the stub of openkal-dos before an executable. -okdos = "openkal-dos-tools@0.1.0" +okdos = "openkal-dos-tools@0.1.1" # Every unit of an image (SPEC 12.2): # -fPIC the image is ET_DYN and has no text relocation; @@ -239,7 +239,7 @@ hosted = true base = "none" toolchain = "llvm@23.1.3" layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.8", 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.5.0", "xim:freebsd-disk-image@14.5", "xim:qemu-x86@9.2.4-1"], enabled = false } +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", "xim:qemu-x86@9.2.4-1"], enabled = false } [[platform.provider]] name = "freebsd-vm" @@ -248,7 +248,7 @@ hosted = true base = "none" toolchain = "llvm@23.1.3" layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.8", 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.5.0", "xim:aarch64-freebsd-disk-image@14.5", "xim:ovmf@9.2.4-3", "xim:qemu-system@9.2.4"], enabled = false } +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", "xim:ovmf@9.2.4-4", "xim:qemu-system@9.2.4"], enabled = false } [[platform.provider]] name = "wine" @@ -293,7 +293,7 @@ hosted = true layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.8", 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.5.0", "xim:qemu-x86@9.2.4-1", "xim:ovmf@9.2.4-3"], enabled = false } +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 } # DOS (0.28.0; TECHNICAL EXPERIMENT ONLY, openkal-dos's README): programs a DPMI # host runs, on the same C library and C++ run-time over openkal-dos @@ -309,7 +309,10 @@ runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:ovmf}/dirun.tom # them. The processor is the 486, as for the i386 ok image (DOSBox Staging 0.83 # executes no CMPXCHG8B, measured). The runner is dirun with DOSBox Staging and CWSDPMI beside the program # (xim's `dosbox-staging'). The memory allocator is musl's own (`malloc-mallocng'): -# it asks openkal.memory for blocks and nothing else. +# it asks openkal.memory for blocks and nothing else. The stack (0.29.1) is the +# executable's own statement, PT_GNU_STACK's size, which openkal-dos 0.1.1's stub +# reads and places above a guard page: the row states 1 MiB (`-z stack-size'), +# and a project's own link flags state another. [[platform.define]] triple = "i686-dos-musl" clang-triple = "i386-unknown-none-elf" @@ -328,8 +331,8 @@ base = "none" hosted = true layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.8", default-features = false, features = ["posix", "malloc-mallocng"] } } -link = { driver = "lld", start = "okdos_entry", flags = ["-static", "--image-base=0x1000", "-z", "norelro", "--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.5.0", "xim:dosbox-staging@0.83.0-2"], enabled = false } +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 } # The family released together for openkal 0.17 (the 0.17.2 round: okb, the # runner's bundle and library interfaces, musl's renameat2; the 0.17.3 round: @@ -390,7 +393,9 @@ runner = { cmd = ["dirun", "--payload", "{}", "--profile", "{pkg:dosbox-staging} # 0.29.7 (`uname' names the system a hosted program runs on); 0.29.0, openkal-uefi # 0.11.0 (openkal.fs over the firmware's file system, openkal.random over its RNG # protocol, the Shell's arguments) beneath openkal-musl 0.29.8, which admits it: -# one version of each in a build. From 0.24.1 the members name one another by +# one version of each in a build; 0.29.1, openkal-uefi 0.11.1 (the Shell's arguments +# divided from the load options, so whitespace inside a quoted one arrives whole) +# and openkal-dos 0.1.1 (the stack from PT_GNU_STACK above a guard page). 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 index change @@ -401,9 +406,9 @@ openkal-linux = "0.26.3" openkal-macos = "0.23.4" openkal-windows = "0.21.2" openkal-freebsd = "0.1.2" -openkal-uefi = "0.11.0" -openkal-dos = "0.1.0" -openkal-dos-tools = "0.1.0" +openkal-uefi = "0.11.1" +openkal-dos = "0.1.1" +openkal-dos-tools = "0.1.1" openkal-musl = "0.29.8" openkal-llvm-runtime = "0.20.3" openkal-ld = "0.6.4" @@ -416,4 +421,4 @@ openkal-tools = "0.6.4" openkal-tools = { version = "0.6.4", tools = ["okld"] } [build-dependencies.mcpp] -plugins = { version = "0.20.0", features = ["plugins-platform"], host-module = true } +plugins = { version = "0.22.0", features = ["plugins-platform"], host-module = true } From e1aebe2741a0d40ddc7e8ee074409e225726cf9d Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Tue, 17 Nov 2026 05:23:49 +0900 Subject: [PATCH 2/3] mcpp.plugins 0.22.1, whose mcpplibs.os accepts openkal 0.25 --- mcpp.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcpp.toml b/mcpp.toml index e59e9d6..3ad9df6 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -421,4 +421,4 @@ openkal-tools = "0.6.4" openkal-tools = { version = "0.6.4", tools = ["okld"] } [build-dependencies.mcpp] -plugins = { version = "0.22.0", features = ["plugins-platform"], host-module = true } +plugins = { version = "0.22.1", features = ["plugins-platform"], host-module = true } From 514c715def811193ac18f60359dfa2be45cb5bab Mon Sep 17 00:00:00 2001 From: Sunrisepeak Date: Tue, 17 Nov 2026 06:16:48 +0900 Subject: [PATCH 3/3] FreeBSD runners: the disk images 14.5-1, whose profile runs the command where a run's files are --- README.md | 4 +++- mcpp.toml | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index da31957..d759987 100644 --- a/README.md +++ b/README.md @@ -168,7 +168,9 @@ arguments, caught its exception, read DOS's `PATH` and returned 7. Platform 0.29.0 and 0.29.1 require mcpp 2026.11.16.1. Every runner here that boots a machine is enabled on request: the UEFI row's (QEMU and OVMF), the DOS row's (DOSBox Staging), and, new, the hosted rows' runners on another system. FreeBSD -programs run in the FreeBSD virtual machine of xim's disk image packages, and +programs run in the FreeBSD virtual machine of xim's disk image packages (0.29.1: +`freebsd-disk-image` 14.5-1, whose profile runs the command in the directory of +the files a run delivers, `mcpp run --file`), and an `x86_64-windows-musl` program runs through Wine on an x86_64 Linux machine. Each fetches a machine image or an emulator, or makes a prefix in the home directory, on its first use, so `mcpp run` names the runner and how to enable it diff --git a/mcpp.toml b/mcpp.toml index 3ad9df6..93c4894 100644 --- a/mcpp.toml +++ b/mcpp.toml @@ -239,7 +239,7 @@ hosted = true base = "none" toolchain = "llvm@23.1.3" layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.8", 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", "xim:qemu-x86@9.2.4-1"], enabled = false } +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]] name = "freebsd-vm" @@ -248,7 +248,7 @@ hosted = true base = "none" toolchain = "llvm@23.1.3" layers = { compiler-runtime = "openkal-llvm-runtime@0.20.3", "c++-abi" = "openkal-llvm-runtime@0.20.3", c-abi = { name = "openkal-musl", version = "0.29.8", 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", "xim:ovmf@9.2.4-4", "xim:qemu-system@9.2.4"], enabled = false } +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]] name = "wine"