From f7df7167f0c54bd8da79dbf2d48bda5d7491fd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Sun, 6 Oct 2024 08:45:04 +0000 Subject: Remove high memory kernel and needless prints --- arch/x86_64/scripts/kernel.ld | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'arch/x86_64/scripts') diff --git a/arch/x86_64/scripts/kernel.ld b/arch/x86_64/scripts/kernel.ld index 943266c..31d8be3 100644 --- a/arch/x86_64/scripts/kernel.ld +++ b/arch/x86_64/scripts/kernel.ld @@ -3,7 +3,6 @@ ENTRY(_start) /***************************************************************************** * Virtual and linear start addresses of the TeachOS kernel *****************************************************************************/ -TEACHOS_HIGH = -2048M; TEACHOS_LOW = 1M; PHDRS { @@ -31,7 +30,7 @@ SECTIONS * symbols at the beginning. ***************************************************************************/ _start_linear = .; - _start_virtual = . + TEACHOS_HIGH; + _start_virtual = .; /*************************************************************************** * The bootstrapping infratructure goes first. We first place the read-only @@ -66,9 +65,8 @@ SECTIONS * also make sure to align the loaded data onto a page boundary. ***************************************************************************/ . = ALIGN(4K); - . += TEACHOS_HIGH; - .init ALIGN(4K) : AT(ADDR (.init) - TEACHOS_HIGH) + .init ALIGN(4K) : AT(ADDR (.init)) { /* * Make sure that the crt code is wrapped around the compiler generated @@ -79,7 +77,7 @@ SECTIONS KEEP(*crtn.s.o*(.init)) } :text - .fini ALIGN(4K) : AT(ADDR (.fini) - TEACHOS_HIGH) + .fini ALIGN(4K) : AT(ADDR (.fini)) { /* * Make sure that the crt code is wrapped around the compiler generated @@ -90,18 +88,18 @@ SECTIONS KEEP(*crtn.s.o*(.fini)) } - .text ALIGN(4K) : AT(ADDR (.text) - TEACHOS_HIGH) + .text ALIGN(4K) : AT(ADDR (.text)) { *(.text*) } - .rodata ALIGN(4K) : AT (ADDR (.rodata) - TEACHOS_HIGH) + .rodata ALIGN(4K) : AT (ADDR (.rodata)) { *(.rodata) *(.rodata.*) } :rodata - .ctors ALIGN(4K) : AT (ADDR (.ctors) - TEACHOS_HIGH) + .ctors ALIGN(4K) : AT (ADDR (.ctors)) { KEEP(*crtbegin.o(.ctors)) KEEP(*(EXCLUDE_FILE (*crtend.o) .ctors)) @@ -109,7 +107,7 @@ SECTIONS KEEP(*crtend.o(.ctors)) } :data - .dtors ALIGN(4K) : AT (ADDR (.dtors) - TEACHOS_HIGH) + .dtors ALIGN(4K) : AT (ADDR (.dtors)) { KEEP(*crtbegin.o(.dtors)) KEEP(*(EXCLUDE_FILE (*crtend.o) .dtors)) @@ -117,12 +115,12 @@ SECTIONS KEEP(*crtend.o(.dtors)) } - .data ALIGN(4K) : AT (ADDR (.data) - TEACHOS_HIGH) + .data ALIGN(4K) : AT (ADDR (.data)) { *(.data*) } - .bss ALIGN(4K) : AT (ADDR (.bss) - TEACHOS_HIGH) + .bss ALIGN(4K) : AT (ADDR (.bss)) { *(COMMON) *(.bss*) @@ -133,7 +131,7 @@ SECTIONS * symbols to mark the end of our loaded image. ***************************************************************************/ _end_virtual = ADDR(.bss) + SIZEOF(.bss); - _end_linear = _end_virtual - TEACHOS_HIGH; + _end_linear = _end_virtual; /DISCARD/ : { *(.comment) } } -- cgit v1.2.3