Subversion Repositories Kolibri OS

Rev

Rev 4973 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4973 Rev 5098
1
CATCH_NULL_CALL = 0
1
CATCH_NULL_CALL = 0
2
 
2
 
3
format MS COFF
3
format MS COFF
4
section '.text' code readable executable
4
section '.text' code readable executable
5
public start
5
public start
6
;EXTRN _edata
6
;EXTRN _edata
7
EXTRN ___menuet__app_param_area
7
EXTRN ___menuet__app_param_area
8
EXTRN ___menuet__app_path_area
8
EXTRN ___menuet__app_path_area
9
EXTRN ___crt1_startup
9
EXTRN ___crt1_startup
-
 
10
EXTRN ___memsize
10
start:
11
start:
11
public ___menuet__app_header
12
public ___menuet__app_header
12
public ___menuet__memsize
13
public ___menuet__memsize
13
section '.A' code readable executable
14
section '.A' code readable executable
14
___menuet__app_header:
15
___menuet__app_header:
15
 db 'MENUET01'
16
 db 'MENUET01'
16
 dd 0x01
17
 dd 0x01
17
if CATCH_NULL_CALL
18
if CATCH_NULL_CALL
18
 dd do_start
19
 dd do_start
19
else
20
else
20
 dd ___crt1_startup
21
 dd ___crt1_startup
21
end if
22
end if
22
; dd _edata
23
; dd _edata
23
 dd 0
24
 dd 0
24
___menuet__memsize:
25
___menuet__memsize:
25
 dd 0x400000
26
 dd ___memsize
26
 dd app_stack
27
 dd app_stack
27
 dd ___menuet__app_param_area
28
 dd ___menuet__app_param_area
28
 dd ___menuet__app_path_area
29
 dd ___menuet__app_path_area
29
 
30
 
30
if CATCH_NULL_CALL
31
if CATCH_NULL_CALL
31
do_start:
32
do_start:
32
	mov	byte [0], 0xE9
33
	mov	byte [0], 0xE9
33
	mov	dword [1], _libc_null_call-5
34
	mov	dword [1], _libc_null_call-5
34
 call ___crt1_startup
35
 call ___crt1_startup
35
; Handle exit if __crt1_startup returns (shouldn't happen)
36
; Handle exit if __crt1_startup returns (shouldn't happen)
36
 mov eax,-1
37
 mov eax,-1
37
 int 0x40
38
 int 0x40
38
end if
39
end if
39
 
40
 
40
if CATCH_NULL_CALL
41
if CATCH_NULL_CALL
41
EXTRN ___libc_null_call
42
EXTRN ___libc_null_call
42
 
43
 
43
_libc_null_call:
44
_libc_null_call:
44
    push eax
45
    push eax
45
    push ebx
46
    push ebx
46
    push ecx
47
    push ecx
47
    push edx
48
    push edx
48
    push esi
49
    push esi
49
    push edi
50
    push edi
50
    push ebp
51
    push ebp
51
    call ___libc_null_call
52
    call ___libc_null_call
52
    mov eax,-1
53
    mov eax,-1
53
    int 0x40
54
    int 0x40
54
end if
55
end if
55
 
56
 
56
section '.bss' readable writeable
57
section '.bss' readable writeable
57
rd 0x20000
58
;rd 0x20000
-
 
59
rb 0x10000
58
app_stack:
60
app_stack: