forked from xamidev/pepperOS
Function comments (v1)
This commit is contained in:
@@ -23,14 +23,22 @@ because this shitty implementation will be replaced one day by Flanterm
|
||||
extern struct flanterm_context* ft_ctx;
|
||||
extern struct init_status init;
|
||||
|
||||
// Overhead that could be avoided, right? (for printf)
|
||||
/*
|
||||
* _putchar - Writes a character to terminal
|
||||
* @character: character to write
|
||||
*/
|
||||
void _putchar(char character)
|
||||
{
|
||||
// TODO: Spinlock here (terminal access)
|
||||
flanterm_write(ft_ctx, &character, 1);
|
||||
}
|
||||
|
||||
// Debug-printing
|
||||
/*
|
||||
* kputs - Kernel puts
|
||||
* @str: String to write
|
||||
*
|
||||
* Writes a non-formatted string to terminal
|
||||
*/
|
||||
void kputs(const char* str)
|
||||
{
|
||||
size_t i=0;
|
||||
@@ -44,12 +52,26 @@ void kputs(const char* str)
|
||||
extern struct flanterm_context* ft_ctx;
|
||||
extern struct boot_context boot_ctx;
|
||||
|
||||
/*
|
||||
* flanterm_free_wrapper - free() wrapper for Flanterm
|
||||
* @ptr: pointer to free
|
||||
* @size: amount of bytes to free
|
||||
*
|
||||
* This function exists solely because the Flanterm initialization
|
||||
* function only accepts a free() function with a size parameter,
|
||||
* and the default one doesn't have it.
|
||||
*/
|
||||
void flanterm_free_wrapper(void* ptr, size_t size)
|
||||
{
|
||||
(void)size;
|
||||
kfree(ptr);
|
||||
}
|
||||
|
||||
/*
|
||||
* term_init - Video output/terminal initialization
|
||||
*
|
||||
* Uses Flanterm and the framebuffer given by Limine.
|
||||
*/
|
||||
void term_init()
|
||||
{
|
||||
uint32_t bgColor = 0x252525;
|
||||
|
||||
Reference in New Issue
Block a user