1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 12:27:36 +00:00

Kernel/aarch64: Change base address of the kernel to 0x2000000000

This is the same address that the x86_64 kernel runs at, and allows us
to run the kernel at a high virtual memory address. Since we now run
completely in high virtual memory, we can also unmap the identity
mapping. Additionally some changes in MMU.cpp are required to
successfully boot.
This commit is contained in:
Timon Kruiper 2023-01-07 15:01:51 +01:00 committed by Linus Groh
parent 3bc122fcef
commit c4a3af12fc
4 changed files with 29 additions and 16 deletions

View file

@ -1,5 +1,7 @@
ENTRY(start)
KERNEL_MAPPING_BASE = 0x2000000000;
/* TODO: Add FLAGS to the program headers */
PHDRS
{
@ -11,17 +13,17 @@ PHDRS
SECTIONS
{
. = 0x00080000;
. = KERNEL_MAPPING_BASE + 0x80000;
start_of_kernel_image = .;
.text ALIGN(4K) : AT (ADDR(.text))
.text ALIGN(4K) : AT (ADDR(.text) - KERNEL_MAPPING_BASE)
{
*(.text.first)
*(.text*)
} :text
.rodata ALIGN(4K) : AT (ADDR(.rodata))
.rodata ALIGN(4K) : AT (ADDR(.rodata) - KERNEL_MAPPING_BASE)
{
start_heap_ctors = .;
*libkernel_heap.a:*(.init_array)
@ -34,19 +36,19 @@ SECTIONS
*(.rodata*)
} :data
.data ALIGN(4K) : AT (ADDR(.data))
.data ALIGN(4K) : AT (ADDR(.data) - KERNEL_MAPPING_BASE)
{
*(.data*)
} :data
.ksyms ALIGN(4K) : AT (ADDR(.ksyms))
.ksyms ALIGN(4K) : AT (ADDR(.ksyms) - KERNEL_MAPPING_BASE)
{
start_of_kernel_ksyms = .;
*(.kernel_symbols)
end_of_kernel_ksyms = .;
} :ksyms
.bss ALIGN(4K) (NOLOAD) : AT (ADDR(.bss))
.bss ALIGN(4K) (NOLOAD) : AT (ADDR(.bss) - KERNEL_MAPPING_BASE)
{
start_of_bss = .;
*(.bss)