diff options
| author | Alejandro Sior <aho@sior.be> | 2022-06-18 10:39:10 +0200 |
|---|---|---|
| committer | Alejandro Sior <aho@sior.be> | 2022-06-18 10:39:10 +0200 |
| commit | bd98b26786d21ffddb017ffe35ecaa4a9fd0aa4a (patch) | |
| tree | 1b78a43385bf0751abab8dd2423905696fd5baab /rt/+x86_64/stage1.S | |
| parent | 3aefeeb723b8822916fb39b7c32551c35c06e32f (diff) | |
Diffstat (limited to 'rt/+x86_64/stage1.S')
| -rw-r--r-- | rt/+x86_64/stage1.S | 24 |
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 |
