X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/32b9a6d76790c73d3d2d36d9081a2581cc65d184..28c176b668c841a3b7fb093faccf0efa39257603:/lunaix-os/usr/libc/arch/x86_64/crt0.S?ds=sidebyside diff --git a/lunaix-os/usr/libc/arch/x86_64/crt0.S b/lunaix-os/usr/libc/arch/x86_64/crt0.S new file mode 100644 index 0000000..25786df --- /dev/null +++ b/lunaix-os/usr/libc/arch/x86_64/crt0.S @@ -0,0 +1,27 @@ +#define __ASM__ +#include + +.section .data + .global environ + environ: + .long 0 + +.section .text + .global _start + _start: + xorq %rbp, %rbp + + movq %rsp, %rax + movq (%rax), %rdi + leaq 8(%rax), %rsi + + fninit + xorq %rax, %rax + call main + + 1: + movq %rax, %rbx + movq $__SYSCALL__exit, %rax + int $33 + + ud2 // should not reach \ No newline at end of file