git.cappig.dev / apheleiaOS.git master

86325ccf0ad9bd1a5a9069b8297ed144ae9e587b master
cappig <[email protected]> ยท 1 year ago
Fix exec, add printf, libc_usr work

* exec_elf should now work.. this patch partially reverts stuff done in
  8f6995e. This fixes a bug that almost made me gouge my eyes out
  - when .data sections got mapped the _entire_ section got zeroed out
    (not just the BSS part) thus making any static data NULL.
* This patch also adds the execve syscall (a very basic skeleton version)
* A bunch of fixes in libc_usr - the most notable being the addition of
  printf
* This commit is in quite rough shape.. a bunch of work still has to be done in
  order to make GCC compile the project without vomiting out a bunch of static analyzer warnings.
19 files changed, 282 insertions, 104 deletions
build/toolchain.mk +2 -1
kernel/drivers/ramdisk.c +1 -1
kernel/drivers/serial.c +0 -1
kernel/sched/exec.c +34 -13
kernel/sched/process.c +12 -19
kernel/sched/process.h +31 -7
kernel/sched/scheduler.c +1 -1
kernel/sched/syscall.c +41 -3
libs/aos/syscalls.h +3 -3
libs/libc_usr/crt0.asm +2 -0
libs/libc_usr/init.c created
libs/libc_usr/stdio.c +65 -0
libs/libc_usr/stdio.h +13 -0
libs/libc_usr/stdlib.c +34 -51
libs/libc_usr/stdlib.h +2 -0
user/init/build.mk +1 -1
user/init/main.c +13 -3
user/sh/build.mk created
user/sh/main.c created