wip: change the C function set_mem_size to asm

This commit is contained in:
2024-11-08 12:45:00 +01:00
parent 5fccbf3708
commit 3c87632b0c
5 changed files with 38 additions and 8 deletions

View File

@ -34,6 +34,7 @@ boot_page_table1:
# The kernel entry point.
.section .multiboot.text, "a"
.global _start
.global end_mem
.type _start, @function
_start:
# Physical address of boot_page_table1.
@ -89,6 +90,10 @@ _start:
movl $(boot_page_directory - 0xC0000000), %ecx
movl %ecx, %cr3
jmp set_mem_size
end_mem:
# Enable paging and the write-protect bit.
movl %cr0, %ecx
orl $0x80000000, %ecx
@ -113,9 +118,6 @@ _start:
# Set up the stack.
mov $stack_top, %esp
push %eax
push %ebx
# Enter the high-level kernel.
call kernel_main