fixed kernel heap manager broken in rev. 1090

git-svn-id: svn://kolibrios.org@1130 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2009-07-25 13:12:11 +00:00
parent a0d587989d
commit c752107a02
2 changed files with 13 additions and 6 deletions

View File

@ -91,7 +91,7 @@ macro remove_from_used op
align 4
proc init_kernel_heap
mov ecx, 64/4
mov ecx, 64
mov edi, mem_block_list
xor eax, eax
cld
@ -140,9 +140,7 @@ proc init_kernel_heap
mov ecx, [pg_data.kernel_pages]
shl ecx, 12
neg ecx
add ecx, [MEM_AMOUNT]
sub ecx, 4096*MEM_BLOCK_SIZE
sub ecx, HEAP_BASE+4096*MEM_BLOCK_SIZE
mov [heap_size], ecx
mov [heap_free], ecx
mov [ebx+block_size], ecx
@ -155,7 +153,7 @@ proc init_kernel_heap
mov byte [mem_block_map], 0xFC
and [heap_mutex], 0
mov [heap_blocks], 4095
mov [free_blocks], 4095
mov [free_blocks], 4094
ret
endp

View File

@ -107,7 +107,16 @@ proc init_mem
and edx, not 4095
mov [tmp_page_tabs], edx
mov edx, (((sys_pgmap-OS_BASE) + 0xFFFFFF) and not 0xFFFFFF) shr 12
mov edx, esi
cmp edx, (OS_BASE/4096)
jbe @F
mov edx, (OS_BASE/4096)
jmp .set
@@:
cmp edx, (HEAP_BASE+HEAP_MIN_SIZE)/4096
jae .set
mov edx, (HEAP_BASE+HEAP_MIN_SIZE)/4096
.set:
mov [pg_data.kernel_pages-OS_BASE], edx
shr edx, 10
mov [pg_data.kernel_tables-OS_BASE], edx