feat(serial): call init_serial in main

Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
Julien CLEMENT 2021-07-13 06:31:28 +02:00
parent e92cc8877f
commit 2fd5c536e0
3 changed files with 5 additions and 3 deletions

4
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];

@ -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

@ -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 */