added x86_64 support

This commit is contained in:
Morten Delenk 2017-04-24 19:12:19 +00:00
parent 0cd3ab3fdb
commit ba8f73277c
6 changed files with 13 additions and 7 deletions

2
.gitignore vendored
View file

@ -8,3 +8,5 @@ config.h
gen*.h
build/
__pycache__/
kernel
*.iso

3
iso/grub2/grub.cfg Normal file
View file

@ -0,0 +1,3 @@
menuentry "MTGos" {
multiboot /kernel
}

View file

@ -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
"<CMAKE_C_COMPILER> -g -m32 -x assembler-with-cpp -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_ASM_FLAGS} ${PLATFORM_ASM_FLAGS} -c -o <OBJECT> <SOURCE>")
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}")
"<CMAKE_C_COMPILER> -g -x assembler-with-cpp -I../../ -I../../libk/include/ -I../../kernel/src/include/ ${ISA_ASM_FLAGS} ${PLATFORM_ASM_FLAGS} -c -o <OBJECT> <SOURCE>")
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")

View file

@ -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}")

View file

@ -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"

View file

@ -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;
}