From 2dc02607ed633be5cd5511bceb470ae38f3dca2e Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 12 Sep 2021 09:39:27 -0400 Subject: [PATCH] Kernel: Put boot.S first in aarch64 Prekernel source list The better fix is to have a linker script. We'll need this to set the entry point to 0x80000 for bare-metal builds anyways. But I'd like to get some UART output in qemu before I add this (otherwise I can't check if the bare-metal version does anything), so put in this temporary kludge for now. --- Kernel/Prekernel/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Kernel/Prekernel/CMakeLists.txt b/Kernel/Prekernel/CMakeLists.txt index 3f88b88074..183367a74b 100644 --- a/Kernel/Prekernel/CMakeLists.txt +++ b/Kernel/Prekernel/CMakeLists.txt @@ -4,9 +4,15 @@ set(SOURCES ) if ("${SERENITY_ARCH}" STREQUAL "aarch64") set(SOURCES + # This has to be first, so that the entry point is at the start of the image. + # Needed because: + # - execution starts at the start of the image + # - the stack pointer currently starts before the start symbol, so if the start symbol isn't the first symbol, the stack will clobber arbitrary code + # FIXME: Use an aarch64-specific linker script instead. + Arch/aarch64/boot.S + ${SOURCES} Arch/aarch64/init.cpp - Arch/aarch64/boot.S ) else() set(SOURCES