Compare commits

..

No commits in common. "70c6b78e35d627b1d609a4b7728f10b2198cd9ff" and "102eabcb4b4fa1ad8eebf632995cd0550fbc9830" have entirely different histories.

10 changed files with 34 additions and 24 deletions

View File

@ -1,8 +1,8 @@
set(SOURCES set(SOURCES
src/main.cpp src/main.cpp
src/video/Framebuffer.cpp src/Framebuffer.cpp
src/memory/MemoryManager.cpp src/MemoryManager.cpp
src/boot/Init.cpp src/Init.cpp
src/arch/Serial.cpp src/arch/Serial.cpp
) )
@ -16,14 +16,21 @@ set(SOURCES
) )
endif() endif()
set(ASM_SOURCES)
if("${ARCH}" MATCHES "x86_64")
set(ASM_SOURCES
${ASM_SOURCES}
src/arch/x86_64/CPU.asm
)
add_library(moon-asm STATIC ${ASM_SOURCES})
endif()
add_executable(moon ${SOURCES}) add_executable(moon ${SOURCES})
if("${ARCH}" MATCHES "x86_64") if("${ARCH}" MATCHES "x86_64")
set(ASM_SOURCES target_link_libraries(moon moon-asm)
src/arch/x86_64/CPU.asm
)
add_library(moon-asm STATIC ${ASM_SOURCES})
target_link_libraries(moon moon-asm)
endif() endif()
target_link_libraries(moon luna-freestanding) target_link_libraries(moon luna-freestanding)
@ -41,13 +48,16 @@ target_compile_options(moon PRIVATE -fno-asynchronous-unwind-tables -fno-omit-fr
target_compile_options(moon PRIVATE -nostdlib -mcmodel=kernel) target_compile_options(moon PRIVATE -nostdlib -mcmodel=kernel)
if("${ARCH}" MATCHES "x86_64") if("${ARCH}" MATCHES "x86_64")
target_compile_options(moon PRIVATE -mno-red-zone) target_compile_options(moon PRIVATE -mno-red-zone)
target_compile_options(moon PRIVATE -mno-80387 -mno-mmx -mno-sse -mno-sse2) target_compile_options(moon PRIVATE -mno-80387 -mno-mmx -mno-sse -mno-sse2)
target_link_options(moon PRIVATE -mno-red-zone)
endif() endif()
target_link_options(moon PRIVATE -lgcc -Wl,--build-id=none -z max-page-size=0x1000 -mcmodel=kernel) target_link_options(moon PRIVATE -lgcc -Wl,--build-id=none -z max-page-size=0x1000 -mcmodel=kernel)
if("${ARCH}" MATCHES "x86_64")
target_link_options(moon PRIVATE -mno-red-zone)
endif()
set_target_properties(moon PROPERTIES CXX_STANDARD 20) set_target_properties(moon PROPERTIES CXX_STANDARD 20)
target_include_directories(moon PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src) target_include_directories(moon PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)

View File

@ -1,5 +1,5 @@
#include "video/Framebuffer.h" #include "Framebuffer.h"
#include "boot/bootboot.h" #include "bootboot.h"
static u8* g_fb_ptr = nullptr; static u8* g_fb_ptr = nullptr;
static u32 g_fb_size; static u32 g_fb_size;

View File

@ -1,9 +1,9 @@
#include "boot/Init.h" #include "Init.h"
#include "Framebuffer.h"
#include "MemoryManager.h"
#include "arch/CPU.h" #include "arch/CPU.h"
#include "arch/Serial.h" #include "arch/Serial.h"
#include "boot/bootboot.h" #include "bootboot.h"
#include "memory/MemoryManager.h"
#include "video/Framebuffer.h"
#include <String.h> #include <String.h>
extern BOOTBOOT bootboot; extern BOOTBOOT bootboot;

View File

@ -1,7 +1,7 @@
#include "memory/MemoryManager.h" #include "MemoryManager.h"
#include "arch/MMU.h" #include "arch/MMU.h"
#include "arch/Serial.h" #include "arch/Serial.h"
#include "boot/bootboot.h" #include "bootboot.h"
#include <Alignment.h> #include <Alignment.h>
#include <String.h> #include <String.h>
#include <Types.h> #include <Types.h>

View File

@ -1,5 +1,5 @@
#include "arch/MMU.h" #include "arch/MMU.h"
#include "memory/MemoryManager.h" #include "MemoryManager.h"
#include <String.h> #include <String.h>
#define PAGE_SIZE 4096 #define PAGE_SIZE 4096

View File

@ -1,5 +1,5 @@
/* /*
* boot/bootboot.h * bootboot.h
* https://gitlab.com/bztsrc/bootboot * https://gitlab.com/bztsrc/bootboot
* *
* Copyright (C) 2017 - 2021 bzt (bztsrc@gitlab) * Copyright (C) 2017 - 2021 bzt (bztsrc@gitlab)

View File

@ -1,9 +1,9 @@
#include "Framebuffer.h"
#include "Init.h"
#include "MemoryManager.h"
#include "arch/CPU.h" #include "arch/CPU.h"
#include "arch/MMU.h" #include "arch/MMU.h"
#include "arch/Serial.h" #include "arch/Serial.h"
#include "boot/Init.h"
#include "memory/MemoryManager.h"
#include "video/Framebuffer.h"
extern u8 fb[1]; extern u8 fb[1];