mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
Prekernel: Make build on aarch64
Add a dummy Arch/aarch64/boot.S that for now does nothing but let all processor cores sleep. For now, none of the actual Prekernel code is built for aarch64.
This commit is contained in:
parent
da785bd4bd
commit
9c5e947e0e
3 changed files with 45 additions and 15 deletions
|
@ -516,7 +516,5 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kernel.map" DESTINATION res)
|
||||||
serenity_install_headers(Kernel)
|
serenity_install_headers(Kernel)
|
||||||
serenity_install_sources(Kernel)
|
serenity_install_sources(Kernel)
|
||||||
|
|
||||||
if (NOT "${SERENITY_ARCH}" STREQUAL "aarch64")
|
|
||||||
add_subdirectory(Prekernel)
|
add_subdirectory(Prekernel)
|
||||||
endif()
|
|
||||||
add_subdirectory(Modules)
|
add_subdirectory(Modules)
|
||||||
|
|
16
Kernel/Prekernel/Arch/aarch64/boot.S
Normal file
16
Kernel/Prekernel/Arch/aarch64/boot.S
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2021, Nico Weber <thakis@chromium.org>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
.text
|
||||||
|
|
||||||
|
.global start
|
||||||
|
.type start, @function
|
||||||
|
start:
|
||||||
|
b Lhalt
|
||||||
|
|
||||||
|
Lhalt:
|
||||||
|
wfi
|
||||||
|
b Lhalt
|
|
@ -1,16 +1,30 @@
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
|
)
|
||||||
|
if ("${SERENITY_ARCH}" STREQUAL "aarch64")
|
||||||
|
set(SOURCES
|
||||||
|
${SOURCES}
|
||||||
|
Arch/aarch64/boot.S
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
set(SOURCES
|
||||||
|
${SOURCES}
|
||||||
Arch/x86/boot.S
|
Arch/x86/boot.S
|
||||||
Arch/x86/multiboot.S
|
Arch/x86/multiboot.S
|
||||||
init.cpp
|
# FIXME: Eventually, some of these should build on aarch64 too.
|
||||||
UBSanitizer.cpp
|
UBSanitizer.cpp
|
||||||
|
init.cpp
|
||||||
../MiniStdLib.cpp
|
../MiniStdLib.cpp
|
||||||
../../Userland/Libraries/LibELF/Relocation.cpp
|
../../Userland/Libraries/LibELF/Relocation.cpp
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if ("${SERENITY_ARCH}" STREQUAL "i686")
|
if ("${SERENITY_ARCH}" STREQUAL "i686")
|
||||||
set(PREKERNEL_TARGET Prekernel32)
|
set(PREKERNEL_TARGET Prekernel32)
|
||||||
else()
|
elseif ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||||
set(PREKERNEL_TARGET Prekernel64)
|
set(PREKERNEL_TARGET Prekernel64)
|
||||||
|
else()
|
||||||
|
set(PREKERNEL_TARGET Prekernel)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
|
||||||
|
@ -27,11 +41,13 @@ else()
|
||||||
target_link_libraries(${PREKERNEL_TARGET} gcc supc++)
|
target_link_libraries(${PREKERNEL_TARGET} gcc supc++)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if ("${SERENITY_ARCH}" STREQUAL "i686" OR "${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${PREKERNEL_TARGET} POST_BUILD
|
TARGET ${PREKERNEL_TARGET} POST_BUILD
|
||||||
COMMAND ${CMAKE_OBJCOPY} -O elf32-i386 ${CMAKE_CURRENT_BINARY_DIR}/${PREKERNEL_TARGET} ${CMAKE_CURRENT_BINARY_DIR}/Prekernel
|
COMMAND ${CMAKE_OBJCOPY} -O elf32-i386 ${CMAKE_CURRENT_BINARY_DIR}/${PREKERNEL_TARGET} ${CMAKE_CURRENT_BINARY_DIR}/Prekernel
|
||||||
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/Prekernel
|
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/Prekernel
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Prekernel" DESTINATION boot)
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/Prekernel" DESTINATION boot)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue