summaryrefslogtreecommitdiff
path: root/src/mm/paging.asm
diff options
context:
space:
mode:
authorCarlos Maiolino <[email protected]>2025-10-07 08:13:55 +0200
committerCarlos Maiolino <[email protected]>2025-10-07 08:18:42 +0200
commitda471de9d1367f6f69b5a5d3a21109b737d31024 (patch)
tree3008fa88a28c9b9fe364a829e549660649ddb964 /src/mm/paging.asm
parent44117e4031563d4ff8c0f35302ff21329645a8ab (diff)
mm: enable paging
Add infra-structure to enable and manipulate page tables in the processor. Signed-off-by: Carlos Maiolino <[email protected]>
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