diff options
-rw-r--r-- | arch/i386/serial.c | 7 | ||||
-rw-r--r-- | include/kernel/serial.h | 1 | ||||
-rw-r--r-- | kernel/init.c | 1 |
3 files changed, 9 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]); +} diff --git a/include/kernel/serial.h b/include/kernel/serial.h index 79d856b..a815766 100644 --- a/include/kernel/serial.h +++ b/include/kernel/serial.h @@ -4,5 +4,6 @@ int serial_init(void); char read_serial(void); void write_serial(char a); +void serial_writestring(const char *str); #endif diff --git a/kernel/init.c b/kernel/init.c index b808122..a7a71d6 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -5,5 +5,6 @@ void kernel_main(void) { tty_init(); serial_init(); + serial_writestring("Hello world\n"); printf("Hello world\n"); } |