aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/arch/x86/linker.ld
diff options
context:
space:
mode:
authorEmu <89668582+EmulatedSeasons@users.noreply.github.com>2024-05-31 23:38:46 -0400
committerGitHub <noreply@github.com>2024-05-31 23:38:46 -0400
commit27a44e0d79d1c6e01cd832feb8ad958d5999b5e3 (patch)
tree3759eb02fcad7a609a064080d81b7c6f9dbec4c8 /kernel/arch/x86/linker.ld
parent639240bbf498195912d8ceb6cb396b89391a5b1b (diff)
parentfd5a1699592ce0afafc42ebf22401596abcdfc28 (diff)
Merge pull request #1 from EmulatedSeasons/limineswitch
Limineswitch
Diffstat (limited to 'kernel/arch/x86/linker.ld')
-rw-r--r--kernel/arch/x86/linker.ld38
1 files changed, 38 insertions, 0 deletions
diff --git a/kernel/arch/x86/linker.ld b/kernel/arch/x86/linker.ld
new file mode 100644
index 0000000..c4bfa3b
--- /dev/null
+++ b/kernel/arch/x86/linker.ld
@@ -0,0 +1,38 @@
+/* Excecution start point symbol */
+ENTRY(_start)
+
+SECTIONS
+{
+ . = 1M;
+
+ /* Used to get the beginning and end address of the kernel */
+ _kernel_begin = .;
+
+ /* code. multiboot header comes first */
+ .text BLOCK(4K) : ALIGN(4K)
+ {
+ *(.multiboot)
+ *(.text)
+ }
+
+ /* read only data */
+ .rodata BLOCK(4K) : ALIGN(4K)
+ {
+ *(.rodata)
+ }
+
+ /* read write data (initialized) */
+ .data BLOCK(4K) : ALIGN(4K)
+ {
+ *(.data)
+ }
+
+ /* read write data (uninitialized) and stack */
+ .bss BLOCK(4K) : ALIGN(4K)
+ {
+ *(COMMON)
+ *(.bss)
+ }
+
+ _kernel_end = .;
+} \ No newline at end of file