summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorJake Mannens <jake72360@gmail.com>2018-06-17 06:13:33 +1000
committerJake Mannens <jake72360@gmail.com>2018-06-17 06:13:33 +1000
commitdc862c6346ac0d762d98cee9bcb5ed09dd5e3066 (patch)
tree7a329d2c77f5d8ea9ee67c607fadd117d2efa788 /kernel
parent6a6f31db520177d15a604ebd77ec68b7fc94dce6 (diff)
Cleaned up console I/O functions in con.c and con.h respectively.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/con.c9
1 files changed, 6 insertions, 3 deletions
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 <asm/io.h>
@@ -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;
}