forked from KolibriOS/kolibrios
1)fixed bug in kernel_alloc_space
2)support for loading compressed files git-svn-id: svn://kolibrios.org@211 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
fa83bf6c24
commit
763bc3ad70
@ -516,6 +516,7 @@ proc load_file stdcall, file_name:dword
|
|||||||
file_size dd ?
|
file_size dd ?
|
||||||
|
|
||||||
file dd ?
|
file dd ?
|
||||||
|
file2 dd ?
|
||||||
endl
|
endl
|
||||||
|
|
||||||
lea eax, [attr]
|
lea eax, [attr]
|
||||||
@ -531,7 +532,21 @@ proc load_file stdcall, file_name:dword
|
|||||||
stdcall read_file, [file_name], eax, dword 0, [file_size]
|
stdcall read_file, [file_name], eax, dword 0, [file_size]
|
||||||
cmp ebx, [file_size]
|
cmp ebx, [file_size]
|
||||||
jne .cleanup
|
jne .cleanup
|
||||||
|
|
||||||
mov eax, [file]
|
mov eax, [file]
|
||||||
|
cmp dword [eax], 0x4B43504B
|
||||||
|
jne .exit
|
||||||
|
|
||||||
|
stdcall kernel_alloc, [eax+4]
|
||||||
|
|
||||||
|
test eax, eax
|
||||||
|
jz .cleanup
|
||||||
|
|
||||||
|
mov [file2], eax
|
||||||
|
stdcall unpack, [file], eax
|
||||||
|
stdcall kernel_free, [file]
|
||||||
|
mov eax, [file2]
|
||||||
|
.exit:
|
||||||
ret
|
ret
|
||||||
.cleanup:
|
.cleanup:
|
||||||
stdcall kernel_free, [file]
|
stdcall kernel_free, [file]
|
||||||
|
@ -319,9 +319,9 @@ proc alloc_kernel_space stdcall, size:dword
|
|||||||
remove_from_list edi
|
remove_from_list edi
|
||||||
|
|
||||||
mov ecx, [block_ind]
|
mov ecx, [block_ind]
|
||||||
mov [mem_block_list+ecx*4], ebx
|
mov [mem_block_list+ecx*4], edx
|
||||||
|
|
||||||
test ebx, ebx
|
test edx, edx
|
||||||
jnz @f
|
jnz @f
|
||||||
btr [mem_block_mask], ecx
|
btr [mem_block_mask], ecx
|
||||||
@@:
|
@@:
|
||||||
|
@ -281,20 +281,19 @@ endp
|
|||||||
|
|
||||||
align 4
|
align 4
|
||||||
proc init_LFB
|
proc init_LFB
|
||||||
|
|
||||||
cmp dword [LFBAddress], -1
|
cmp dword [LFBAddress], -1
|
||||||
jne @f
|
jne @f
|
||||||
|
|
||||||
mov [0x2f0000+0x901c],byte 2
|
mov [0x2f0000+0x901c],byte 2
|
||||||
stdcall kernel_alloc, 0x280000
|
stdcall kernel_alloc, 0x280000
|
||||||
mov [LFBAddress], eax
|
mov [LFBAddress], eax
|
||||||
|
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
test [SCR_MODE],word 0100000000000000b
|
test [SCR_MODE],word 0100000000000000b
|
||||||
jz @f
|
jnz @f
|
||||||
call map_LFB
|
mov [0x2f0000+0x901c],byte 2
|
||||||
|
ret
|
||||||
@@:
|
@@:
|
||||||
|
call map_LFB
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
@ -1073,6 +1072,9 @@ proc test_cpu
|
|||||||
endl
|
endl
|
||||||
|
|
||||||
mov [cpu_type], 0
|
mov [cpu_type], 0
|
||||||
|
xor eax, eax
|
||||||
|
mov [cpu_caps], eax
|
||||||
|
mov [cpu_caps+4], eax
|
||||||
|
|
||||||
pushfd
|
pushfd
|
||||||
pop eax
|
pop eax
|
||||||
@ -1163,6 +1165,9 @@ proc init_mtrr
|
|||||||
cmp [0x2f0000+0x901c],byte 2
|
cmp [0x2f0000+0x901c],byte 2
|
||||||
je .exit
|
je .exit
|
||||||
|
|
||||||
|
bt [cpu_caps], CAPS_MTRR
|
||||||
|
jnc .exit
|
||||||
|
|
||||||
mov eax, cr0
|
mov eax, cr0
|
||||||
or eax, 0x60000000 ;disable caching
|
or eax, 0x60000000 ;disable caching
|
||||||
mov cr0, eax
|
mov cr0, eax
|
||||||
|
@ -605,7 +605,7 @@ proc add_app_parameters stdcall,slot:dword,img_base:dword,\
|
|||||||
cmd_line:dword, app_path:dword, flags:dword
|
cmd_line:dword, app_path:dword, flags:dword
|
||||||
|
|
||||||
mov eax,[slot]
|
mov eax,[slot]
|
||||||
bt [cpu_caps], CAPS_SSE
|
bt [cpu_caps], CAPS_FXSR
|
||||||
jnc .no_SSE
|
jnc .no_SSE
|
||||||
shl eax, 8
|
shl eax, 8
|
||||||
mov ebx, eax
|
mov ebx, eax
|
||||||
|
Loading…
Reference in New Issue
Block a user