Repository navigation
os 0.2.1
- The ok-image targets take their C library, C++ run-time and loader from
their platform.[target.'cfg(os = "openkal")']no longer declares
openkal-llvm-runtime or openkal-tools: mcpp 2026.10.27.1 selects
openkal-platform for<arch>-openkal(mcpp SPEC-013). CI finds the runner
throughmcpp toolchain install --targetandmcpp self env --target.
The package builds and its tests pass in every arrangement of the program's C
library on Linux, macOS and Windows: the system's own (glibc, libSystem, the
Microsoft C runtime), and a C library that sits on openkal (openkal-musl with
openkal-llvm-runtime, mcpp docs/24) on the system's own triple. Under the
second, a C library presents POSIX and openkal, not the system: its headers are
not the SDK's, on Windows its data model is LP64 and its wchar_t 32 bits, and
its descriptors, signals, uname, sysinfo and syscall are its own.
- The units beside openkal reach each system through that system's stable
interface, not through the C library.- Linux: the kernel's calls, one trap per architecture
(src/linux/kernel.h,src/linux/arch/). These cover the machine's name
and memory, a volume's kind and an exchange of two entries. In the second
arrangement the C library had answeredopenkalfor the machine, had no
sysinfo, and turnedrenameat2(RENAME_EXCHANGE)into a plain rename that
replaced the second entry. - macOS: the kernel's calls for a volume's kind and an exchange
(src/macos/kernel.h, as openkal-macos itself does), and the libSystem
names no C library defines for sysctl and the host's statistics
(src/macos/darwin.h). These are declared rather than included from the
SDK. A link whose libSystem is openkal-macos's stub binds them when the
program is loaded (-U). - Windows:
src/windows/win32.hdeclares DWORD as 32 bits and WCHAR as
UTF-16 (char16_t) under every C environment. Names reach the system as
UTF-8 converted to UTF-16, never throughpath::c_str()(R7). The
kernel32 names that openkal-windows does not itself call are found when
first called, so a toolchain without the system's import libraries links
the package.
- Linux: the kernel's calls, one trap per architecture
- The process's output and its ending for a closed reader are changed where
the process keeps them.- On Linux and macOS, the diversion of the standard output (
output_to_error),
the reset of SIGPIPE beforeexecandend_as_output_closeduse the
kernel's descriptors and dispositions (src/posix/kernel.h): what openkal's
standard output, the C library's and a started program all use. - On Windows the diversion moves the Microsoft C runtime's descriptor, as
before (src/windows/crt/stdio.cpp). For a C library on openkal it moves
that library's descriptor and the process's standard handle, each apart
(src/windows/posix/stdio.cpp). The manifest selects the form by
cfg(c-abi = "musl").
- On Linux and macOS, the diversion of the standard output (
checks/hostedbuilds the package's tests over openkal-musl and
openkal-llvm-runtime. CI runs them on Linux, macOS and Windows, beside the
native rows and the ok images. Locally, the native and hosted suites pass on
Linux x86_64 (gcc 16.1.0 and llvm 23.1.3, dev and release) and on aarch64
under qemu. The Windows and macOS builds are cross-linked from Linux.- What mcpp-language-server's operating-system layer carried (its
modules/osandmodules/platform, removed in its 0.0.18):process::run(options, bounds, input): a run with a hard bound, a grace
and a drain, and limits on what each output keeps. It reports a timeout,
an output a descendant held open, and an output it cut.process::threads(id): the threads of a program and the processor time of
each (Linux; none elsewhere).env::assignments(entries):NAME=valueentries as the overrides of a
started program's environment.fs::read(file, at_most): a bounded read,errc::too_largepast the
bound (new error condition).fs::canonical(name): the name a node is known by, with links followed
and, on Windows, short (8.3) components replaced by their long names.
- Tests:
platform_testasserts that Linux names the machine as the processor
the program runs on.fs_testasserts that a volume's kind is named.
process_testmakes a file executable withos::fs::set_executablerather
than withstd::filesystem::permissions, which a C library on openkal
refuses.process_testcovers the bounded run (a cut output, a hard bound,
an output held open), the threads of this program and environment entries;
fs_testcovers the bounded read and the canonical name.