Commit Graph
35 Commits
Author SHA1 Message Date
daniel edc3452d61 feat: real stat metadata across all filesystems, plus mkdir and rmdir 2026-08-04 13:03:08 +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
danielandClaude Fable 5 54c0584b85 refactor: move the native devkit from 0:/usr to 0:/sdk (Montauk SDK)
0:/usr was a Unix transplant in an otherwise Montauk-native layout.
The SDK now lives at 0:/sdk/{bin,include,lib} (+ ldscripts under
0:/sdk/x86_64-montauk): Montauk-flavored, and a clean unit for a
future per-component installer tickbox. Native binutils is rebuilt
with --prefix=/sdk so ld's compiled-in search paths follow; future
ports configure with --prefix=/sdk.

Also add pathconf() with _PC_* names to the libc: now that realpath
exists, libiberty's lrealpath.c compiles its pathconf fallback path
unconditionally.

Shell command resolution and tab completion updated to 0:/sdk/bin.
Boot-verified in QEMU: setup, login, desktop on the new image with
zero usr/ remnants in the ramdisk.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-15 09:11:05 +02:00
danielandClaude Fable 5 fe040f8fea feat: ship native dev tools and target sysroot at 0:/usr
The devkit target in programs/GNUmakefile stages the native binutils
(as, ld, ar, nm, objcopy, objdump, readelf, ranlib, strip, size,
strings, addr2line, c++filt, elfedit as *.elf) into the image at
0:/usr/bin, plus a target-side sysroot: libc headers, montauk/ and
Api/ SDK headers and the freestanding C++ set at 0:/usr/include, and
libc.a + crt1/crti/crtn objects (with empty libm/libstdc++ stand-ins)
at 0:/usr/lib. ld's ldscripts ship under 0:/usr/x86_64-montauk.

The /usr prefix matches the binutils configure prefix, and the kernel
already resolves driveless absolute paths against the cwd drive, so
compiled-in /usr/lib search paths work natively on drive 0.

The shell resolves commands from 0:/usr/bin (after 0:/os) and tab
completion lists it. When toolchain/native/ has not been built, the
devkit step skips cleanly and the image builds as before.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-14 20:53:57 +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 233dbd3fdb fix: fix off-by-one in tabcompletion module 2026-06-18 12:21:19 +02:00
daniel a8d706a0d9 cleanup: const and type hygeine in tabcompletion module 2026-06-18 12:20:25 +02:00
daniel 3f91e85a3f fix: fix underflow in tabcompletion module 2026-06-18 12:12:51 +02:00
daniel cb1eb908aa feat: complete command completion in shell 2026-06-18 07:56:00 +02:00
daniel 36b03f070d feat: add cwd file matching to shell tab completion 2026-06-17 07:58:41 +02:00
daniel 6d6a41e366 feat: add support for shell builtins to command completion 2026-06-16 18:41:56 +02:00
daniel dea5d1ca59 fix: ensure tab completion is not reliant on single-digit volume number 2026-06-16 14:54:49 +02:00
daniel 21d6fbca95 fix: shell tab completion - ensure loop continues if file with non-.elf extension is encountered 2026-06-16 14:37:58 +02:00
daniel 29c131f65b feat: add rudimentary tab completion for executables to shell 2026-06-16 14:02:46 +02:00
daniel 43d43ac9ea cleanup: namespace Montauk (capital M) => montauk::abi 2026-06-16 09:09:16 +02:00
daniel 472c36e992 fix: adjust copyright messages for accuracy to license 2026-06-07 09:34:30 +02:00
daniel 0d61c0df61 feat: update copyright messages 2026-05-19 20:57:31 +02:00
daniel f9df9eba4d fix: fixes for shell/Terminal issues and CPU burn 2026-05-06 22:04:57 +02:00
daniel af48ab0e1e feat: kernel network statistics reporting, new Network configuration applet 2026-05-03 10:45:33 +02:00
daniel 5b4fb19a6e fix: remove doom/elf message from CLI help command 2026-04-09 07:49:19 +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 6e471c2eb4 fix: fix SYS_GETUSER missing in syscall switch, use getuser in shell username print 2026-03-24 17:34:07 +01:00
daniel 1a9fc0724c feat: Intel GPU fixes, add tcc compiler, spreadsheet improvements, paint app, file manager improvements 2026-03-21 17:35:16 +01:00
daniel 39b0424085 feat: multi-user system, bug fixes, security & performance fixes, and more 2026-03-14 13:28:46 +01:00
daniel b540a43f39 feat: GPT, FAT32 driver, disks app, userspace adapted for multiple drives, and more 2026-03-07 15:58:27 +01:00
daniel 4ac904e565 feat: rename 'ZenithOS' => 'MontaukOS' and fix build system issues 2026-02-28 12:06:18 +01:00
daniel 47c6bdfa94 fix: Fix some shell weirdness 2026-02-19 23:15:08 +01:00
daniel 9ca51596ea feat: userspace overhaul, Intel GPU driver, and more 2026-02-19 15:46:49 +01:00
daniel 010783429c feat: e100e Ethernet driver, ramdisk reorganization, shell rewrite, web server/client, and more 2026-02-19 01:18:11 +01:00
daniel 52c3cacd9e feat: Sockets, user-mode networking, IRC client application 2026-02-18 18:35:34 +01:00
daniel bae28e8188 feat: add time syscall & command in shell 2026-02-18 17:34:36 +01:00
daniel d0e1542a93 fix: remove kernel mouse cursor demo, +add two future-implemented syscalls for shutdown & reset 2026-02-18 16:52:44 +01:00
daniel 023004dc9c feat(programs/shell): Shell improvements (inc. cwd support) 2026-02-18 15:21:06 +01:00
daniel fb8d16ee7b feat: expand user mode, add DOOM game, add manpages 2026-02-18 15:13:53 +01:00
daniel f384d4cf75 feat: scheduling, usermode, shell 2026-02-17 19:17:01 +01:00