-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7fc44a
commit ee75498
Showing
5 changed files
with
25 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1 @@ | ||
# Build products | ||
*.o | ||
*.d | ||
*.elf | ||
|
||
# LSP files | ||
compile_commands.json | ||
.cache/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cmake_minimum_required(VERSION 3.29) | ||
|
||
project(karg ASM C) | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
set(LINKER_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/kernel.ld) | ||
set(CMAKE_C_FLAGS "-ffreestanding -mcmodel=medany") | ||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostdlib -T ${LINKER_SCRIPT}") | ||
|
||
add_executable(karg.elf src/entry.S src/kmain.c src/kprintf.c src/syscall.c src/trap.S src/uart.c) | ||
set_target_properties(karg.elf PROPERTIES LINK_DEPENDS ${LINKER_SCRIPT}) | ||
target_include_directories(karg.elf PRIVATE include/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) | ||
|
||
set(TOOLCHAIN_PREFIX riscv64-unknown-elf-) | ||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) |