129,8 → 129,8 |
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 |
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 |
227,8 → 241,10 |
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 |
ret |
endp |
|
|