Architectural Support: x86_64 (#37)
[lunaix-os.git] / lunaix-os / usr / libc / arch / i386 / crt0.S
index a449ac3547829fe84bede17edb319e43eb920c7f..1418068d4a32aceb63be88dc0383905bc727a1cc 100644 (file)
@@ -9,9 +9,17 @@
 .section .text
     .global _start
     _start:      
-        xorl %eax, %eax
         xorl %ebp, %ebp
+        movl %esp, %eax
+        andl $-16, %esp
+        
+        leal 4(%eax), %ebx
+        pushl %ebx
+        pushl (%eax)
+
         fninit
+
+        xorl %eax, %eax
         call main
         
     1: