add sys_printchar
This commit is contained in:
@@ -110,6 +110,10 @@ void syscall(struct trapframe *tf) {
|
||||
thread_exit();
|
||||
break;
|
||||
|
||||
case SYS_printchar:
|
||||
err = sys_printchar((char)tf->tf_a0);
|
||||
break;
|
||||
|
||||
/* Add stuff here */
|
||||
|
||||
default:
|
||||
|
||||
@@ -379,6 +379,7 @@ file vfs/devnull.c
|
||||
file syscall/loadelf.c
|
||||
file syscall/runprogram.c
|
||||
file syscall/time_syscalls.c
|
||||
file syscall/printchar.c
|
||||
|
||||
#
|
||||
# Startup and initialization
|
||||
|
||||
@@ -94,6 +94,7 @@
|
||||
// #define SYS_getpriority 38
|
||||
// #define SYS_setpriority 39
|
||||
// (process groups, sessions, and job control)
|
||||
#define SYS_printchar 41
|
||||
// #define SYS_getpgid 40
|
||||
// #define SYS_setpgid 41
|
||||
// #define SYS_getsid 42
|
||||
|
||||
@@ -57,4 +57,6 @@ __DEAD void enter_new_process(int argc, userptr_t argv, userptr_t env,
|
||||
int sys_reboot(int code);
|
||||
int sys___time(userptr_t user_seconds, userptr_t user_nanoseconds);
|
||||
|
||||
int sys_printchar(char c);
|
||||
|
||||
#endif /* _SYSCALL_H_ */
|
||||
|
||||
7
kern/syscall/printchar.c
Normal file
7
kern/syscall/printchar.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <types.h>
|
||||
#include <lib.h>
|
||||
#include <syscall.h>
|
||||
int sys_printchar(char c) {
|
||||
kprintf("%c", c);
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user