From 2b2c5a24daa2d070288730a6b03617891daa82ed Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 5 Feb 2023 10:26:47 +0000 Subject: [PATCH] x86_64: fix broken multiboot pointer boot arg --- arch/x86_64/start_32.S | 10 +++++----- arch/x86_64/start_64.S | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86_64/start_32.S b/arch/x86_64/start_32.S index aafd37a..171badb 100644 --- a/arch/x86_64/start_32.S +++ b/arch/x86_64/start_32.S @@ -254,11 +254,11 @@ long_mode_switch: mov %ax, %es mov %ax, %fs mov %ax, %gs - ljmpl $0x08, $start_64 - cli +1: cli hlt + jmp 1b .global _start .type _start, @function @@ -266,8 +266,8 @@ long_mode_switch: _start: mov $bootstrap_stack_top, %esp - push %ebx # store the pointer to the multiboot info block as a 64-bit value. - push $0x00 # store the pointer to the multiboot info block as a 64-bit value. + pushl $0x00 # store the pointer to the multiboot info block as a 64-bit value. + pushl %ebx # store the pointer to the multiboot info block as a 64-bit value. # check if long mode is supported movl $0x80000000, %eax # Extended-function 80000000h. @@ -284,7 +284,7 @@ _start: btl $3, %edx call init_page_tables - call long_mode_switch # calls start_64, does not return + jmp long_mode_switch # calls start_64, does not return cli hlt diff --git a/arch/x86_64/start_64.S b/arch/x86_64/start_64.S index ed6a365..40776f5 100644 --- a/arch/x86_64/start_64.S +++ b/arch/x86_64/start_64.S @@ -7,7 +7,7 @@ .global start_64 .type start_64, @function start_64: - pop %rax + pop %rdi call kernel_init cli