Work with small amount of physical memory corrected (bug #9, part 1)

git-svn-id: svn://kolibrios.org@1090 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2009-05-29 19:28:27 +00:00
parent 6c18c6d3a0
commit 0226898ca6
2 changed files with 6 additions and 12 deletions

View File

@ -138,8 +138,11 @@ proc init_kernel_heap
mov [ebx+list_bk], eax
mov [ebx+block_base], HEAP_BASE+4096*MEM_BLOCK_SIZE
mov ecx, [MEM_AMOUNT]
sub ecx, (HEAP_BASE - OS_BASE + 4096*MEM_BLOCK_SIZE)
mov ecx, [pg_data.kernel_pages]
shl ecx, 12
neg ecx
add ecx, [MEM_AMOUNT]
sub ecx, 4096*MEM_BLOCK_SIZE
mov [heap_size], ecx
mov [heap_free], ecx
mov [ebx+block_size], ecx

View File

@ -43,7 +43,6 @@ proc init_mem
mov [pg_data.mem_amount-OS_BASE], eax
shr eax, 12
mov edx, eax
mov [pg_data.pages_count-OS_BASE], eax
shr eax, 3
mov [pg_data.pagemap_size-OS_BASE], eax
@ -52,15 +51,7 @@ proc init_mem
and eax, not 4095
mov [tmp_page_tabs], eax
cmp edx, (OS_BASE/4096)
jbe @F
mov edx, (OS_BASE/4096)
jmp .set
@@:
cmp edx, (HEAP_MIN_SIZE/4096)
jae .set
mov edx, (HEAP_MIN_SIZE/4096)
.set:
mov edx, (((sys_pgmap-OS_BASE) + 0xFFFFFF) and not 0xFFFFFF) shr 12
mov [pg_data.kernel_pages-OS_BASE], edx
shr edx, 10
mov [pg_data.kernel_tables-OS_BASE], edx