]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fix: diskfs kfree-on-static-root, mount syscall, user addr space 8MiB->1GiB
authorTulio A M Mendes <[email protected]>
Tue, 17 Feb 2026 06:50:42 +0000 (03:50 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 17 Feb 2026 06:50:42 +0000 (03:50 -0300)
commita964ece8963eb0f419463f0dc53628665790baa9
treee935e65bd29da3513f9a438266775e141b8d1493
parent0a376df58757506dec6ac30eb1757484d7f1cc1b
fix: diskfs kfree-on-static-root, mount syscall, user addr space 8MiB->1GiB

Bug 1: ls /disk heap corruption — diskfs_close_impl called kfree on
static g_root BSS variable. Added guard: skip kfree when node == g_root.

Bug 2: mount command only displayed mounts. Added SYSCALL_MOUNT (126)
with support for tmpfs and disk-based filesystems (diskfs/fat/ext2/persistfs).
Updated userspace mount to call the syscall with device, mountpoint, and
-t fstype args.

Bug 3: doom 'Unable to allocate 5 MiB' — user address space was capped
at 8 MiB (USER_STACK_BASE=0x00800000). Raised to 1 GiB (0x40000000) in
elf.c, usermode.c, and syscall_brk_impl.
include/syscall.h
src/arch/x86/elf.c
src/arch/x86/usermode.c
src/kernel/diskfs.c
src/kernel/syscall.c
user/mount.c
user/ulibc/include/syscall.h