From 66289aa8ecfa07b20bad424eb9860b196641ef52 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Fri, 19 Mar 2021 10:54:25 -0500 Subject: first commit --- src/link.ld | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/link.ld (limited to 'src/link.ld') diff --git a/src/link.ld b/src/link.ld new file mode 100644 index 0000000..a325c1a --- /dev/null +++ b/src/link.ld @@ -0,0 +1,37 @@ +SEARCH_DIR(objects) + +INPUT( +bootloader.o +libc.o +serial.o +video.o +printf.o +page.o +acpi.o +kernel.o +) + +/*while we do need to worry about the stack converging on our kernel, +this is only temporary, and it will be more noticable then if it were to hit bios (we want to find bugs, not ignore them!)*/ +_kernel_stack_loc = 0x200000 - 16; +_kernel_loc = 0x100000; +_meminfo_loc = 0x7000; +_vbe_infoblock = 0x500; /* this does not account for segmentation to get over 0xffff*/ + +SECTIONS +{ + . = 0x0; + bootloader 0x7c00 : + { + bootloader.o(.text) + } + kernel _kernel_loc : + AT (ADDR(bootloader) + SIZEOF(bootloader)) + /*ALIGN(4096)*/ + { + EXCLUDE_FILE (*bootloader.o) *(.text .data .bss .rodata .comment .eh_frame) + } +} + +_kernel_size = (SIZEOF(kernel) / 512) + (SIZEOF(bootloader) / 512) + 2; +_bootloader_stage1_size = (SIZEOF(bootloader) / 512) - 1; -- cgit v1.2.3