[kernel] Improve process init

Move process init from each process needing a main.s with _start to
crt0.s in libc. Also change to a sysv-like initial stack with a
j6-specific array of initialization values after the program arguments.
This commit is contained in:
2020-12-31 00:57:51 -08:00
committed by Justin C. Miller
parent a8024d3dd3
commit 7fcb4efab6
8 changed files with 148 additions and 71 deletions

View File

@@ -0,0 +1,19 @@
extern main
extern exit
extern _init_libc
global _start:function (_start.end - _start)
_start:
mov rbp, rsp
mov rdi, rsp
call _init_libc
pop rdi
mov rsi, rsp
call main
mov rdi, rax
call exit
.end: