reorganization
[eightysix] / kern / kern.ld
diff --git a/kern/kern.ld b/kern/kern.ld
new file mode 100644 (file)
index 0000000..99bc701
--- /dev/null
@@ -0,0 +1,34 @@
+OUTPUT_FORMAT(binary)
+ENTRY(_start)
+
+SECTIONS {
+       . = 0x7c00;
+       .bootsect : {
+               * (.bootsect);
+       }
+       _bootsect_end = .;
+
+       /* load high out of the way, to allow stage2 to load the kernel low */
+       . = 0x80000;
+       _stage2_start = .;
+       _stage2_start_seg = _stage2_start >> 4;
+       .text : AT(_bootsect_end) {
+               * (.startup);
+               * (.text*);
+       }
+       .data : {
+               * (.rodata*);
+               * (.data*);
+       }
+       .bss ALIGN(4) (NOLOAD): {
+               _bss_start = .;
+               _bss_start_off = _bss_start - _stage2_start;
+               * (.bss*);
+               * (COMMON);
+               . = ALIGN(4);
+       }
+       _bss_size = SIZEOF(.bss);
+       . = ALIGN(4);
+       _stage2_end = .;
+       _stage2_size = _stage2_end - _stage2_start;
+};