diff --git a/Kernel/Arch/aarch64/MMU.cpp b/Kernel/Arch/aarch64/MMU.cpp index cb21eda2fd..c28c1e6f2c 100644 --- a/Kernel/Arch/aarch64/MMU.cpp +++ b/Kernel/Arch/aarch64/MMU.cpp @@ -269,6 +269,7 @@ void init_page_tables() { *adjust_by_mapping_base(&physical_to_virtual_offset) = KERNEL_MAPPING_BASE; *adjust_by_mapping_base(&kernel_mapping_base) = KERNEL_MAPPING_BASE; + *adjust_by_mapping_base(&kernel_load_base) = KERNEL_MAPPING_BASE; PageBumpAllocator allocator(adjust_by_mapping_base((u64*)page_tables_phys_start), adjust_by_mapping_base((u64*)page_tables_phys_end)); auto root_table = allocator.take_page(); diff --git a/Kernel/KSyms.cpp b/Kernel/KSyms.cpp index 4e66a6781b..75be3dbdbd 100644 --- a/Kernel/KSyms.cpp +++ b/Kernel/KSyms.cpp @@ -84,7 +84,17 @@ UNMAP_AFTER_INIT static void load_kernel_symbols_from_data(Bytes buffer) } } auto& ksym = s_symbols[current_symbol_index]; + + // FIXME: Remove this ifdef once the aarch64 kernel is loaded by the Prekernel. + // Currently, the aarch64 kernel is linked at a high virtual memory address, instead + // of zero, so the address of a symbol does not need to be offset by the kernel_load_base. +#if ARCH(X86_64) ksym.address = kernel_load_base + address; +#elif ARCH(AARCH64) + ksym.address = address; +#else +# error "Unknown architecture" +#endif ksym.name = start_of_name; *bufptr = '\0';