BuildSystem: Move all userpace libraries under the userspace directory
As the number of libraries is increasing, root directory starts to expand. This adds better organization for libraries
This commit is contained in:
35
userspace/libraries/LibC/arch/x86_64/crt0.S
Normal file
35
userspace/libraries/LibC/arch/x86_64/crt0.S
Normal file
@@ -0,0 +1,35 @@
|
||||
.section .text
|
||||
|
||||
.global _start
|
||||
_start:
|
||||
pushq $0
|
||||
pushq %rdi
|
||||
pushq %rsi
|
||||
pushq %rdx
|
||||
|
||||
# STACK LAYOUT
|
||||
# null
|
||||
# argc
|
||||
# argv
|
||||
# envp
|
||||
|
||||
xorq %rbp, %rbp
|
||||
|
||||
# init libc
|
||||
movq 0(%rsp), %rdi
|
||||
call _init_libc
|
||||
|
||||
# call global constructors
|
||||
call _init
|
||||
|
||||
# call main
|
||||
movq 16(%rsp), %rdi
|
||||
movq 8(%rsp), %rsi
|
||||
movq 0(%rsp), %rdx
|
||||
call main
|
||||
|
||||
# call exit
|
||||
movq %rax, %rdi
|
||||
call exit
|
||||
|
||||
.size _start, . - _start
|
||||
Reference in New Issue
Block a user