Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 132 → Rev 133

/kernel/branches/gfx_kernel/core/newproce.inc
138,8 → 138,7
jnz .cleanfailed
call get_app_params ;parse header fields
test esi, esi
jz .cleanfailed
jc .cleanfailed
mov eax,[new_process_place]
inc ecx ; -0x1E = no memory
177,6 → 176,7
mov edx,eax ;read file block to current page
mov eax,[esp+4] ;restore pointer to file name
mov ecx,8 ;number of blocks read
mov ebp,edx ;save buffer address for .endofimage
push ebx
mov edi,[esp+16]
; cli
184,17 → 184,33
;ebx=file size
; sti
pop ecx
add ecx,8
test eax,eax
jnz .endloop1 ;check io errors
mov eax,[app_i_end]
add eax,511
shr eax,9
cmp ecx,eax
jg .endofimage ;we have loaded whole program
add ebx,511
shr ebx,9
cmp ecx,ebx
jg .endloop1 ;if end of file?
mov ebx,ecx
test eax,eax
jnz .endloop1 ;check io errors
pop edx
add ebx,8 ;go to next page
add edx,4
jmp .loop1
.endofimage: ;set to zero memory at end of page
mov ecx,[app_i_end]
and ecx,4096-1
jz .endloop1
lea edi,[ebp+ecx]
neg ecx
add ecx,4096
xor eax,eax
cld
rep stosb
.endloop1:
add esp,8+4 ;pop linear address of page table entry and pointer to file name
call new_start_application_fl.add_app_parameters
303,8 → 319,7
jnz .cleanfailed
call get_app_params ;parse header fields
test esi,esi
jz .cleanfailed
jc .cleanfailed
mov eax,[new_process_place]
inc ecx ; -0x1E = no memory
342,6 → 357,7
mov edx,eax ;read file block to current page
mov eax,[esp+4] ;restore pointer to file name
mov ecx,8 ;number of blocks read
mov ebp,edx ;save buffer address for .endofimage
push ebx
cli
call fileread
348,17 → 364,33
;ebx=file size
call safe_sti
pop ecx
add ecx,8
test eax,eax
jnz .endloop1 ;check io errors
mov eax,[app_i_end]
add eax,511
shr eax,9
cmp ecx,eax
jg .endofimage ;we have loaded whole program
add ebx,511
shr ebx,9
cmp ecx,ebx
jg .endloop1 ;if end of file?
mov ebx,ecx
test eax,eax
jnz .endloop1 ;check io errors
pop edx
add ebx,8 ;go to next page
add edx,4
jmp .loop1
.endofimage: ;set to zero memory at end of page
mov ecx,[app_i_end]
and ecx,4096-1
jz .endloop1
lea edi,[ebp+ecx]
neg ecx
add ecx,4096
xor eax,eax
cld
rep stosb
.endloop1:
add esp,8 ;pop linear address of page table entry and pointer to file name
call .add_app_parameters
1267,8 → 1299,7
rep movsd ;copy first block to 0x90000 address for get_app_params function
call get_app_params
mov ecx, -0x1F ; not Menuet/Kolibri executable
test esi,esi
jz .cleanfailed
jc .cleanfailed
mov eax,[new_process_place]
inc ecx ; -0x1E = no memory
1502,8 → 1533,12
jnz .cleanfailed
call get_app_params
mov ecx, -0x1F
test esi, esi
jz .cleanfailed
jc .cleanfailed
; sanity check - because we will load all file,
; file size must be not greater than memory size
mov eax, [esp+8+36]
cmp [app_mem], eax
jb .cleanfailed
 
mov eax, [new_process_place]
inc ecx ; -0x1E = no memory
/kernel/branches/gfx_kernel/core/sys32.inc
614,6 → 614,12
mov [app_i_end],eax
mov eax,[0x90000+20]
mov [app_mem],eax
; \begin{diamond}[20.08.2006]
; sanity check (functions 19,58 load app_i_end bytes and that must
; fit in allocated memory to prevent kernel faults)
cmp eax,[app_i_end]
jb no_01_header
; \end{diamond}[20.08.2006]
shr eax,1
sub eax,0x10
mov [app_esp],eax
622,7 → 628,7
mov [app_i_icon],dword 0
 
pop eax
mov esi,1
clc
ret
 
no_00_header:
637,6 → 643,10
mov [app_i_end],eax
mov eax,[0x90000+20]
mov [app_mem],eax
; \begin{diamond}[20.08.2006]
cmp eax,[app_i_end]
jb no_01_header
; \end{diamond}[20.08.2006]
mov eax,[0x90000+24]
mov [app_esp],eax
mov eax,[0x90000+28]
645,13 → 655,13
mov [app_i_icon],eax
 
pop eax
mov esi,1
clc
ret
 
no_01_header:
 
pop eax
mov esi,0
stc
ret