From d4003f1d6daf6883acb83a398e3fdba5336aefef Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Tue, 20 Jul 2021 20:49:03 -0500 Subject: arch: i386: move the kernel to high memory Move the start of the kernel image to the "higher half" of memory. This also enables paging. --- arch/i386/linker.ld | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'arch/i386/linker.ld') diff --git a/arch/i386/linker.ld b/arch/i386/linker.ld index a864c34..5d06e79 100644 --- a/arch/i386/linker.ld +++ b/arch/i386/linker.ld @@ -1,19 +1,29 @@ ENTRY(_start) SECTIONS { - . = 1M; - .text BLOCK(4K) : ALIGN(4K) { - *(.multiboot) + . = 0x00100000; + _kernel_start = .; + .multiboot.data : { + *(.multiboot.data) + } + .multiboot.text : { + *(.multiboot.text) + } + + . += 0xC0000000; + .text ALIGN(4K) : AT(ADDR(.text) - 0xC0000000) { *(.text) } - .rodata BLOCK(4K) : ALIGN(4K) { + .rodata ALIGN(4K) : AT(ADDR(.rodata) - 0xC0000000) { *(.rodata) } - .data BLOCK(4K) : ALIGN(4K) { + .data ALIGN(4K) : AT(ADDR(.data) - 0xC0000000) { *(.data) } - .bss BLOCK(4K) : ALIGN(4K) { + .bss ALIGN(4K) : AT(ADDR(.bss) - 0xC0000000) { *(COMMON) *(.bss) + *(.bootstrap_stack) } + _kernel_end = .; } -- cgit v1.2.3