syscall: implement write syscall

This commit is contained in:
Michael Shaw 2023-11-22 23:27:39 -05:00
commit 3dda839cdd
12 changed files with 176 additions and 22 deletions

View file

@ -11,6 +11,10 @@
#define PROC_STOPPED 1
#define PROC_BLOCKED 2
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
typedef int64_t pid_t;
struct procregs {
@ -44,6 +48,7 @@ struct proc {
uint64_t pid;
uint64_t ppid;
uint64_t cr3;
spinlock_t lock;
bool is_kernel;
uint8_t state;

9
include/kernel/syscall.h Normal file
View file

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _SYSCALL_H_
#define _SYSCALL_H_
#define SYS_READ 0
#define SYS_WRITE 1
#define SYS_EXIT 60
#endif /* _SYSCALL_H_ */