Subversion Repositories Kolibri OS

Rev

Rev 4 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 5
Line 61... Line 61...
61
;  eax - pointer to filename
61
;  eax - pointer to filename
62
;  ebx - parameters to pass
62
;  ebx - parameters to pass
63
;result:
63
;result:
64
;  eax - pid of new process
64
;  eax - pid of new process
65
;        or 0 if call fails.
65
;        or 0 if call fails.
-
 
66
    mov    [appl_path],edi
66
    pushad
67
    pushad
67
    mov    esi,new_process_loading
68
    mov    esi,new_process_loading
68
    call   sys_msg_board_str     ;write to debug board
69
    call   sys_msg_board_str     ;write to debug board
Line 69... Line 70...
69
    
70
    
Line 93... Line 94...
93
    xor    eax,eax
94
    xor    eax,eax
94
    cld
95
    cld
95
    rep    stosd                 ;clean extended information about process
96
    rep    stosd                 ;clean extended information about process
Line 96... Line 97...
96
    
97
    
-
 
98
;set new process name
-
 
99
    xor    eax,eax
97
;set new process name
100
    mov    [appl_path_size],eax
98
    mov    eax,[esp+8]
101
    mov    eax,[esp]  ;+8]
99
.find_last_byte:
102
.find_last_byte:
100
    cmp    byte [eax],0    
103
    cmp    byte [eax],0    
101
    jz     .find_last_byte_end
104
    jz     .find_last_byte_end
-
 
105
    inc    eax
102
    inc    eax
106
    inc    [appl_path_size]
103
    jmp    .find_last_byte
107
    jmp    .find_last_byte
-
 
108
.find_last_byte_end:
104
.find_last_byte_end:    
109
    add    [appl_path_size],24    
105
    sub    eax,11                ;last 11 bytes = application name
110
    sub    eax,11                ;last 11 bytes = application name
106
;    mov    eax,[esp]             ;eax - pointer to file name
111
;    mov    eax,[esp]             ;eax - pointer to file name
107
    mov    ebx,[new_process_place]
112
    mov    ebx,[new_process_place]
108
    shl    ebx,8
113
    shl    ebx,8
Line 215... Line 220...
215
;  eax - pointer to filename
220
;  eax - pointer to filename
216
;  ebx - parameters to pass
221
;  ebx - parameters to pass
217
;result:
222
;result:
218
;  eax - pid of new process
223
;  eax - pid of new process
219
;        or 0 if call fails.
224
;        or 0 if call fails.
-
 
225
    mov    [appl_path],edi
-
 
226
    mov    [appl_path_size],36
220
    pushad
227
    pushad
221
    mov    esi,new_process_loading
228
    mov    esi,new_process_loading
222
    call   sys_msg_board_str     ;write to debug board
229
    call   sys_msg_board_str     ;write to debug board
Line 223... Line 230...
223
    
230
    
Line 404... Line 411...
404
    mov    ebx,eax               ;ebx - address of parameters in our address space
411
    mov    ebx,eax               ;ebx - address of parameters in our address space
405
    mov    eax,[new_process_place]
412
    mov    eax,[new_process_place]
406
    call   write_process_memory  ;copy parameters to new process address space
413
    call   write_process_memory  ;copy parameters to new process address space
Line 407... Line 414...
407
    
414
    
-
 
415
.no_command_line:
-
 
416
;******************************************************************
-
 
417
    mov    edx,[app_i_icon]
-
 
418
    test   edx,edx
-
 
419
    jz     .no_command_line_1      ;application don't need path of file
-
 
420
    mov    ebx,[appl_path]
-
 
421
    mov    ecx,[appl_path_size]
-
 
422
    mov    eax,[new_process_place]
-
 
423
    call   write_process_memory  ;copy path of file to new process address space
-
 
424
.no_command_line_1:
408
.no_command_line:
425
;******************************************************************
409
    mov    ebx,[new_process_place]
426
    mov    ebx,[new_process_place]
410
    mov    eax,ebx
427
    mov    eax,ebx
411
    shl    ebx,5
428
    shl    ebx,5
412
    add    ebx,0x3000            ;ebx - pointer to information about process
429
    add    ebx,0x3000            ;ebx - pointer to information about process
Line 1128... Line 1145...
1128
new_start_application_hd:
1145
new_start_application_hd:
1129
;eax - file name (kernel address)
1146
;eax - file name (kernel address)
1130
;ebx - file name length
1147
;ebx - file name length
1131
;ecx - work area (kernel address)
1148
;ecx - work area (kernel address)
1132
;ebp - parameters
1149
;ebp - parameters
-
 
1150
    mov    [appl_path],edi
1133
    pushad
1151
    pushad
Line 1134... Line 1152...
1134
    
1152
    
1135
    mov    esi,new_process_loading
1153
    mov    esi,new_process_loading
Line 1154... Line 1172...
1154
    sti
1172
    sti
1155
    test   eax,eax
1173
    test   eax,eax
1156
    jz     .failed
1174
    jz     .failed
Line 1157... Line 1175...
1157
    
1175
    
-
 
1176
;write application name
-
 
1177
    xor    eax,eax
1158
;write application name    
1178
    mov    [appl_path_size],eax    
1159
    mov    eax,[esp+4]
1179
    mov    eax,[esp+4]
1160
.find_last_byte:
1180
.find_last_byte:
1161
    cmp    byte [eax],0    
1181
    cmp    byte [eax],0    
1162
    jz     .find_last_byte_end
1182
    jz     .find_last_byte_end
-
 
1183
    inc    eax
1163
    inc    eax
1184
    inc    [appl_path_size]
1164
    jmp    .find_last_byte
1185
    jmp    .find_last_byte
-
 
1186
.find_last_byte_end:
1165
.find_last_byte_end:    
1187
    add    [appl_path_size],24    
1166
    lea    esi,[eax-11]          ;last 11 bytes = application name
1188
    lea    esi,[eax-11]          ;last 11 bytes = application name
1167
    mov    edi,[new_process_place]
1189
    mov    edi,[new_process_place]
1168
    shl    edi,8
1190
    shl    edi,8
1169
    add    edi,0x80000
1191
    add    edi,0x80000