git.cappig.dev / apheleiaOS.git master

be7b9c20b5e5e7e6a5a940d3a050d5319e6f67f2 master
cappig <[email protected]> ยท 4 months ago
libc standards reset and C89 math core

* Normalize libc headers to standards-first APIs and types; move syscall numbers into new <apheleia/syscall.h> and update kernel/userspace dispatch points accordingly
* Add missing baseline C headers and runtime pieces (locale C/POSIX support, setjmp, assert runtime, wide/char type stubs, stdio and dirent surface cleanup)
* Fix libc behavioral mismatches in ctype/string/qsort/printf+scanf/time paths and migrate libc_usr wrappers plus user tools to the new interfaces
* Replace arch-specific libc math plumbing with a single self-contained C89 math implementation and keep complex support explicitly disabled
* Clean up related build and userland integration paths (syscall numbering, sleep/nanosleep routing, account/proc helpers, and command-side API updates)
84 files changed, 2495 insertions, 488 deletions
kernel/arch/x86/boot/bios/tty.c +7 -3
kernel/arch/x86/boot/bios/tty.h +3 -3
kernel/arch/x86/build/build.mk +1 -0
kernel/sys/syscall.c +41 -9
libs/apheleia/syscall.h created
libs/libc/assert.h +7 -4
libs/libc/complex.h created
libs/libc/ctype.c +2 -2
libs/libc/dirent.h +28 -8
libs/libc/fcntl.h +14 -14
libs/libc/fenv.h created
libs/libc/float.h created
libs/libc/grp.h +9 -3
libs/libc/iso646.h created
libs/libc/locale.c created
libs/libc/locale.h created
libs/libc/math.c created
libs/libc/math.h created
libs/libc/poll.h +5 -1
libs/libc/pwd.h +11 -7
libs/libc/qsort.c +4 -0
libs/libc/setjmp.c created
libs/libc/setjmp.h created
libs/libc/shadow.h +14 -5
libs/libc/sprintf.c +14 -11
libs/libc/sscanf.c +1 -1
libs/libc/stdalign.h created
libs/libc/stdint.h +7 -1
libs/libc/stdio.h +48 -15
libs/libc/stdlib.h +1 -0
libs/libc/stdnoreturn.h created
libs/libc/string.c +5 -5
libs/libc/sys/fb.h +4 -0
libs/libc/sys/input.h +4 -0
libs/libc/sys/ioctl.h +5 -1
libs/libc/sys/proc.h +4 -0
libs/libc/sys/stat.h +9 -5
libs/libc/sys/types.h +5 -5
libs/libc/sys/wait.h +1 -0
libs/libc/sys/ws.h +4 -0
libs/libc/threads.h created
libs/libc/time.c +4 -4
libs/libc/time.h +11 -0
libs/libc/uchar.h created
libs/libc/unistd.h +3 -38
libs/libc/wchar.h created
libs/libc/wctype.h created
libs/libc_usr/assert.c created
libs/libc_usr/dirent.c +70 -1
libs/libc_usr/grp.c +89 -38
libs/libc_usr/grp.h +3 -1
libs/libc_usr/ioctl.c +1 -0
libs/libc_usr/mman.c +1 -0
libs/libc_usr/poll.c +1 -0
libs/libc_usr/pwd.c +154 -59
libs/libc_usr/pwd.h +12 -2
libs/libc_usr/shadow.c +94 -32
libs/libc_usr/shadow.h +3 -1
libs/libc_usr/signal.c +1 -0
libs/libc_usr/stat.c +4 -3
libs/libc_usr/stdio.c +401 -25
libs/libc_usr/stdlib.c +2 -1
libs/libc_usr/time.c +42 -45
libs/libc_usr/unistd.c +35 -10
libs/libc_usr/unistd.h +5 -4
libs/log/log.c +2 -2
libs/log/log.h +1 -1
libs/user/account.c +6 -8
makefile +1 -0
user/build.mk +10 -1
user/cat/main.c +2 -2
user/chmod/main.c +1 -1
user/fetch/main.c +6 -6
user/getty/main.c +3 -3
user/login/main.c +10 -10
user/ls/main.c +11 -21
user/mv/main.c +1 -1
user/ps/main.c +7 -8
user/rm/main.c +9 -11
user/sh/complete.c +24 -27
user/sh/main.c +13 -13
user/stat/main.c +1 -1
user/term/term_pty.c +3 -3
user/wm/wm_file.c +2 -2