Kernel: Rework syscall calling

I removed the intermediate function when calling syscalls. Now syscall
handler calls the current process automatically. Only exception is
sys_fork, since it needs a assembly trampoline for the new thread.
This commit is contained in:
Bananymous
2023-06-12 14:16:48 +03:00
parent 2253c45feb
commit 23543b15ca
6 changed files with 200 additions and 399 deletions

View File

@@ -121,7 +121,7 @@ namespace IDT
if (tid && Kernel::Thread::current().is_userspace() && !Kernel::Thread::current().is_in_syscall())
{
auto message = BAN::String::formatted("{}, aborting\n", isr_exceptions[isr]);
(void)Kernel::Process::current().write(STDERR_FILENO, message.data(), message.size());
(void)Kernel::Process::current().sys_write(STDERR_FILENO, message.data(), message.size());
asm volatile("sti");
Kernel::Process::current().exit(1);
}