Framework for exporting system header to user space (#59)
[lunaix-os.git] / lunaix-os / usr / libc / arch / i386 / crt0.S
index eec9ee9e0e435c00cee3ba94a1141c79fe1f9f23..49fbcb771026e35ff2f386df956563e1bab3ca7e 100644 (file)
@@ -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