summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.xyz>2021-01-20 22:51:46 -0600
committerDanny Holman <dholman@gymli.xyz>2021-01-20 22:51:46 -0600
commitdd6656f7132d1727a055035ca94945fa4fbaae58 (patch)
tree4a9a7bf01d6fb582f1aaf7ead9de2af693aa2610 /arch
parentfd4bd4dabe8011b016e3f8e6c3de5cfe6bc1f41d (diff)
serial: add serial_writestring as a function
Add a function in the serial interface that writes an entire string to the serial line. Signed-off-by: Danny Holman <dholman@gymli.xyz>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/serial.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/i386/serial.c b/arch/i386/serial.c
index c1266bb..20bd8f9 100644
--- a/arch/i386/serial.c
+++ b/arch/i386/serial.c
@@ -1,4 +1,6 @@
#include <kernel/serial.h>
+#include <kernel/string.h>
+#include <stddef.h>
#include "pic.h"
#define PORT 0x3f8
@@ -38,3 +40,8 @@ void write_serial(char a) {
while (is_transmit_empty() == 0);
outb(PORT, a);
}
+
+void serial_writestring(const char *str) {
+ for (size_t i = 0; i < strlen(str); i++)
+ write_serial(str[i]);
+}