From 152f14654bfb438d074833e3c8d5392d300f5095 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 28 Apr 2021 10:46:36 +0200 Subject: Debug trampoline and paging --- src/boot/boot.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/boot/boot.S') diff --git a/src/boot/boot.S b/src/boot/boot.S index 73ee637..d8795d0 100644 --- a/src/boot/boot.S +++ b/src/boot/boot.S @@ -1,8 +1,6 @@ .globl _start -.globl MB_INFO .extern _bss_start .extern _bss_end -.extern higherhalf .section .multiboot @@ -35,7 +33,7 @@ mb_header_start: # ----------- End tag # ----------- Ask framebuffer tag .align 8 -.short 6 +.short 5 .short 1 .int 20 .int 0 @@ -55,6 +53,7 @@ MB_INFO: # Will contains the Multiboot2 information data structure address _start: mov %ebx, (MB_INFO) + # ----- Setup PAE Paging (identity on the first 10MB) mov $8192, %ecx # 8*4096/4 (8 tables of 4096 byte each divide by 4 because of movl) mov $0, %eax @@ -122,8 +121,12 @@ mov %ax, %gs mov %ax, %ss mov $__stack_pma, %esp -# Setup +# Setup +movq (MB_INFO), %rdi +mov $0xFFFFFFFF,%rax +and %rax, %rdi call trampoline +movq %rax, (MB_INFO) mov $__kernel_vma, %rsp # Zeroing the .bss section @@ -138,6 +141,7 @@ start_zeroing: end_zeroing: # Launch kernel +movq (MB_INFO), %rdi call boucane # GDT -- cgit v1.2.3