summaryrefslogtreecommitdiff
path: root/kernel/io/io.c
blob: 11acfdb683f16bbf2405cb8aca6075f194e244b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <lib.h>
#include <stdio.h>
#include <comus/asm.h>

#define PORT 0x3F8
static void serial_out(uint8_t ch) {
	// wait for output to be free
	while ((inb(PORT + 5) & 0x20) == 0);
	outb(PORT, ch);
}

void fputc(FILE *stream, char c) {
	(void) stream;

	serial_out(c);
}