|
|
@ -5,6 +5,7 @@ PAGE_DIRECTORY_ADDR equ 0xffffffff ; TODO: change me to something good |
|
|
|
|
|
|
|
|
|
|
|
global enable_paging_registers ; make the SR "global" so that we can access it in the kernel etc |
|
|
|
global enable_paging_registers ; make the SR "global" so that we can access it in the kernel etc |
|
|
|
enable_paging_registers: |
|
|
|
enable_paging_registers: |
|
|
|
|
|
|
|
push eax |
|
|
|
mov eax, PAGE_DIRECTORY_ADDR ; Move the address of the |
|
|
|
mov eax, PAGE_DIRECTORY_ADDR ; Move the address of the |
|
|
|
; page register (page directory) into eax |
|
|
|
; page register (page directory) into eax |
|
|
|
; (Using eax as a middle-man register) |
|
|
|
; (Using eax as a middle-man register) |
|
|
@ -14,10 +15,9 @@ enable_paging_registers: |
|
|
|
or eax, PAGING_ENABLE_FLAG ; perform the OR operation on eax (ex: 0b01 or 0b10 = 0b11) |
|
|
|
or eax, PAGING_ENABLE_FLAG ; perform the OR operation on eax (ex: 0b01 or 0b10 = 0b11) |
|
|
|
; This is needed to enable paging (set the flag as "enabled") |
|
|
|
; This is needed to enable paging (set the flag as "enabled") |
|
|
|
|
|
|
|
|
|
|
|
; DANGER: past this op memory will get weird |
|
|
|
mov cr0, eax ; Move it into cr0 to finally enable paging |
|
|
|
; mov cr0, eax ; Move it into cr0 to finally enable paging |
|
|
|
|
|
|
|
; TODO: Make this work to prevent kernel "panic" (actually death) -> bootloop |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pop eax |
|
|
|
ret ; return to last location |
|
|
|
ret ; return to last location |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|