38 lines
580 B
NASM
38 lines
580 B
NASM
bits 32
|
|
|
|
global _read_cr0
|
|
_read_cr0:
|
|
mov eax, cr0
|
|
retn
|
|
|
|
global _write_cr0
|
|
_write_cr0:
|
|
push ebp
|
|
mov ebp, esp
|
|
mov eax, [ebp+8]
|
|
mov cr0, eax
|
|
pop ebp
|
|
retn
|
|
|
|
global _read_cr3
|
|
_read_cr3:
|
|
mov eax, cr3
|
|
retn
|
|
|
|
global _write_cr3
|
|
_write_cr3:
|
|
;xchg bx, bx ; bochs magic breakpoint
|
|
push ebp
|
|
mov ebp, esp
|
|
mov eax, [ebp+8]
|
|
mov cr3, eax
|
|
pop ebp
|
|
retn
|
|
|
|
global _vmmngr_flush_tbl_entry
|
|
_vmmngr_flush_tbl_entry:
|
|
mov eax, [ebp+8]
|
|
cli
|
|
invlpg [eax]
|
|
sti
|
|
retn |