X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/04ee277abd77fc51c5ab02ee58790a859607ea24..b1644f824d7f4989a94b8a752aadee26cae25069:/lunaix-os/usr/libc/arch/i386/crt0.S diff --git a/lunaix-os/usr/libc/arch/i386/crt0.S b/lunaix-os/usr/libc/arch/i386/crt0.S index eec9ee9..49fbcb7 100644 --- a/lunaix-os/usr/libc/arch/i386/crt0.S +++ b/lunaix-os/usr/libc/arch/i386/crt0.S @@ -8,14 +8,23 @@ .section .text .global _start - _start: - xorl %eax, %eax + _start: + xorl %ebp, %ebp + movl %esp, %eax + andl $-16, %esp + + leal 4(%eax), %ebx + pushl %ebx + pushl (%eax) + fninit + + xorl %eax, %eax call main 1: movl %eax, %ebx - movl $__SYSCALL__exit, %eax + movl $__NR__lxsys_exit, %eax int $33 ud2 // should not reach \ No newline at end of file