summaryrefslogtreecommitdiff
path: root/arch/i386/linker.ld
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.xyz>2021-07-20 20:49:03 -0500
committerDanny Holman <dholman@gymli.xyz>2021-07-20 20:49:03 -0500
commitd4003f1d6daf6883acb83a398e3fdba5336aefef (patch)
treedd6787232c0a8feae57d63bfa7e220e2c9fed945 /arch/i386/linker.ld
parentefad89a1b70e265c3706662a8392fd1164c06bd7 (diff)
arch: i386: move the kernel to high memory
Move the start of the kernel image to the "higher half" of memory. This also enables paging.
Diffstat (limited to 'arch/i386/linker.ld')
-rw-r--r--arch/i386/linker.ld22
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/i386/linker.ld b/arch/i386/linker.ld
index a864c34..5d06e79 100644
--- a/arch/i386/linker.ld
+++ b/arch/i386/linker.ld
@@ -1,19 +1,29 @@
ENTRY(_start)
SECTIONS {
- . = 1M;
- .text BLOCK(4K) : ALIGN(4K) {
- *(.multiboot)
+ . = 0x00100000;
+ _kernel_start = .;
+ .multiboot.data : {
+ *(.multiboot.data)
+ }
+ .multiboot.text : {
+ *(.multiboot.text)
+ }
+
+ . += 0xC0000000;
+ .text ALIGN(4K) : AT(ADDR(.text) - 0xC0000000) {
*(.text)
}
- .rodata BLOCK(4K) : ALIGN(4K) {
+ .rodata ALIGN(4K) : AT(ADDR(.rodata) - 0xC0000000) {
*(.rodata)
}
- .data BLOCK(4K) : ALIGN(4K) {
+ .data ALIGN(4K) : AT(ADDR(.data) - 0xC0000000) {
*(.data)
}
- .bss BLOCK(4K) : ALIGN(4K) {
+ .bss ALIGN(4K) : AT(ADDR(.bss) - 0xC0000000) {
*(COMMON)
*(.bss)
+ *(.bootstrap_stack)
}
+ _kernel_end = .;
}