From 2fd5c536e0b758272df94dae4bcf04889b8451af Mon Sep 17 00:00:00 2001 From: Julien CLEMENT Date: Tue, 13 Jul 2021 06:31:28 +0200 Subject: [PATCH] feat(serial): call init_serial in main Signed-off-by: Julien CLEMENT --- k/k.c | 4 +++- k/serial.c | 2 +- k/serial.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/k/k.c b/k/k.c index 6b26173..5480228 100644 --- a/k/k.c +++ b/k/k.c @@ -25,7 +25,7 @@ #include "multiboot.h" #include "stdio.h" - +#include "serial.h" void k_main(unsigned long magic, multiboot_info_t *info) { @@ -35,6 +35,8 @@ void k_main(unsigned long magic, multiboot_info_t *info) char star[4] = "|/-\\"; char *fb = (void *)0xb8000; + init_serial(); + printf("bonjour\r\n"); for (unsigned i = 0; ; ) { *fb = star[i++ % 4]; diff --git a/k/serial.c b/k/serial.c index 79cab30..9877f6f 100644 --- a/k/serial.c +++ b/k/serial.c @@ -12,7 +12,7 @@ void set_baud_rate(void) outb(COM1 + 3, line_control_register); } -void serial_init(void) +void init_serial(void) { outb(COM1 + 3, NO_PARITY | EIGHT_BITS_LENGTH); outb(COM1 + 2, FIFO | TRIGGER_LVL_14 | CLEAR_TRANSMIT_FIFO diff --git a/k/serial.h b/k/serial.h index 65e83c1..e193f8d 100644 --- a/k/serial.h +++ b/k/serial.h @@ -20,7 +20,7 @@ #define EMPTY_TRANSMITTER (0x1 << 5) -void serial_init(void); +void init_serial(void); int write(const char *buf, size_t count); #endif /* SERIAL_H */