toaruos/toolchain/patches/newlib/toaru/crti.s
Kevin Lange 5249138dcd Environment variables, integrated with newlib.
* Patched crt0 to support a pre_main
* pre_main sets up environment variables, can do other things later,
  but then just jumps to main with the same arguments.
* Updated a bunch of apps to pass environment variables around.
2012-10-08 00:17:50 -07:00

22 lines
488 B
ArmAsm

; ToAruOS User CRT0
BITS 32
global _start
_start: ; Global entry point
pop eax ; Our stack is slightly off
extern __do_global_ctors
call __do_global_ctors
extern pre_main ;
call pre_main ; call C main function
mov ebx, eax ; return value from main
mov eax, 0x0 ; sys_exit
int 0x7F ; syscall
_wait: ; wait until we've been deschuled
hlt
jmp _wait
; vim:syntax=nasm
; vim:noexpandtab
; vim:tabstop=4
; vim:shiftwidth=4