2022-11-12 21:04:47 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#if defined(__is_libk)
|
|
|
|
#include <kernel/tty.h>
|
2022-11-15 21:42:14 +02:00
|
|
|
#include <kernel/panic.h>
|
2022-11-14 00:27:11 +02:00
|
|
|
#else
|
|
|
|
#include <stdlib.h>
|
2022-11-12 21:04:47 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
int putchar(int c)
|
|
|
|
{
|
|
|
|
#if defined(__is_libk)
|
2022-11-15 21:42:14 +02:00
|
|
|
Kernel::panic("Please use kprint() instead of stdio");
|
2022-11-12 21:04:47 +02:00
|
|
|
char ch = (char)c;
|
|
|
|
terminal_write(&ch, sizeof(ch));
|
|
|
|
#else
|
2022-11-14 00:27:11 +02:00
|
|
|
abort();
|
2022-11-12 21:04:47 +02:00
|
|
|
#endif
|
|
|
|
return c;
|
|
|
|
}
|