mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Provide envp to the main function.
This commit is contained in:
parent
b8f85d9ef2
commit
d3b9bdb3ba
2 changed files with 3 additions and 0 deletions
|
@ -39,12 +39,14 @@ _start:
|
|||
# Prepare signals, memory allocation, stdio and such.
|
||||
pushq %rsi
|
||||
pushq %rdi
|
||||
pushq %rcx
|
||||
call initialize_standard_library
|
||||
|
||||
# Run the global constructors.
|
||||
call _init
|
||||
|
||||
# Run main
|
||||
popq %rdx # Note! envp is now %rdx (previously %rcx)
|
||||
popq %rdi
|
||||
popq %rsi
|
||||
call main
|
||||
|
|
|
@ -37,6 +37,7 @@ _start:
|
|||
movl %ecx, environ # envp
|
||||
|
||||
# Arguments for main
|
||||
push %ecx # envp
|
||||
push %ebx # argv
|
||||
push %eax # argc
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue