CeDOS - Commit 8307c706

kernel: Make stdout for applications configurable Signed-off-by: Celina Sophie Kalus <hello@celinakalus.de>
Celina Sophie Kalus
Wed, 23 Jul 2025 21:14:57 +0200
2 files changed, 9 insertions(+), 1 deletions(-)
M CMakeLists.txtCMakeLists.txt

@@ -41,6 +41,8 @@ )

add_compile_options(-DVERSION="${GIT_VERSION}") add_compile_options(-Wall -Wextra -Werror) +set(CEDOS_TTY_CON vga_con) + list(APPEND COMMON_SRC common/memory.c common/string.c

@@ -149,6 +151,10 @@

target_include_directories(kernel.elf PRIVATE kernel/ common/ +) + +target_compile_options(kernel.elf PRIVATE + -DCEDOS_TTY_CON=${CEDOS_TTY_CON} ) cedos_linker_script(kernel.elf ${CMAKE_SOURCE_DIR}/kernel/link.txt)
M kernel/drivers/tty.ckernel/drivers/tty.c

@@ -5,6 +5,8 @@

#include "drivers/console.h" #include "drivers/keyboard.h" +const CON_DRIVER *tty_con = &CEDOS_TTY_CON; + file_operations_t tty_fops = { tty_open, /* open */ tty_openat, /* openat */

@@ -72,7 +74,7 @@

ssize_t tty_write(file_t *file, const char *buffer, size_t size) { (void)file; - vga_con.write_n(buffer, size); + tty_con->write_n(buffer, size); return size; }