summaryrefslogtreecommitdiff
path: root/kernel/vsprintf.c
AgeCommit message (Collapse)Author
2018-07-08Added a printf() function to the library under stdio.c which uses theJake Mannens
vsprintf() function to render formatted strings and then the puts system call to output them. Moved the vsprintf() function from the kernel to the library. Furthermore, the prototype for the function has been moved from the kernel's headers, to the new header file stdio.h. Renamed the kernel's internal printf() function to printk() in order to avoid confusion with the library provided function. Renamed the sys_print system call to the more appropriate name, sys_puts. Added a new system call sys_time, which returns the system's uptime in seconds. This is mainly for testing the userspace binary and will not be permanent. Added the file time.c to the library which contains the caller for sys_time and a helper routine sleep() which delays execution for the specified number of seconds. The new header file time.h contains prototypes for both these functions as well as the definition for the type time_t. Fixed a bug in which the value of EAX was not properly passed to the system call handler, resulting in the wrong system call being executed. This was caused by the code in the SAVE macro not properly preserving the value. Fixed a bug in which the value of EAX was not preserved during a return from system call, but rather restored with the original EAX value prior to the call. As a result, system call return codes were not properly passed. This has been corrected by introducing a new macro RESTORE_SYS which carries out the same restore operations, but maintains EAX prior to the return.
2018-06-23Corrected a bug in vsprintf where zeros following any digit greater thanJake Mannens
a zero were not printed (affecting %x).
2018-06-18Added interpretation of the '%' conversion specifier which acts as anJake Mannens
escape sequence printing a literal '%'. Added the 'X' conversion specifier which differs from the 'x' specifier in that resulting letters are converted to uppercase. Added interpretation of the '#' alt flag which now causes the '0x' prefix to be added to every hex conversion.
2018-06-17Added zero padding and field width interpretation to vsprintf.Jake Mannens
2018-06-17Added basic implmementation of %x to vsprintf.Jake Mannens
2018-06-17Fixed a bug where if multiple %s parameters were passed to vsprintf,Jake Mannens
trailing 's' characters were appended to subsequent strings.
2018-06-17Added %s to vsprintfJake Mannens
2018-06-16Initial commitJake Mannens