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 dd ?
|
||||
file2 dd ?
|
||||
endl
|
||||
|
||||
lea eax, [attr]
|
||||
@ -531,7 +532,21 @@ proc load_file stdcall, file_name:dword
|
||||
stdcall read_file, [file_name], eax, dword 0, [file_size]
|
||||
cmp ebx, [file_size]
|
||||
jne .cleanup
|
||||
|
||||
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
|
||||
.cleanup:
|
||||
stdcall kernel_free, [file]
|
||||
|
@ -319,9 +319,9 @@ proc alloc_kernel_space stdcall, size:dword
|
||||
remove_from_list edi
|
||||
|
||||
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
|
||||
btr [mem_block_mask], ecx
|
||||
@@:
|
||||
|
@ -281,20 +281,19 @@ endp
|
||||
|
||||
align 4
|
||||
proc init_LFB
|
||||
|
||||
cmp dword [LFBAddress], -1
|
||||
jne @f
|
||||
|
||||
mov [0x2f0000+0x901c],byte 2
|
||||
stdcall kernel_alloc, 0x280000
|
||||
mov [LFBAddress], eax
|
||||
|
||||
ret
|
||||
@@:
|
||||
test [SCR_MODE],word 0100000000000000b
|
||||
jz @f
|
||||
call map_LFB
|
||||
jnz @f
|
||||
mov [0x2f0000+0x901c],byte 2
|
||||
ret
|
||||
@@:
|
||||
call map_LFB
|
||||
ret
|
||||
endp
|
||||
|
||||
@ -1073,6 +1072,9 @@ proc test_cpu
|
||||
endl
|
||||
|
||||
mov [cpu_type], 0
|
||||
xor eax, eax
|
||||
mov [cpu_caps], eax
|
||||
mov [cpu_caps+4], eax
|
||||
|
||||
pushfd
|
||||
pop eax
|
||||
@ -1163,6 +1165,9 @@ proc init_mtrr
|
||||
cmp [0x2f0000+0x901c],byte 2
|
||||
je .exit
|
||||
|
||||
bt [cpu_caps], CAPS_MTRR
|
||||
jnc .exit
|
||||
|
||||
mov eax, cr0
|
||||
or eax, 0x60000000 ;disable caching
|
||||
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
|
||||
|
||||
mov eax,[slot]
|
||||
bt [cpu_caps], CAPS_SSE
|
||||
bt [cpu_caps], CAPS_FXSR
|
||||
jnc .no_SSE
|
||||
shl eax, 8
|
||||
mov ebx, eax
|
||||
|
Loading…
Reference in New Issue
Block a user