aboutsummaryrefslogtreecommitdiff
path: root/src/as/paging.s
diff options
context:
space:
mode:
authorAleksa Vučković <aleksav013@gmail.com>2022-06-29 01:52:48 +0200
committerAleksa Vučković <aleksav013@gmail.com>2022-06-29 16:44:25 +0200
commit1f57e99720c4bc5e3e27a88ff469cef43c202a43 (patch)
tree8161bd72d272009a520dd173eac3658a48a9f096 /src/as/paging.s
parent58240b0509d11b09ce2994b88308650e7cfb93bd (diff)
HigherHalf
Diffstat (limited to 'src/as/paging.s')
-rw-r--r--src/as/paging.s20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/as/paging.s b/src/as/paging.s
index e1cf42a..c3a9a0d 100644
--- a/src/as/paging.s
+++ b/src/as/paging.s
@@ -1,14 +1,16 @@
+.text
+
.global loadPageDirectory
loadPageDirectory:
push %ebp
- mov %esp, %ebp
- mov 8(%esp), %eax
- mov %eax, %cr3
+ movl %esp, %ebp
+ movl 8(%esp), %eax
+ subl $0xC0000000, %eax
+ movl %eax, %cr3
mov %ebp, %esp
pop %ebp
ret
-.text
.global enablePaging
enablePaging:
push %ebp
@@ -19,3 +21,13 @@ enablePaging:
mov %ebp, %esp
pop %ebp
ret
+
+.global flushPaging
+flushPaging:
+ push %ebp
+ mov %esp, %ebp
+ movl %cr3, %ecx
+ movl %ecx, %cr3
+ mov %ebp, %esp
+ pop %ebp
+ ret