summaryrefslogtreecommitdiff
path: root/rt/+x86_64/stage1.S
diff options
context:
space:
mode:
Diffstat (limited to 'rt/+x86_64/stage1.S')
-rw-r--r--rt/+x86_64/stage1.S24
1 files changed, 19 insertions, 5 deletions
diff --git a/rt/+x86_64/stage1.S b/rt/+x86_64/stage1.S
index 4f99d69..a3f35ab 100644
--- a/rt/+x86_64/stage1.S
+++ b/rt/+x86_64/stage1.S
@@ -74,25 +74,39 @@ pages_fill:
or $3, %edi
mov %edi, (_p4)
+ # Recursive map the page 4
+ mov $_p4, %edi
+ or $3, %edi
+ mov $_p4, %ebx
+ mov %edi, 4088(%ebx)
+
mov $_p2, %edi
or $3, %edi
mov %edi, (_p3)
mov $_p1, %edi
or $3, %edi
- mov %edi, (_p2)
-
+ mov $_p3, %ebx
+ mov %edi, 8(%ebx)
# :Now we are going to fill the first page
- mov $0x3, %ebx
+ mov $(1 << 7| 0x3), %ebx
+ mov $512, %ecx
+ mov $_p2, %edi
+pages_fill_p2_loop:
+ mov %ebx, (%edi)
+ add $0x200000, %ebx
+ add $8, %edi
+ loop pages_fill_p2_loop
+
mov $512, %ecx
mov $_p1, %edi
pages_fill_p1_loop:
mov %ebx, (%edi)
- add $0x1000, %ebx
+ add $0x200000, %ebx
add $8, %edi
loop pages_fill_p1_loop
-
+
# :Now that the pages are prepared, we must set the %cr3 to point to the level 4
# page table. This register contains the address of the level 4 page
mov $_p4, %edi