[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tyndur-devel] [PATCH] kernel: Multibootheader per Linkerskript platzieren



* kernel: Wenn man den Multibootheader per Link platziert anstatt zufällig über
  die Reihenfolge der ld-Parameter, kommt auch build damit zurecht

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 src/kernel/src/Makefile.all |    2 +-
 src/kernel/src/header.asm   |    1 +
 src/kernel/src/kernel.ld    |    1 +
 3 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/kernel/src/Makefile.all b/src/kernel/src/Makefile.all
index 3cab74e..bf92739 100644
--- a/src/kernel/src/Makefile.all
+++ b/src/kernel/src/Makefile.all
@@ -2,5 +2,5 @@ shopt -s extglob
 source $LOST_BUILDMK_ROOT/config.sh
 
 echo "LD   $1/kernel/tyndur"
-$LOST_TOOLS_LD -otyndur.krn -Tkernel.ld header.o !(header).o $2
+$LOST_TOOLS_LD -otyndur.krn -Tkernel.ld *.o $2
 mv tyndur.krn $1/kernel/tyndur
diff --git a/src/kernel/src/header.asm b/src/kernel/src/header.asm
index 760e0c1..a3a8d2d 100644
--- a/src/kernel/src/header.asm
+++ b/src/kernel/src/header.asm
@@ -74,6 +74,7 @@ _start:
 	cli
 	hlt
 
+section multiboot
 multiboot_header:
 align 4
   MULTIBOOT_MAGIC     equ 0x1BADB002
diff --git a/src/kernel/src/kernel.ld b/src/kernel/src/kernel.ld
index 0cb7936..9efbcb0 100644
--- a/src/kernel/src/kernel.ld
+++ b/src/kernel/src/kernel.ld
@@ -12,6 +12,7 @@ SECTIONS
 
 	.text : AT(ADDR(.text) - VIRT_TO_PHYS)
 	{
+        *(multiboot)
 		*(.text)
 	}
 	.rodata ALIGN(4096) : AT(ADDR(.rodata) - VIRT_TO_PHYS)
-- 
1.5.6.5