From 1f57e99720c4bc5e3e27a88ff469cef43c202a43 Mon Sep 17 00:00:00 2001 From: Aleksa Vučković Date: Wed, 29 Jun 2022 01:52:48 +0200 Subject: HigherHalf --- src/as/paging.s | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'src/as/paging.s') 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 -- cgit v1.2.3