summaryrefslogtreecommitdiff
path: root/src/link.ld
diff options
context:
space:
mode:
Diffstat (limited to 'src/link.ld')
-rw-r--r--src/link.ld37
1 files changed, 37 insertions, 0 deletions
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;