/* * @author xamidev * @brief System call handling * @license GPL-3.0-only */ #include "sched/scheduler.h" #include #include #include #include void sys_write(unsigned int fd, const char* buf, size_t count) { switch (fd) { case 1: //stdout for (size_t i=0; i - CPU state after system call */ struct cpu_status* syscall_handler(struct cpu_status* regs) { DEBUG("Syscall %lx with (arg0=%lx arg1=%lx)", regs->rax, regs->rdi, regs->rsi); switch (regs->rax) { case 0: //sys_read break; case 1: //sys_write sys_write(regs->rdi, (char*)regs->rsi, regs->rdx); break; default: regs->rax = 0xbad515ca11; break; } return regs; }