fixing up paging issues

This commit is contained in:
2026-06-15 18:09:04 -04:00
parent ac4b510221
commit 25da0f6a71
7 changed files with 101 additions and 85 deletions

View File

@@ -4,18 +4,38 @@
.set MAGIC, 0x1BADB002 /* 'magic number' lets bootloader find the header */
.set CHECKSUM, -(MAGIC + FLAGS) /* checksum of above, to prove we are multiboot */
.section .multiboot
.section .multiboot, "a"
.align 4
.long MAGIC
.long FLAGS
.long CHECKSUM
.section .bss
.align 4096
boot_page_directory:
.skip 4096
boot_page_table1:
.skip 4096
.section .text
.global _start
_start:
cli
mov $(page_directory - 0xC0000000), %ecx
mov %cr4, %edx
or $0x00000010, %edx
mov %edx, %cr4
mov %ecx, %cr3
mov %cr0, %edx
or $0x80000000, %edx
mov %edx, %cr0
lea higher, %ecx
jmp *%ecx
higher:
mov $stack_top, %esp
push %ebx
push %eax
call kmain
loop:
jmp loop
.section .bss
.align 16
@@ -23,13 +43,11 @@ stack_bottom:
.skip 16384 # 16 KiB
stack_top:
.section .text
.global _start
_start:
cli
mov $stack_top, %esp
push %ebx
push %eax
call kmain
loop:
jmp loop
.section .data, "a"
.align 4096
.global page_directory
page_directory:
.long 0x00000083
.skip 3068
.long 0x00000083
.skip 1020