Commit Graph
16 Commits
Author SHA1 Message Date
danielandClaude Fable 5 78ce551688 fix: USTAR prefix-field parsing and directory-aware chdir
Two ramdisk fixes exposed by shipping the C++ header tree:

Paths longer than 100 characters (libstdc++'s pb_ds detail headers)
are split by USTAR across the name field and the 155-byte prefix
field at offset 345. The parser only read the name field, so the
tails of 7 deep header paths appeared as bogus root-level entries
while the real paths were missing. The parser now joins
prefix + '/' + name, and MaxNameLen grows to 260 to hold the full
combined path.

SYS_CHDIR validated non-root targets by opening them as files, which
only ever worked because directories used to be openable. It now uses
the ReadDir probe, which fails for nonexistent paths and regular
files on all backends (ext2/fat32 already validate the inode type).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-17 10:18:58 +02:00
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
daniel 43d43ac9ea cleanup: namespace Montauk (capital M) => montauk::abi 2026-06-16 09:09:16 +02:00
daniel 159fea1667 feat: add threading to Scheduler, fix desktop background selection freeze issue 2026-05-23 16:08:25 +02:00
daniel c20579afd3 feat: support for USB mass storage devices, hotplugging 2026-05-18 17:47:12 +02:00
daniel d04d7194b9 fix: add start pending mode to mitigate Terminal output redirection issue 2026-05-07 07:32:44 +02:00
daniel 017a8a28ac feat: graphing in MTK toolkit, kernel exposes CPU time, Processes app Performance tab 2026-05-02 15:26:59 +02:00
daniel fb9885819b feat: implement new IPC layer 2026-04-01 13:11:03 +02:00
daniel 1c0db774f6 feat: add cwd tracking to kernel, remove shell hack, update system utilities to use getcwd, fix tcc libc stub, fix nonexistent directory issue 2026-03-25 15:45:22 +01:00
daniel 58a144fc1a feat: ACPI parsing improvements, username in process struct + syscalls 2026-03-24 17:17:47 +01:00
daniel 9b4dfe3e0e fix: improve scheduling, memory, timer implementations 2026-03-24 07:40:37 +01:00
daniel 41ad1f6404 feat: Symmetric Multiprocessing, text editor improvements, merge doom libc, implement math functions 2026-03-23 20:09:11 +01:00
daniel d98be158c8 fix: fix memory leaks 2026-03-04 07:41:40 +01:00
daniel 4ac904e565 feat: rename 'ZenithOS' => 'MontaukOS' and fix build system issues 2026-02-28 12:06:18 +01:00
daniel 48bf14ee0e fix: continue fix page fault heap regression 2026-02-28 00:14:28 +01:00
daniel 1568378d04 feat: split syscalls into files, change max process ceiling 2026-02-22 17:23:35 +01:00