From dc862c6346ac0d762d98cee9bcb5ed09dd5e3066 Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Sun, 17 Jun 2018 06:13:33 +1000 Subject: Cleaned up console I/O functions in con.c and con.h respectively. --- kernel/con.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'kernel/con.c') diff --git a/kernel/con.c b/kernel/con.c index b3d2b9d..3b48de1 100644 --- a/kernel/con.c +++ b/kernel/con.c @@ -1,7 +1,7 @@ /* * con.c * - * Basic VGA text console + * Basic VGA text console. Implements printf() and puts(). */ #include @@ -58,7 +58,7 @@ void con_init(void) { } /* write a zero-terminated string to console */ -void con_print(char *s) { +int puts(char *s) { uint8_t *p = &vram[pos]; while(*s) { @@ -80,6 +80,9 @@ void con_print(char *s) { /* update the cursor position */ cursorpos(pos); + + /* this always succeeds */ + return 0; } int printf(char *fmt, ...) { @@ -91,6 +94,6 @@ int printf(char *fmt, ...) { ret = vsprintf(buf, fmt, ap); va_end(ap); - con_print(buf); + puts(buf); return ret; } -- cgit v1.3