Compare commits
3 Commits
c425d6e389
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a14d0173c8 | |||
| bd6872d672 | |||
| 2ca7a34a22 |
+2
-4
@@ -1,10 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.31)
|
||||
project(magenta C ASM)
|
||||
|
||||
if (NOT BUILD_TOOLS_DIR)
|
||||
message(FATAL_ERROR "No build tools directory specified. Please run build.sh")
|
||||
endif ()
|
||||
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
|
||||
set(kernel_arch x86_64)
|
||||
@@ -85,3 +81,5 @@ target_include_directories(magenta_debug PRIVATE
|
||||
libc/include
|
||||
libmagenta/include
|
||||
arch/${kernel_arch}/include)
|
||||
|
||||
install(TARGETS ${kernel_exe_name} DESTINATION boot)
|
||||
|
||||
@@ -93,6 +93,8 @@ kern_status_t ml_thread_clone_user_context(
|
||||
memcpy(regs, src_regs, sizeof *regs);
|
||||
|
||||
regs->rax = return_value;
|
||||
regs->ss = 0x1b;
|
||||
regs->cs = 0x23;
|
||||
|
||||
dest_ml->tr_fsbase = src_ml->tr_fsbase;
|
||||
dest_ml->tr_gsbase = src_ml->tr_gsbase;
|
||||
|
||||
@@ -2,3 +2,4 @@ file(GLOB sources *.c *.h include/magenta/debug/*.h)
|
||||
|
||||
add_library(magenta_debug STATIC ${sources})
|
||||
target_include_directories(magenta_debug PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_compile_options(magenta_debug PRIVATE -ffreestanding -nostdlib)
|
||||
|
||||
+2
-2
@@ -286,8 +286,8 @@ kern_status_t ringbuf_write(
|
||||
kern_status_t status = KERN_OK;
|
||||
|
||||
while (remaining > 0) {
|
||||
void *dest;
|
||||
size_t available;
|
||||
void *dest = NULL;
|
||||
size_t available = 0;
|
||||
wait_for_capacity(buf, irq_flags);
|
||||
|
||||
status = ringbuf_open_write_buffer(buf, &dest, &available);
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
file(GLOB headers ${CMAKE_CURRENT_SOURCE_DIR}/include/magenta/*.h)
|
||||
cmake_minimum_required(VERSION 3.31)
|
||||
project(libmagenta C ASM)
|
||||
|
||||
file(GLOB headers
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/magenta/*.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include-user/magenta/*.h)
|
||||
file(GLOB asm_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/arch/${CMAKE_SYSTEM_PROCESSOR}/*.S)
|
||||
|
||||
@@ -6,7 +11,14 @@ set(public_include_dirs
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include-user)
|
||||
|
||||
add_library(libmagenta STATIC ${asm_sources})
|
||||
add_library(libmagenta STATIC ${asm_sources} ${headers})
|
||||
target_include_directories(libmagenta PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include-user)
|
||||
target_compile_options(libmagenta PRIVATE -ffreestanding -nostdlib)
|
||||
|
||||
set_target_properties(libmagenta PROPERTIES
|
||||
PREFIX "")
|
||||
|
||||
install(TARGETS libmagenta)
|
||||
install(FILES ${headers} DESTINATION include/magenta)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
file(GLOB sources *.c *.h)
|
||||
|
||||
add_executable(e64patch ${sources})
|
||||
|
||||
install(TARGETS e64patch)
|
||||
|
||||
Reference in New Issue
Block a user