feat(serial): call init_serial in main
Signed-off-by: Julien CLEMENT <julien.clement@epita.fr>
This commit is contained in:
parent
e92cc8877f
commit
2fd5c536e0
4
k/k.c
4
k/k.c
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include "multiboot.h"
|
#include "multiboot.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
#include "serial.h"
|
||||||
|
|
||||||
void k_main(unsigned long magic, multiboot_info_t *info)
|
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 star[4] = "|/-\\";
|
||||||
char *fb = (void *)0xb8000;
|
char *fb = (void *)0xb8000;
|
||||||
|
|
||||||
|
init_serial();
|
||||||
|
|
||||||
printf("bonjour\r\n");
|
printf("bonjour\r\n");
|
||||||
for (unsigned i = 0; ; ) {
|
for (unsigned i = 0; ; ) {
|
||||||
*fb = star[i++ % 4];
|
*fb = star[i++ % 4];
|
||||||
|
@ -12,7 +12,7 @@ void set_baud_rate(void)
|
|||||||
outb(COM1 + 3, line_control_register);
|
outb(COM1 + 3, line_control_register);
|
||||||
}
|
}
|
||||||
|
|
||||||
void serial_init(void)
|
void init_serial(void)
|
||||||
{
|
{
|
||||||
outb(COM1 + 3, NO_PARITY | EIGHT_BITS_LENGTH);
|
outb(COM1 + 3, NO_PARITY | EIGHT_BITS_LENGTH);
|
||||||
outb(COM1 + 2, FIFO | TRIGGER_LVL_14 | CLEAR_TRANSMIT_FIFO
|
outb(COM1 + 2, FIFO | TRIGGER_LVL_14 | CLEAR_TRANSMIT_FIFO
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#define EMPTY_TRANSMITTER (0x1 << 5)
|
#define EMPTY_TRANSMITTER (0x1 << 5)
|
||||||
|
|
||||||
void serial_init(void);
|
void init_serial(void);
|
||||||
int write(const char *buf, size_t count);
|
int write(const char *buf, size_t count);
|
||||||
|
|
||||||
#endif /* SERIAL_H */
|
#endif /* SERIAL_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user