summaryrefslogtreecommitdiff
path: root/arch/i386/boot
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2024-03-28 21:30:12 -0500
committerDanny Holman <dholman@gymli.org>2024-03-28 21:30:12 -0500
commitcbe2690cd5d1b290633c466ebb4df7b64b09b037 (patch)
tree99f77ef19f303c42c028be11cbb4210245b8a583 /arch/i386/boot
parent891f1010bbdc1351bda8d2a6139094a14bdfd5e1 (diff)
arch: i386: kernel: add mostly finished PFA and paging system
Add the mostly finished physical memory allocator and expose its functions to the paging system. Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to 'arch/i386/boot')
-rw-r--r--arch/i386/boot/boot.s18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/i386/boot/boot.s b/arch/i386/boot/boot.s
index 2d17f6a..e443b08 100644
--- a/arch/i386/boot/boot.s
+++ b/arch/i386/boot/boot.s
@@ -19,14 +19,14 @@ stack_top:
.align 4096
boot_page_directory:
.skip 4096
-boot_page_table0:
- .skip 4096
+boot_page_tables:
+ .skip 20480
.section .multiboot.text, "a"
.global _start
.type _start, @function
_start:
- movl $(boot_page_table0 - 0xC0000000), %edi
+ movl $(boot_page_tables - 0xC0000000), %edi
movl $0, %esi
movl $1023, %ecx
@@ -43,12 +43,16 @@ _start:
addl $4, %edi
loop 1b
-3: movl $(0x000B8000 | 0x003), boot_page_table0 - 0xC0000000 + 1023 * 4
+3: movl $0xB8003, boot_page_tables - 0xC0000000 + 1023 * 4
- movl $(boot_page_table0 - 0xC0000000 + 0x003), boot_page_directory - 0xC0000000
- movl $(boot_page_table0 - 0xC0000000 + 0x003), boot_page_directory - 0xC0000000 + 768 * 4
+ movl $boot_page_tables, %ecx
+ subl $0xC0000000, %ecx
+ orl $0x003, %ecx
+ movl %ecx, boot_page_directory - 0xC0000000
+ movl %ecx, boot_page_directory - 0xC0000000 + 4 * 768
- movl $(boot_page_directory - 0xC0000000), %ecx
+ movl $boot_page_directory, %ecx
+ subl $0xC0000000, %ecx
movl %ecx, %cr3
movl %cr0, %ecx