Luna/kernel/src/arch/x86_64/Serial.cpp

15 lines
244 B
C++
Raw Normal View History

2022-11-13 09:30:10 +00:00
#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);
}