Files
pepperOS/src/io/term/term.c

38 lines
756 B
C

/*
* @author xamidev <xamidev@riseup.net>
* @brief Framebuffer-based terminal driver
* @license GPL-3.0-only
*/
// Terminal output
/*
There are a couple of bugs here and there but for now I don't care too much
because this shitty implementation will be replaced one day by Flanterm
(once memory management is okay: paging & kernel malloc)
*/
#include <stddef.h>
#include <kernel.h>
#include "term.h"
#include "config.h"
#include "flanterm.h"
extern struct flanterm_context* ft_ctx;
// Overhead that could be avoided, right? (for printf)
void _putchar(char character)
{
flanterm_write(ft_ctx, &character, 1);
}
// Debug-printing
void kputs(const char* str)
{
size_t i=0;
while (str[i] != 0)
{
_putchar(str[i]);
i++;
}
_putchar('\r');
}