From 49952320d625f579f1e82ce0fbea56518e29f21b Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 18 Mar 2023 20:12:59 +0100 Subject: [PATCH] kernel+libluna: Remove console_write entirely --- kernel/CMakeLists.txt | 1 - kernel/src/sys/console_write.cpp | 15 --------------- libluna/include/luna/Syscall.h | 4 ++-- 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 kernel/src/sys/console_write.cpp diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index b2f6977b..62e28e49 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -23,7 +23,6 @@ set(SOURCES src/thread/Scheduler.cpp src/sys/Syscall.cpp src/sys/exit.cpp - src/sys/console_write.cpp src/sys/clock_gettime.cpp src/sys/mmap.cpp src/sys/usleep.cpp diff --git a/kernel/src/sys/console_write.cpp b/kernel/src/sys/console_write.cpp deleted file mode 100644 index 4c00d560..00000000 --- a/kernel/src/sys/console_write.cpp +++ /dev/null @@ -1,15 +0,0 @@ -#include "memory/MemoryManager.h" -#include "sys/Syscall.h" -#include "video/TextConsole.h" - -Result sys_console_write(Registers*, SyscallArgs args) -{ - char* ptr = (char*)args[0]; - usize size = (usize)args[1]; - - if (!MemoryManager::validate_user_read(ptr, size)) return err(EFAULT); - - while (size--) { TextConsole::putchar(*ptr++); } - - return { 0 }; -} diff --git a/libluna/include/luna/Syscall.h b/libluna/include/luna/Syscall.h index a806f3d0..5dedba4c 100644 --- a/libluna/include/luna/Syscall.h +++ b/libluna/include/luna/Syscall.h @@ -1,8 +1,8 @@ #pragma once #define enumerate_syscalls(_e) \ - _e(exit) _e(console_write) _e(clock_gettime) _e(mmap) _e(munmap) _e(usleep) _e(open) _e(close) _e(read) _e(getpid) \ - _e(write) _e(lseek) _e(mkdir) _e(exec) _e(mknod) + _e(exit) _e(clock_gettime) _e(mmap) _e(munmap) _e(usleep) _e(open) _e(close) _e(read) _e(getpid) _e(write) \ + _e(lseek) _e(mkdir) _e(exec) _e(mknod) enum Syscalls {