small optimization. reduce code size

git-svn-id: svn://kolibrios.org@501 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2007-05-16 19:12:34 +00:00
parent fef3689506
commit 59eaa9f2bd
3 changed files with 126 additions and 95 deletions

View File

@ -83,14 +83,23 @@ szEXPORTS db 'EXPORTS',0
szIMPORTS db 'IMPORTS',0 szIMPORTS db 'IMPORTS',0
firstapp db '%sys%/LAUNCHER',0 firstapp db '%sys%/LAUNCHER',0
if 0
char dd 0,0,0 char dd 0,0,0
dd 2560 dd 2560
dd FONT_I dd FONT_I
db '%sys%/FONTS/CHAR.MT',0 db '%sys%/FONTS/CHAR.MT',0
char2 dd 0,0,0 char2 dd 0,0,0
dd 2560 dd 2560
dd FONT_II dd FONT_II
db '%sys%/FONTS/CHAR2.MT',0 db '%sys%/FONTS/CHAR2.MT',0
else
char db '%sys%/FONTS/CHAR.MT',0
char2 db '%sys%/FONTS/CHAR2.MT',0
end if
bootpath db '/KOLIBRI ' bootpath db '/KOLIBRI '

View File

@ -18,8 +18,10 @@ endl
mov esi,[sourc] mov esi,[sourc]
mov edi,ebp ; mov edi,ebp
add edi,tmpsrc-ebp ; add edi,tmpsrc-ebp
lea edi, [tmpsrc]
@@: @@:
lodsb lodsb
stosb stosb
@ -39,29 +41,35 @@ endl
xor eax,eax xor eax,eax
.loop: .loop:
push eax push eax
mov ebx,ebp ; mov ebx,ebp
add ebx,param-ebp ; add ebx,param-ebp
mov ecx,ebp ; mov ecx,ebp
add ecx,val-ebp ; add ecx,val-ebp
lea ebx, [param]
lea ecx, [val]
invoke ini.get_par,sect, ebx, ecx, eax invoke ini.get_par,sect, ebx, ecx, eax
mov bl,[param] mov bl,[param]
or bl,bl or bl,bl
jz .done jz .done
mov eax,ebp ; mov eax,ebp
add eax,tmpsrc-ebp ; add eax,tmpsrc-ebp
mov ebx,ebp ; mov ebx,ebp
add ebx,param-ebp ; add ebx,param-ebp
mov ecx,ebp ; mov ecx,ebp
add ecx,val-ebp ; add ecx,val-ebp
lea eax, [tmpsrc]
lea ebx, [param]
lea ecx, [val]
mov edx,[dest] mov edx,[dest]
stdcall full_file_name_parse, eax,edx,ebx,ecx stdcall full_file_name_parse, eax,edx,ebx,ecx
mov esi,[dest] mov esi,[dest]
mov edi,ebp ; mov edi,ebp
add edi,tmpsrc-ebp ; add edi,tmpsrc-ebp
lea edi, [tmpsrc]
@@: @@:
lodsb lodsb
stosb stosb
@ -76,8 +84,9 @@ endl
pop eax pop eax
full_file_name_exit: full_file_name_exit:
mov eax,ebp ; mov eax,ebp
add eax,tmpsrc-ebp ; add eax,tmpsrc-ebp
lea eax, [tmpsrc]
stdcall full_file_name_parse , eax , [dest], sysdir_ , sys_path stdcall full_file_name_parse , eax , [dest], sysdir_ , sys_path
popad popad
ret ret

View File

@ -552,27 +552,18 @@ no_lib_load:
; LOAD FONTS I and II ; LOAD FONTS I and II
; mov esi,char
; xor ebx,ebx
; mov ecx,2560
; mov edx,FONT_I
; call fs_RamdiskRead
; mov esi,char2 ; pushad
; xor ebx,ebx ; push eax
; mov ecx,2560;26000 ; mov eax,char
; mov edx,FONT_II ; call file_system_lfn
; call fs_RamdiskRead ; mov eax,char2
; call file_system_lfn
pushad ; pop eax
push eax ; popad
mov eax,char
call file_system_lfn
mov eax,char2
call file_system_lfn
pop eax
popad
stdcall read_file, char, FONT_I, 0, 2560
stdcall read_file, char2, FONT_II, 0, 2560
mov esi,boot_fonts mov esi,boot_fonts
call boot_log call boot_log
@ -657,10 +648,10 @@ no_lib_load:
mov esi,boot_setostask mov esi,boot_setostask
call boot_log call boot_log
mov eax, fpu_data xor eax, eax
mov dword [SLOT_BASE+APPDATA.fpu_state], eax mov dword [SLOT_BASE+APPDATA.fpu_state], fpu_data
mov dword [SLOT_BASE+APPDATA.fpu_handler], 0 mov dword [SLOT_BASE+APPDATA.fpu_handler], eax
mov dword [SLOT_BASE+APPDATA.sse_handler], 0 mov dword [SLOT_BASE+APPDATA.sse_handler], eax
; name for OS/IDLE process ; name for OS/IDLE process
@ -680,9 +671,8 @@ no_lib_load:
cld cld
rep movsd rep movsd
mov dword [SLOT_BASE+256+APPDATA.fpu_handler], 0 mov dword [SLOT_BASE+256+APPDATA.fpu_handler], eax
mov dword [SLOT_BASE+256+APPDATA.sse_handler], 0 mov dword [SLOT_BASE+256+APPDATA.sse_handler], eax
mov dword [SLOT_BASE+256+APPDATA.cursor], ebx
mov ebx, SLOT_BASE+256+APP_OBJ_OFFSET mov ebx, SLOT_BASE+256+APP_OBJ_OFFSET
mov dword [SLOT_BASE+256+APPDATA.fd_obj], ebx mov dword [SLOT_BASE+256+APPDATA.fd_obj], ebx
@ -766,17 +756,11 @@ no_lib_load:
; LOAD FIRST APPLICATION ; LOAD FIRST APPLICATION
cli cli
if 0
cmp byte [BOOT_VAR+0x9030],1 cmp byte [BOOT_VAR+0x9030],1
jne no_load_vrr_m jne no_load_vrr_m
; mov ebp, vrr_m
; xor ebx, ebx
; xor edx, edx
; call fs_execute
; cmp eax,2 ; if vrr_m app found (PID=2)
; je first_app_found
stdcall kernel_alloc, 0x100 stdcall kernel_alloc, 0x100
push eax push eax
mov ebx,eax mov ebx,eax
@ -790,18 +774,11 @@ no_lib_load:
push eax push eax
stdcall kernel_free, ebx stdcall kernel_free, ebx
pop eax pop eax
cmp eax,2 ; if vrr_m app found (PID=2) cmp eax,2 ; if vrr_m app found (PID=2)
je first_app_found je first_app_found
no_load_vrr_m: no_load_vrr_m:
; mov ebp, firstapp
; xor ebx, ebx
; xor edx, edx
; call fs_execute
; cmp eax,2 ; continue if a process has been loaded
; je first_app_found
; mov eax, 0xDEADBEEF ; otherwise halt
; hlt
stdcall kernel_alloc, 0x100 stdcall kernel_alloc, 0x100
push eax push eax
@ -820,8 +797,44 @@ no_load_vrr_m:
mov eax, 0xDEADBEEF ; otherwise halt mov eax, 0xDEADBEEF ; otherwise halt
hlt hlt
first_app_found:
else
sub esp, 0x100
cmp byte [BOOT_VAR+0x9030],1
jne no_load_vrr_m
mov ebp, esp
stdcall full_file_name,vrr_m,ebp
xor ebx, ebx
xor edx, edx
call fs_execute
cmp eax,2 ; if vrr_m app found (PID=2)
je first_app_found
no_load_vrr_m:
mov ebp, esp
stdcall full_file_name,firstapp,ebp
xor ebx, ebx
xor edx, edx
call fs_execute
cmp eax,2 ; continue if a process has been loaded
je first_app_found
mov eax, 0xDEADBEEF ; otherwise halt
hlt
first_app_found: first_app_found:
add esp, 0x100
end if
cli cli
;mov [TASK_COUNT],dword 2 ;mov [TASK_COUNT],dword 2