mirror of
https://github.com/kenshineto/kern.git
synced 2025-04-21 04:42:25 +00:00
16 lines
275 B
C
16 lines
275 B
C
#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);
|
|
}
|