summaryrefslogtreecommitdiffstats
path: root/kernel/kernel.ld
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kernel.ld')
-rw-r--r--kernel/kernel.ld36
1 files changed, 36 insertions, 0 deletions
diff --git a/kernel/kernel.ld b/kernel/kernel.ld
new file mode 100644
index 0000000..da9e019
--- /dev/null
+++ b/kernel/kernel.ld
@@ -0,0 +1,36 @@
+ENTRY(entrypoint) /* the entry point */
+
+SECTIONS {
+ . = 0x100000; /* all sections located above 1MB */
+
+ .bootloader ALIGN(4K): /* multiboot header first (needs to reside within the first 8KB) */
+ {
+ *(.bootloader)
+ }
+
+ .stack ALIGN(4K): /* kernel stack */
+ {
+ *(.stack)
+ }
+
+ .text ALIGN(4K) : /* code */
+ {
+ *(.text*)
+ }
+
+ .rodata ALIGN(4K) : /* read-only data */
+ {
+ *(.rodata*)
+ }
+
+ .data ALIGN(4K) : /* initialized data */
+ {
+ *(.data*)
+ }
+
+ .bss ALIGN(4K) : /* unitialized data */
+ {
+ *(COMMON)
+ *(.bss*)
+ }
+}