forked from KolibriOS/kolibrios
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:
parent
e84fb6973a
commit
999126566d
@ -129,8 +129,8 @@ proc init_mem
|
|||||||
rep stosd
|
rep stosd
|
||||||
|
|
||||||
mov edx, (sys_pgdir-OS_BASE)+ 0x800; (OS_BASE shr 20)
|
mov edx, (sys_pgdir-OS_BASE)+ 0x800; (OS_BASE shr 20)
|
||||||
; bt [cpu_caps-OS_BASE], CAPS_PSE
|
bt [cpu_caps-OS_BASE], CAPS_PSE
|
||||||
; jnc .no_PSE
|
jnc .no_PSE
|
||||||
|
|
||||||
mov ebx, cr4
|
mov ebx, cr4
|
||||||
or ebx, CR4_PSE
|
or ebx, CR4_PSE
|
||||||
@ -142,6 +142,20 @@ proc init_mem
|
|||||||
add edx, 4
|
add edx, 4
|
||||||
|
|
||||||
mov edi, [tmp_page_tabs]
|
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]
|
mov ecx, [pg_data.kernel_tables-OS_BASE]
|
||||||
shl ecx, 10
|
shl ecx, 10
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
@ -151,7 +165,7 @@ proc init_mem
|
|||||||
mov eax, [tmp_page_tabs]
|
mov eax, [tmp_page_tabs]
|
||||||
or eax, PG_SW
|
or eax, PG_SW
|
||||||
mov edi, edx
|
mov edi, edx
|
||||||
|
|
||||||
.map_kernel_tabs:
|
.map_kernel_tabs:
|
||||||
stosd
|
stosd
|
||||||
add eax, 0x1000
|
add eax, 0x1000
|
||||||
@ -227,8 +241,10 @@ proc init_page_map
|
|||||||
jnz .scanmap
|
jnz .scanmap
|
||||||
|
|
||||||
; mark kernel memory as allocated (unavailable)
|
; 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]
|
mov edx, [pg_data.pages_count-OS_BASE]
|
||||||
|
shr ecx, 12
|
||||||
|
add ecx, [pg_data.kernel_tables-OS_BASE]
|
||||||
sub edx, ecx
|
sub edx, ecx
|
||||||
mov [pg_data.pages_free-OS_BASE], edx
|
mov [pg_data.pages_free-OS_BASE], edx
|
||||||
|
|
||||||
@ -416,3 +432,4 @@ proc test_cpu
|
|||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
|
||||||
|
|
||||||
|
@ -242,11 +242,11 @@
|
|||||||
; 0C dword draw limit - y end
|
; 0C dword draw limit - y end
|
||||||
; 0x80339000 -> 3BFFF3 free (12k)
|
; 0x80339000 -> 3BFFF3 free (12k)
|
||||||
; 0x8033BFF4 -> 33BFFF background info
|
; 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)
|
; 0x805FFF80 -> 5FFFFF TSS (128)
|
||||||
; 0x80600000 -> 7FFFFF free (2M)
|
; 0x80600000 -> 7FFFFF extra kernel data structutes(2M max)
|
||||||
; =====================================
|
; =====================================
|
||||||
; 0x80800000 -> kernel heap
|
; 0x80800000 -> kernel heap
|
||||||
; 0x80FFFFFF heap min limit
|
; 0x80FFFFFF heap min limit
|
||||||
|
Loading…
Reference in New Issue
Block a user