From 4b874a6d9b9553dd8ad7c6f4f0a60d112564110f Mon Sep 17 00:00:00 2001 From: acevest Date: Mon, 1 Nov 2021 12:09:42 +0800 Subject: [PATCH] =?utf8?q?multiboot=20header=20=E4=B8=8D=E5=86=8D=E6=94=BE?= =?utf8?q?=E5=88=B0=E4=BA=8C=E8=BF=9B=E5=88=B6=E7=9A=84=E5=A4=B4=E9=83=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- boot/multiboot.S | 25 ++++++++++++++----------- scripts/link.ld | 1 + 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/boot/multiboot.S b/boot/multiboot.S index 18c4a32..372e07a 100644 --- a/boot/multiboot.S +++ b/boot/multiboot.S @@ -27,17 +27,6 @@ .extern root_task .extern root_task_entry -.section .multiboot_header -.align 32 - # Multiboot Header - # Align 32 bits boundary - .align 4 - # Magic - .long MULTIBOOT_HEADER_MAGIC - # Flags - .long MULTIBOOT_HEADER_FLAGS - # Checksum - .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) .text .code32 @@ -146,3 +135,17 @@ GDTR: GDTRBase: .long BootGDT-KRNLADDR .comm stack, MULTIBOOT_STACK_SIZE + + + +.section .multiboot_header +.align 32 + # Multiboot Header + # Align 32 bits boundary + .align 4 + # Magic + .long MULTIBOOT_HEADER_MAGIC + # Flags + .long MULTIBOOT_HEADER_FLAGS + # Checksum + .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) \ No newline at end of file diff --git a/scripts/link.ld b/scripts/link.ld index a1bbc7c..98f31e9 100644 --- a/scripts/link.ld +++ b/scripts/link.ld @@ -26,6 +26,7 @@ SECTIONS { code = .; phys_addr = . - kernel_virtual_addr_start; + boot/multiboot.S.o(.text) *(.multiboot_header) *(.text) -- 2.44.0