From 0476248f648ccddea9bdf9bae9095c3231e6643d Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Fri, 26 Jan 2024 15:37:37 +0100 Subject: Kernel: Retarget AMD64 according to spec. Kernel/Toolchain: Now move hKernel to /System/ when building the system. MPT: Fix API. newBoot: This is the priority, get a standard file layout to load the kernel at BK_START_KERNEL (0x00080000) Signed-off-by: Amlal El Mahrouss --- Linker/AMD64.ld | 44 ++++++++++++++++++++++++++++++++++++++++++++ Linker/PowerPC.ld | 21 --------------------- 2 files changed, 44 insertions(+), 21 deletions(-) create mode 100644 Linker/AMD64.ld delete mode 100644 Linker/PowerPC.ld (limited to 'Linker') diff --git a/Linker/AMD64.ld b/Linker/AMD64.ld new file mode 100644 index 00000000..0b083ca0 --- /dev/null +++ b/Linker/AMD64.ld @@ -0,0 +1,44 @@ +OUTPUT_FORMAT("elf64-x86-64") + +ENTRY(Main) + +PHDRS { + null PT_NULL FLAGS(0) ; + text PT_LOAD FLAGS((1 << 0) | (1 << 2) | (1 << 3)); + rodata PT_LOAD FLAGS((1 << 2)) ; + data PT_LOAD FLAGS((1 << 1) | (1 << 2)) ; +} + +SECTIONS { + . = 0x00080000; + + .text : { + KEEP(*(.multiboot)) + *(.text .text.*) + } :text + + . += CONSTANT(MAXPAGESIZE); + + .init : { + *(.initl) + } + + . += CONSTANT(MAXPAGESIZE); + + .rodata : { + *(.rodata .rodata.*) + } :rodata + + . += CONSTANT(MAXPAGESIZE); + + .data : { + *(.data .data.*) + } :data + + . += CONSTANT(MAXPAGESIZE); + + .bss : { + *(COMMON) + *(.bss .bss.*) + } :data +} \ No newline at end of file diff --git a/Linker/PowerPC.ld b/Linker/PowerPC.ld deleted file mode 100644 index 722a86b8..00000000 --- a/Linker/PowerPC.ld +++ /dev/null @@ -1,21 +0,0 @@ -ENTRY(_start) - -SECTIONS -{ - . = 0x02000000; - .text BLOCK(4K) : ALIGN(4K) - { - *(.text) - } - . = 0x02100000; - .data BLOCK(4K) : ALIGN(4K) - { - - *(.rodata) - *(.data) - } - .bss BLOCK(4K) (NOLOAD) : ALIGN(4K) - { - *(.bss) - } -} \ No newline at end of file -- cgit v1.2.3