代码拉取完成,页面将自动刷新
同步操作将从 kikiyu/chcore-lab 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
cmake_minimum_required (VERSION 3.14)
set(CMAKE_VERBOSE_MAKEFILE on)
set(CMAKE_BUILD_TYPE "Release") # "Release" or "Debug"
set(CHCORE_PLAT "raspi3")
set(CHCORE_ARCH "aarch64")
mark_as_advanced(CMAKE_INSTALL_PREFIX)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions("-DLOG_LEVEL=2")
else ()
add_definitions("-DLOG_LEVEL=1")
endif ()
set(CROSS_COMPILE "${CHCORE_ARCH}-linux-gnu-")
set(CMAKE_C_COMPILER "${CROSS_COMPILE}gcc")
set(CMAKE_ASM_COMPILER "${CROSS_COMPILE}gcc")
execute_process (
COMMAND ${CMAKE_C_COMPILER} -print-file-name=include
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE C_COMPILER_INCLUDE
)
set(CMAKE_C_FLAGS
"-Wall -fPIC -nostdlib -nostartfiles -ffreestanding \
-DCHCORE -nostdinc ")
project (chos C ASM)
set(BOOTLOADER_PATH "boot")
set(KERNEL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/kernel")
set(KERNEL_ARCH_PATH "${KERNEL_PATH}")
include_directories(".")
include_directories("${KERNEL_PATH}")
add_subdirectory("${KERNEL_ARCH_PATH}")
set(BINARY_KERNEL_IMG_PATH "CMakeFiles/kernel.img.dir")
set(init_object
"${BINARY_KERNEL_IMG_PATH}/${BOOTLOADER_PATH}/start.S.o
${BINARY_KERNEL_IMG_PATH}/${BOOTLOADER_PATH}/mmu.c.o
${BINARY_KERNEL_IMG_PATH}/${BOOTLOADER_PATH}/tools.S.o
${BINARY_KERNEL_IMG_PATH}/${BOOTLOADER_PATH}/init_c.c.o
${BINARY_KERNEL_IMG_PATH}/${BOOTLOADER_PATH}/uart.c.o"
)
set(link_script "linker.lds")
configure_file("./scripts/linker-aarch64.lds.in" "linker.lds.S")
set(files "")
include("${BOOTLOADER_PATH}/config.cmake")
add_executable(kernel.img ${files}
$<TARGET_OBJECTS:${PROJECT_NAME}-arch>
)
set_property(
TARGET kernel.img
APPEND_STRING
PROPERTY
LINK_FLAGS
"-T ${CMAKE_CURRENT_BINARY_DIR}/${link_script} -e _start"
)
set_property(
TARGET kernel.img
APPEND_STRING
PROPERTY
DEPENDS
"${link_script}"
)
add_custom_command(
TARGET kernel.img
PRE_LINK
COMMAND ${CMAKE_C_COMPILER} -E -x c
-I${CMAKE_SOURCE_DIR}/${BOOTLOADER_PATH}/include ./linker.lds.S | grep -v "^#" > linker.lds
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。