From: acevest Date: Mon, 1 Nov 2021 04:09:42 +0000 (+0800) Subject: multiboot header 不再放到二进制的头部 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=4b874a6d9b9553dd8ad7c6f4f0a60d112564110f;p=kernel.git multiboot header 不再放到二进制的头部 --- 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)