diff options
Diffstat (limited to 'kernel/sys.c')
| -rw-r--r-- | kernel/sys.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index c2256c1..986c4dd 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -3,13 +3,28 @@ #include <kernel/sched.h> #include <signal.h> #include <stdint.h> +#include <stdio.h> #include <sys/types.h> #include <time.h> #include <unistd.h> int sys_puts(char *s) { - printk("[%04x] ", ctask->pid); - return printk(s); + char buf[8]; + sprintf(buf, "[%04x] ", ctask->pid); + + if(ctask->ctty < 0) + return EOF; + + switch(ctask->ctty) { + case 1: + rsputs(buf); + return rsputs(s); + break; + default: + printk("%s", buf); + return printk(s); + break; + } } time_t sys_time(void) { @@ -56,6 +71,12 @@ int sys_pause(void) { return -1; } +int sys_ctty(int ctty) { + ctask->ctty = ctty; + + return 0; +} + int sys_dummy(void) { return -ENOSYS; } |
