Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b71dc48311 | ||
|
|
1dc0942b4d |
+32
-7
@@ -1,5 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
project(new_kernel C ASM)
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
# Define compiler run time
|
||||
SET(COMPILER_RT ${CMAKE_CURRENT_LIST_DIR}/compiler/target/bin)
|
||||
@@ -7,30 +8,54 @@ SET(CMAKE_C_COMPILER ${COMPILER_RT}/i686-elf-gcc)
|
||||
SET(CMAKE_ASM_COMPILER ${COMPILER_RT}/i686-elf-gcc)
|
||||
|
||||
# Optionally enable cmake debugging
|
||||
SET(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
#SET(CMAKE_VERBOSE_MAKEFILE ON)
|
||||
|
||||
# Set compile flags
|
||||
SET(CMAKE_C_FLAGS "-g -ffreestanding -Wall -Wextra -fno-exceptions -fstack-protector -fno-pie -m32")
|
||||
SET(CMAKE_ASM_FLAGS "${CFLAGS} -m32 -x assembler-with-cpp")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-T${CMAKE_CURRENT_LIST_DIR}/linker.ld -nostdlib -lgcc")
|
||||
|
||||
include_directories(AFTER include lai/include)
|
||||
# Include directory
|
||||
include_directories(AFTER include)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
################
|
||||
# Features #
|
||||
################
|
||||
|
||||
FILE(GLOB lai lai/core/*.c lai/helpers/*.c lai/driver/*.c)
|
||||
set(ENABLE_ACPI ON CACHE BOOL "Enable ACPI Suppport")
|
||||
|
||||
####################
|
||||
# ACPI Feature #
|
||||
####################
|
||||
if (ENABLE_ACPI)
|
||||
include_directories(AFTER lai/include)
|
||||
FILE(GLOB lai lai/core/*.c lai/helpers/*.c lai/driver/*.c)
|
||||
ELSE()
|
||||
set(lai)
|
||||
endif ()
|
||||
|
||||
# Other sourcees
|
||||
FILE(GLOB_RECURSE kernel_src kernel/**.c)
|
||||
FILE(GLOB_RECURSE kernel_asm kernel/**.S)
|
||||
FILE(GLOB_RECURSE boot_asm boot/boot.S)
|
||||
|
||||
add_compile_definitions(__kernel__)
|
||||
|
||||
#######################
|
||||
# Kernel Features #
|
||||
#######################
|
||||
|
||||
# ACPI
|
||||
if (ENABLE_ACPI)
|
||||
add_compile_definitions(ENABLE_ACPI)
|
||||
endif ()
|
||||
|
||||
# Run IDE in DMA mode if available (NYI)
|
||||
#add_compile_definitions(IDE_ENABLE_INTERRUPT)
|
||||
# Run the kernel shell as the main task
|
||||
add_compile_definitions(ENABLE_SELF_TEST) # Support for pretty printing pci class/subclass/interface
|
||||
# Kernel Command Line features
|
||||
add_compile_definitions(ENABLE_K_SHELL) # Run the kernel shell as the main task
|
||||
add_compile_definitions(ENABLE_SELF_TEST) # Compile in self test kernel CLI command
|
||||
add_compile_definitions(ENABLE_PCIPP) # Support for pretty printing pci class/subclass/interface
|
||||
add_compile_definitions(K_SHELL)
|
||||
|
||||
# find libgcc.a
|
||||
add_library(libgcc STATIC IMPORTED)
|
||||
|
||||
+1
-1
@@ -1,6 +1,7 @@
|
||||
//
|
||||
// Created by rick on 23-02-21.
|
||||
//
|
||||
#ifdef ENABLE_K_SHELL
|
||||
#include <attributes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
@@ -292,7 +293,6 @@ void att_noreturn main_loop(void *data) {
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef K_SHELL
|
||||
|
||||
void main_loop_start() {
|
||||
task_spawn(main_loop, NULL, "main");
|
||||
|
||||
Reference in New Issue
Block a user