summaryrefslogtreecommitdiff
path: root/src/mm/paging.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm/paging.asm')
-rw-r--r--src/mm/paging.asm25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mm/paging.asm b/src/mm/paging.asm
new file mode 100644
index 0000000..7f79489
--- /dev/null
+++ b/src/mm/paging.asm
@@ -0,0 +1,25 @@
+[BITS 32]
+
+section .asm
+
+ global paging_load_directory
+ global enable_paging
+
+ paging_load_directory:
+ push ebp
+ mov ebp, esp
+ mov eax, [ebp + 8]
+
+ mov cr3, eax
+
+ pop ebp
+ ret
+
+ enable_paging:
+ push ebp
+ mov ebp, esp
+ mov eax, cr0
+ or eax, 0x80000000
+ mov cr0, eax
+ pop ebp
+ ret