From 8e933fac9fd068343bb602f13175c8d70a6c5768 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Wed, 1 Aug 2018 02:27:57 +1000 Subject: Defined EOF as -1 in stdio.h. Implemented the sprintf() library function in lib/stdio.c which uses the vsprintf() function. Implemented a very primative controlling TTY for each process. This is achieved by a switch in the sys_puts system call which uses the 'ctty' element of the process' task structure to determine an appropriate I/O channel. A negative ctty value doesn't equate to any I/O channel effectively disabling the process' output. Added the sys_ctty system call which allows a process to set it's own ctty value. Removed the sys_rsputs system call. Output to serial is now performed by the process first setting it's ctty value to 1, then invoking sys_puts. --- include/unistd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/unistd.h') diff --git a/include/unistd.h b/include/unistd.h index 30d41c6..746c829 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -10,9 +10,9 @@ typedef uint16_t pid_t; #define __SYS_getpid 2 #define __SYS_getpdir 3 #define __SYS_signal 4 -#define __SYS_rsputs 5 -#define __SYS_alarm 6 -#define __SYS_pause 7 +#define __SYS_alarm 5 +#define __SYS_pause 6 +#define __SYS_ctty 7 #define _syscall0(type, name) \ type name(void) { \ -- cgit v1.3