Files
jsix/src/libraries/libc/arch/amd64/crt/crt0.s
Justin C. Miller 94b2a79f79 [kernel] Remove process & thread self-handles
For the coming switch to cap/handle ref-counting being the main lifetime
determiner of objects, get rid of self handles for threads and processes
to avoid circular references. Instead, passing 0 to syscalls expecting a
thread or process handle signifies "this process/thread".
2023-02-19 11:23:23 -08:00

26 lines
415 B
ArmAsm

extern main
extern exit
extern __init_libj6
extern __init_libc
global _start:function (_start.end - _start)
_start:
push 0 ; Add null frame
push 0
mov rbp, rsp
call __init_libj6
mov rbx, rax
call __init_libc
pop rdi
mov rsi, rsp
mov rdx, 0 ; TODO: actually parse stack for argc, argv, envp
mov rcx, rbx
call main
mov rdi, rax
call exit
.end: