Files
exkernel/kernel.ld
Fabio Scotto di Santolo c59b4004e5 Implemented project structure
2025-11-29 18:43:07 +01:00

43 lines
1.3 KiB
Plaintext

ENTRY(boot)
SECTIONS {
/* base address */
. = 0x80200000;
/* contains the instructions */
.text :{
/* .text.boot always placed at the beginning */
/* KEEP to not discard section */
KEEP(*(.text.boot));
/* match all input files with all .text and all .text.* section */
,*(.text .text.);
}
/* contains read-only data */
.rodata : ALIGN(4) {
,*(.rodata .rodata.*);
}
/* contains read/write data */
/* adjust current address to a 4-byte boundary */
.data : ALIGN(4) {
,*(.data .data.*);
}
/* contains read/write data with an initial value of zero */
/* adjust current address to a 4-byte boundary */
.bss : ALIGN(4) {
/* assign current address to the symbol '__bss' */
/* you can access this symbol in C using 'extern char __bss;' */
__bss = .;
,*(.bss .bss.* .sbss .sbss.*);
__bss_end = .;
}
/* kernel stack right after .bss and with size 128KB */
/* adjust current address to a 4-byte boundary */
. = ALIGN(4);
. += 128 * 1024; /* 128KB */
__stack_top = .;
}