feat: brk and sbrk (mmap based)
[lunaix-os.git] / lunaix-os / usr / uwrap.S
1 #define __ASM__
2 #include <lunaix/syscall.h>
3
4 .section .data
5     .global environ
6     environ:
7         .long 0
8
9 .section .text
10     .global _u_start
11     _u_start:
12         call usr_pre_init
13         jnz 1f
14
15         popl %eax
16
17         pushl (%eax)    // argc
18         pushl 4(%eax)   // argv
19         
20         xorl %eax, %eax
21         call main
22         
23     1:
24         movl %eax, %ebx
25         movl $__SYSCALL__exit, %eax
26         int $LUNAIX_SYS_CALL
27
28         ud2 // should not reach