From 93585dc4da3be099e1ffe7e757aa7caff2e1f013 Mon Sep 17 00:00:00 2001 From: Aiden Gall Date: Tue, 14 May 2024 19:43:28 +0100 Subject: initial commit --- link.ld | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 link.ld (limited to 'link.ld') diff --git a/link.ld b/link.ld new file mode 100644 index 0000000..33b6066 --- /dev/null +++ b/link.ld @@ -0,0 +1,39 @@ +ENTRY(kmain) +OUTPUT_FORMAT(binary) + +KERNEL_VMA = 0x100000; + +SECTIONS { + . = 0x7c00; + + .text.boot : { + boot/boot.o (.text.boot) + _boot_end = .; + } + + .text KERNEL_VMA : AT(_boot_end) { + *(.text.startup) + *(.text) + *(.rodata*) + . = ALIGN(0x1000); + } + + .data : { + *(.data) + . = ALIGN(0x1000); + } + + .eh_frame : { + *(.eh_frame) + . = ALIGN(0x1000); + } + + .bss : { + *(.bss) + . = ALIGN(0x1000); + } + + /DISCARD/ : { + *(.comment) + } +} -- cgit v1.2.3