]> Zhao Yanbai Git Server - kernel.git/commitdiff
multiboot header 不再放到二进制的头部
authoracevest <zhaoyanbai@126.com>
Mon, 1 Nov 2021 04:09:42 +0000 (12:09 +0800)
committeracevest <zhaoyanbai@126.com>
Wed, 3 Nov 2021 02:45:45 +0000 (10:45 +0800)
boot/multiboot.S
scripts/link.ld

index 18c4a320ce51e81e19a71491dd5078a26e8e8606..372e07a14ccc538672fa24768b9106ea82b65ec4 100644 (file)
 .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
index a1bbc7c0fa06a5d83b9f09d4f7557161c2f64765..98f31e9623e47324beb440f4f2b9910582615367 100644 (file)
@@ -26,6 +26,7 @@ SECTIONS
     {
         code = .;
         phys_addr = . - kernel_virtual_addr_start;
+        boot/multiboot.S.o(.text)
         *(.multiboot_header)
         *(.text)