aboutsummaryrefslogtreecommitdiff
path: root/kernel/link.ld
diff options
context:
space:
mode:
authorMarvin Borner2020-11-17 22:38:16 +0100
committerMarvin Borner2020-11-17 22:38:16 +0100
commit5443567733f00e8217731c1241f565025e6f4c9e (patch)
treef10b5aafba21f02f6aa816a7a5419a2ed8161a4e /kernel/link.ld
parent72143cff9dbde52d6165742e43b1d20b13bb23e7 (diff)
I think this fixes quite many bugs!
For real though! First tests show no weird bugs anymore.
Diffstat (limited to 'kernel/link.ld')
-rw-r--r--kernel/link.ld30
1 files changed, 30 insertions, 0 deletions
diff --git a/kernel/link.ld b/kernel/link.ld
new file mode 100644
index 0000000..0d8d865
--- /dev/null
+++ b/kernel/link.ld
@@ -0,0 +1,30 @@
+OUTPUT_FORMAT("binary")
+OUTPUT_ARCH(i386)
+ENTRY(kernel_main)
+phys = 0x00050000;
+
+SECTIONS
+{
+ .text phys : AT(phys) {
+ code = .;
+ *(.text)
+ *(.rodata)
+ . = ALIGN(4096);
+ }
+
+ .data : AT(phys + (data - code))
+ {
+ data = .;
+ *(.data)
+ . = ALIGN(4096);
+ }
+
+ .bss : AT(phys + (bss - code))
+ {
+ bss = .;
+ *(.bss)
+ . = ALIGN(4096);
+ }
+
+ end = .;
+}