forked from KolibriOS/kolibrios
Adding menuetlibc back to its place in /programs/develop/libraries
This version of menuetlibc was taken from revision 4743, right before I made any changes git-svn-id: svn://kolibrios.org@4973 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
56
programs/develop/libraries/menuetlibc/stub/crt0_elf.asm
Normal file
56
programs/develop/libraries/menuetlibc/stub/crt0_elf.asm
Normal file
@@ -0,0 +1,56 @@
|
||||
CATCH_NULL_CALL = 0
|
||||
|
||||
format ELF
|
||||
section '.text' executable
|
||||
public start
|
||||
EXTRN _edata
|
||||
EXTRN ___menuet__app_param_area
|
||||
EXTRN ___menuet__app_path_area
|
||||
EXTRN ___crt1_startup
|
||||
start:
|
||||
public ___menuet__app_header
|
||||
public ___menuet__memsize
|
||||
___menuet__app_header:
|
||||
db 'MENUET01'
|
||||
dd 0x01
|
||||
if CATCH_NULL_CALL
|
||||
dd do_start
|
||||
else
|
||||
dd ___crt1_startup
|
||||
end if
|
||||
dd _edata
|
||||
___menuet__memsize:
|
||||
dd 0x400000
|
||||
dd app_stack
|
||||
dd ___menuet__app_param_area
|
||||
dd ___menuet__app_path_area
|
||||
|
||||
if CATCH_NULL_CALL
|
||||
do_start:
|
||||
mov byte [0], 0xE9
|
||||
mov dword [1], _libc_null_call-5
|
||||
call ___crt1_startup
|
||||
; Handle exit if __crt1_startup returns (shouldn't happen)
|
||||
mov eax,-1
|
||||
int 0x40
|
||||
end if
|
||||
|
||||
if CATCH_NULL_CALL
|
||||
EXTRN ___libc_null_call
|
||||
|
||||
_libc_null_call:
|
||||
push eax
|
||||
push ebx
|
||||
push ecx
|
||||
push edx
|
||||
push esi
|
||||
push edi
|
||||
push ebp
|
||||
call ___libc_null_call
|
||||
mov eax,-1
|
||||
int 0x40
|
||||
end if
|
||||
|
||||
section '.bss' writeable
|
||||
rd 0x20000
|
||||
app_stack:
|
Reference in New Issue
Block a user