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.
|
# Prepare signals, memory allocation, stdio and such.
|
||||||
pushq %rsi
|
pushq %rsi
|
||||||
pushq %rdi
|
pushq %rdi
|
||||||
|
pushq %rcx
|
||||||
call initialize_standard_library
|
call initialize_standard_library
|
||||||
|
|
||||||
# Run the global constructors.
|
# Run the global constructors.
|
||||||
call _init
|
call _init
|
||||||
|
|
||||||
# Run main
|
# Run main
|
||||||
|
popq %rdx # Note! envp is now %rdx (previously %rcx)
|
||||||
popq %rdi
|
popq %rdi
|
||||||
popq %rsi
|
popq %rsi
|
||||||
call main
|
call main
|
||||||
|
|
|
@ -37,6 +37,7 @@ _start:
|
||||||
movl %ecx, environ # envp
|
movl %ecx, environ # envp
|
||||||
|
|
||||||
# Arguments for main
|
# Arguments for main
|
||||||
|
push %ecx # envp
|
||||||
push %ebx # argv
|
push %ebx # argv
|
||||||
push %eax # argc
|
push %eax # argc
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue