os-k/kaleid/kernel/mm/paging.asm
2019-05-15 02:26:55 +02:00

27 lines
377 B
NASM

global MmEnableWriteProtect
global MmDisableWriteProtect
global MmLoadPML4
MmEnableWriteProtect:
push rax
mov rax, cr0
or rax, 1<<16
mov cr0, rax
pop rax
ret
MmDisableWriteProtect:
push rax
mov rax, cr0
and rax, ~(1<<16)
mov cr0, rax
pop rax
ret
MmLoadPML4:
push rax
mov rax, rdi
mov cr3, rax
pop rax
ret