diff --git a/.gitignore b/.gitignore index e283ec9..90abd90 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ config.h gen*.h build/ __pycache__/ +kernel +*.iso diff --git a/iso/grub2/grub.cfg b/iso/grub2/grub.cfg new file mode 100644 index 0000000..b9d6f76 --- /dev/null +++ b/iso/grub2/grub.cfg @@ -0,0 +1,3 @@ +menuentry "MTGos" { + multiboot /kernel +} diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 4b4d196..641a467 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -29,8 +29,8 @@ FILE(GLOB_RECURSE GENERIC_SRCS src/*.c src/*.cpp ${DRIVER_SRCS}) LOAD_PROFILE(${ARCH} ${SYSTEM}) ADD_EXECUTABLE(kernel ${PLATFORM_SRCS} ${ISA_SRCS} ${GENERIC_SRCS}) SET(CMAKE_ASM-ATT_COMPILE_OBJECT - " -g -m32 -x assembler-with-cpp -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_ASM_FLAGS} ${PLATFORM_ASM_FLAGS} -c -o ") -SET(CMAKE_C_FLAGS "-g -m32 -w -Werror -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -std=c11 -ffreestanding -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_C_FLAGS} ${PLATFORM_C_FLAGS}") -SET(CMAKE_CXX_FLAGS "-g -m32 -w -Werror -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -ffreestanding -fno-rtti -fno-exceptions -std=gnu++17 -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_CXX_FLAGS} ${PLATFORM_CXX_FLAGS}") + " -g -x assembler-with-cpp -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_ASM_FLAGS} ${PLATFORM_ASM_FLAGS} -c -o ") +SET(CMAKE_C_FLAGS "-g -w -Werror -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -std=c11 -ffreestanding -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_C_FLAGS} ${PLATFORM_C_FLAGS}") +SET(CMAKE_CXX_FLAGS "-g -w -Werror -Wno-unused -Wno-unused-variable -fno-use-cxa-atexit -ffreestanding -fno-rtti -fno-exceptions -std=gnu++17 -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_CXX_FLAGS} ${PLATFORM_CXX_FLAGS}") SET_TARGET_PROPERTIES(kernel PROPERTIES LINK_FLAGS "-T ../../kernel/${PLATFORM_LAYOUT} -N ${ISA_LINKER_FLAGS} ${PLATFORM_LINKER_FLAGS} -nostdlib -nodefaultlibs -lgcc -Wl,--gc-sections") diff --git a/kernel/arch/x86/flags.cmake b/kernel/arch/x86/flags.cmake index 062079f..3f867e9 100644 --- a/kernel/arch/x86/flags.cmake +++ b/kernel/arch/x86/flags.cmake @@ -1,2 +1,3 @@ SET(ISA_C_FLAGS "-m32 -I../../kernel/arch/x86/include/") SET(ISA_CXX_FLAGS "${ISA_C_FLAGS}") +SET(ISA_ASM_FLAGS "${ISA_C_FLAGS}") diff --git a/kernel/arch/x86_64/config.py b/kernel/arch/x86_64/config.py index cdd128c..bc14cd2 100644 --- a/kernel/arch/x86_64/config.py +++ b/kernel/arch/x86_64/config.py @@ -1,5 +1,5 @@ config["SYSTEM"] = get_from_list("System", ["pc"]) if not get_yes_no("Build for generic x86_64"): config["LOWEST_CPU"] = get_from_list("Lowest supported CPU", ["pentium4", "core2", "nehalem", "westmere", "sandybridge", "ivybridge", "haswell", "broadwell", "skylake", "kabylake"]) - - +else: + config["LOWEST_CPU"] = "pentium4" diff --git a/kernel/src/object_init.cpp b/kernel/src/object_init.cpp index 50bc367..ee45a38 100644 --- a/kernel/src/object_init.cpp +++ b/kernel/src/object_init.cpp @@ -4,8 +4,8 @@ bool tty_set = false; void setMainTTY(Kobject *obj) { if(obj->type == kobjectType::TTY) { ++*obj; - if(tty_set) - --*out; +// if(tty_set) +// --*out; out=(TTY*)obj; tty_set=true; }