Commit Graph
10 Commits
Author SHA1 Message Date
danielandClaude Fable 5 75184e0651 feat: process exit codes, posix_spawn, 4 KiB command lines
Groundwork for the GCC driver: a compiler driver must spawn cc1/as/ld
and know whether each stage succeeded.

Kernel: the scheduler keeps an exit-code ledger (pid -> code; pids are
monotonic so entries never alias), published during teardown right
before waiters wake. SYS_EXIT records main()'s return value, SYS_KILL
records 256+SIGKILL, and the exception handler records 256+signal
mapped from the fault vector (#PF/#GP -> SIGSEGV, #DE/FP -> SIGFPE,
#UD -> SIGILL). SYS_WAITPID now returns the code: 0..255 for a normal
exit, 256+signal for a violent death. Process args grow from 256
bytes to 4 KiB (cc1 invocations do not fit in 256), with crt1 now
parsing up to 255 argv entries from a static buffer.

libc: new spawn.h with posix_spawn/posix_spawnp over SYS_SPAWN -
libiberty's pex layer has a posix_spawn backend, so GCC's driver works
without fork. argv is joined into the kernel args string (spaces in
arguments rejected; no kernel quoting), envp is not transferred, and
non-empty file actions fail loudly with ENOTSUP until the kernel can
redirect stdio on spawn. waitpid() now decodes real POSIX status and
the sys/wait.h macros distinguish exited from signaled children.

Shell: prints [exit code N] after nonzero exits and [terminated by
signal N] for killed or crashed children.

Verified on the OS: cat on a missing file reports exit code 1; a
window-close (clean exit 0) stays silent as it should.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-16 16:59:17 +02:00
danielandClaude Fable 5 648f7111c0 feat: build userspace programs with the x86_64-montauk toolchain
Switch all program and library Makefiles from host g++ (or the
bare-metal x86_64-elf compiler) to x86_64-montauk-g++/gcc and drop the
flags the target now owns: -nostdinc + kernel freestanding -isystem
paths, -m64/-march, -fno-PIC, -mno-red-zone, -mcmodel=small, -static,
-Wl,-m,elf_x86_64, -z max-page-size, --build-id=none. Deliberate
policy flags stay (-ffreestanding, per-app SSE, -nostdlib + link.ld).

Program builds now require the montauk toolchain and fail with a
pointer to build-montauk-toolchain.sh; lib/ and libs/ keep the host
fallback since the toolchain script bootstraps libc through it.
Userspace is also now pinned to the cross GCC instead of drifting
with the distro compiler.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-14 10:19:35 +02:00
daniel d93e111783 feat: add proclist command, fix TLS bug, link libc for system programs 2026-06-19 12:03:12 +02:00
daniel 43d43ac9ea cleanup: namespace Montauk (capital M) => montauk::abi 2026-06-16 09:09:16 +02:00
daniel d00c0deaf2 feat: add build numbering 2026-05-30 10:22:40 +02:00
daniel e545321e07 fix: fix performance issue in Music app 2026-03-20 22:23:22 +01:00
daniel 7617419640 feat: MontaukOS installer app, toml config, app directory with manifests, and more 2026-03-08 12:06:29 +01:00
daniel e9f0b10cb9 fix: memory and other improvements 2026-03-06 22:09:11 +01:00
daniel 4ac904e565 feat: rename 'ZenithOS' => 'MontaukOS' and fix build system issues 2026-02-28 12:06:18 +01:00
daniel 4a1d62c337 feat: common TLS library, weather app, UI scaling fix in Window Server, and more 2026-02-21 13:06:53 +01:00