feat: refine symbolic link support.
[lunaix-os.git] / lunaix-os / usr / uwrap.S
index 1cd6515c57182386b4309204b6394d94e844730d..c9e2bbc20aa9a43ec6c512b3c9d27e59563ca11c 100644 (file)
@@ -1,17 +1,23 @@
 #define __ASM__
 #include <lunaix/syscall.h>
 
 #define __ASM__
 #include <lunaix/syscall.h>
 
+.section .data
+    .global environ
+    environ:
+        .long 0
+
 .section .text
     .global _u_start
     _u_start:
 .section .text
     .global _u_start
     _u_start:
-        movl $2, %eax
+        movl (%esp), %eax
+        pushl %eax
         call usr_pre_init
         jnz 1f
 
         popl %eax
 
         call usr_pre_init
         jnz 1f
 
         popl %eax
 
-        pushl (%eax)    // argc
         pushl 4(%eax)   // argv
         pushl 4(%eax)   // argv
+        pushl (%eax)    // argc
         
         xorl %eax, %eax
         call main
         
         xorl %eax, %eax
         call main