Luna/kernel/src/arch/x86_64/Serial.cpp
2023-01-02 13:07:29 +01:00

16 lines
245 B
C++

#include "arch/Serial.h"
#include "arch/x86_64/IO.h"
#define COM1 0x3f8
static void serial_wait()
{
while (!(IO::inb(COM1 + 5) & 0x20)) { asm volatile("pause"); }
}
void Serial::putchar(u8 c)
{
serial_wait();
IO::outb(COM1, c);
}