git.cappig.dev / apheleiaOS.git master

2ddfa3fcdf4df10e3f725303e5a209ea08bbeaac master
cappig <[email protected]> ยท 4 months ago
Add mount/umount syscalls and harden VFS/boot paths

* Add SYS_MOUNT/SYS_UMOUNT handling with root-only checks, ext2 gating, path/type validation, and a guard against unmounting '/'.

* Expose mount/umount in libc (syscall numbers, headers, wrappers) and add userland mount/umount commands.

* Split VFS child insertion into persistent vs virtual flows (vfs_create_virtual/vfs_insert_child_virtual) and use virtual creation for ext2/devfs synthetic nodes.

* Harden e820 map mutation with overflow-safe region tops, bounds checks, and fallible mmap_add_entry() handling.

* Tighten BIOS long-mode bring-up by mapping against full map top and fixing jump64 GDT descriptor alignment/limits.
15 files changed, 388 insertions, 25 deletions
kernel/arch/x86/boot/bios/elf.c +3 -4
kernel/arch/x86/boot/bios/jump64.asm +5 -6
kernel/arch/x86/e820.c +37 -8
kernel/arch/x86/e820.h +1 -1
kernel/fs/ext2fs.c +1 -1
kernel/sys/devfs.c +3 -3
kernel/sys/syscall.c +145 -0
kernel/sys/vfs.c +33 -2
kernel/sys/vfs.h +2 -0
libs/apheleia/syscall.h +2 -0
libs/libc/sys/mount.h created
libs/libc_usr/unistd.c +26 -0
libs/libc_usr/unistd.h +7 -0
user/mount/main.c created
user/umount/main.c created