1) back to #1451 to save some phys. memory

2) non-PSE paging restored
3) documentation corrected

git-svn-id: svn://kolibrios.org@1455 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Artem Jerdev (art_zh) 2010-04-22 15:33:55 +00:00
parent e84fb6973a
commit 999126566d
2 changed files with 24 additions and 7 deletions

View File

@ -129,8 +129,8 @@ proc init_mem
rep stosd
mov edx, (sys_pgdir-OS_BASE)+ 0x800; (OS_BASE shr 20)
; bt [cpu_caps-OS_BASE], CAPS_PSE
; jnc .no_PSE
bt [cpu_caps-OS_BASE], CAPS_PSE
jnc .no_PSE
mov ebx, cr4
or ebx, CR4_PSE
@ -142,6 +142,20 @@ proc init_mem
add edx, 4
mov edi, [tmp_page_tabs]
jmp .map_kernel_heap ; new kernel fits to the first 4Mb - nothing to do with ".map_low"
.no_PSE:
mov eax, PG_SW
mov ecx, [tmp_page_tabs]
shr ecx, 12
.map_low:
mov edi, [tmp_page_tabs]
@@: ;
stosd
add eax, 0x1000
dec ecx
jnz @B
.map_kernel_heap:
mov ecx, [pg_data.kernel_tables-OS_BASE]
shl ecx, 10
xor eax, eax
@ -151,7 +165,7 @@ proc init_mem
mov eax, [tmp_page_tabs]
or eax, PG_SW
mov edi, edx
.map_kernel_tabs:
stosd
add eax, 0x1000
@ -227,8 +241,10 @@ proc init_page_map
jnz .scanmap
; mark kernel memory as allocated (unavailable)
mov ecx, (UPPER_KERNEL_PAGES-OS_BASE)/4096
mov ecx, [tmp_page_tabs]
mov edx, [pg_data.pages_count-OS_BASE]
shr ecx, 12
add ecx, [pg_data.kernel_tables-OS_BASE]
sub edx, ecx
mov [pg_data.pages_free-OS_BASE], edx
@ -416,3 +432,4 @@ proc test_cpu
ret
endp

View File

@ -242,11 +242,11 @@
; 0C dword draw limit - y end
; 0x80339000 -> 3BFFF3 free (12k)
; 0x8033BFF4 -> 33BFFF background info
; 0x8033C000 -> 35BFFF page map (128k)
; 0x8033C000 -> 3??FFF page map: 1bit per page; size = mem_size>>15 (max: 128k)
; 0x003??000 -> 3??FFF phys. location of system PTE head (12kb min);
; =====================================
; 0x8035C000 -> 5FFF7F free (2M7)
; 0x805FFF80 -> 5FFFFF TSS (128)
; 0x80600000 -> 7FFFFF free (2M)
; 0x80600000 -> 7FFFFF extra kernel data structutes(2M max)
; =====================================
; 0x80800000 -> kernel heap
; 0x80FFFFFF heap min limit