summaryrefslogtreecommitdiff
path: root/Kernel/linker.ld
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-17 19:59:20 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-17 22:34:26 +0100
commite362b56b4fd73db86eb8bf62baa8963eec0a967b (patch)
tree38ff10b38b7a8f843c436b629cc8184b2e5f0287 /Kernel/linker.ld
parentcee597a728c89c0d7217a646aea84b14b534e200 (diff)
downloadserenity-e362b56b4fd73db86eb8bf62baa8963eec0a967b.zip
Kernel: Move kernel above the 3GB virtual address mark
The kernel and its static data structures are no longer identity-mapped in the bottom 8MB of the address space, but instead move above 3GB. The first 8MB above 3GB are pseudo-identity-mapped to the bottom 8MB of the physical address space. But things don't have to stay this way! Thanks to Jesse who made an earlier attempt at this, it was really easy to get device drivers working once the page tables were in place! :^) Fixes #734.
Diffstat (limited to 'Kernel/linker.ld')
-rw-r--r--Kernel/linker.ld16
1 files changed, 10 insertions, 6 deletions
diff --git a/Kernel/linker.ld b/Kernel/linker.ld
index 12b0756823..f00d9c2487 100644
--- a/Kernel/linker.ld
+++ b/Kernel/linker.ld
@@ -2,20 +2,21 @@ ENTRY(start)
SECTIONS
{
- . = 0x100000;
+ . = 0xc0100000;
- .text BLOCK(4K) : ALIGN(4K)
+ start_of_kernel_image = .;
+
+ .text ALIGN(4K) : AT (ADDR(.text) - 0xc0000000)
{
Arch/i386/Boot/boot.ao
*(.multiboot)
- *(.page_tables)
start_of_kernel_text = .;
*(.text)
*(.text.startup)
end_of_kernel_text = .;
}
- .rodata BLOCK(4K) : ALIGN(4K)
+ .rodata ALIGN(4K) : AT (ADDR(.rodata) - 0xc0000000)
{
start_ctors = .;
*(.ctors)
@@ -24,18 +25,21 @@ SECTIONS
*(.rodata)
}
- .data BLOCK(4K) : ALIGN(4K)
+ .data ALIGN(4K) : AT (ADDR(.data) - 0xc0000000)
{
start_of_kernel_data = .;
*(.data)
end_of_kernel_data = .;
}
- .bss BLOCK(4K) : ALIGN(4K)
+ .bss ALIGN(4K) : AT (ADDR(.bss) - 0xc0000000)
{
start_of_kernel_bss = .;
+ *(page_tables)
*(COMMON)
*(.bss)
end_of_kernel_bss = .;
}
+
+ end_of_kernel_image = .;
}