Console utilities and configuration.
More...
#include <limine/limine.h>
#include <stddef.h>
#include <stdbool.h>
#include <lib/kstring.h>
#include <lib/color.h>
Go to the source code of this file.
|
| | The PSF1 font header structure. More...
|
| | The PSF2 font header structure. More...
|
| struct | console |
| | Console structure, holds all the information about the console. More...
|
|
| bool | get_console_status (void) |
| | Returns the status of the console (initialized or uninitialized).
|
| void | console_init (void) |
| | Initializes the console struct and fills all the properties.
|
| void | console_clear (void) |
| | Clears the console (fills with bg color).
|
| void | draw_char (char c, uint8_t col, uint8_t row) |
| | Draws a character to the console.
|
| void | console_putc (char c) |
| | Arranges the cursor and prints characters.
|
| void | console_puts (char *str) |
| | Prints a non-formatted string.
|
| void | scroll_up (void) |
| | Scrolls the whole console up.
|
| void | console_print_int (uint64_t value) |
| | Prints an int to the console.
|
| void | set_bg_color (struct rgb color) |
| | Sets the background colour.
|
| void | set_fg_color (struct rgb color) |
| | Sets the foreground colour.
|
| struct rgb | get_default_bg_color (void) |
| | Gets the default bg colour.
|
| struct rgb | get_default_fg_color (void) |
| | Gets the default fg colour.
|
| struct rgb | get_bg_color (void) |
| | Gets the current bg colour.
|
| struct rgb | get_fg_color (void) |
| | Gets the current fg colour.
|
| void | fill32 (uint32_t *dest, uint32_t value, size_t count) |
| | Fills 32 bytes count times starting at dest with value.
|
|
|
uint8_t | _binary_font_psf_start [] |
|
uint8_t | _binary_font_psf_end [] |
Console utilities and configuration.
- Author
- Matheus Boscariol
- Since
- 30/10/2026
- Copyright
- (c) 2026 Matheus Boscariol. Licensed under GNU AGPL-3.0.
Definition in file console.h.
◆ FONT_PSF1
◆ FONT_PSF2
◆ console_clear()
| void console_clear |
( |
void | | ) |
|
Clears the console (fills with bg color).
Definition at line 235 of file console.c.
◆ console_init()
| void console_init |
( |
void | | ) |
|
Initializes the console struct and fills all the properties.
Definition at line 68 of file console.c.
◆ console_print_int()
| void console_print_int |
( |
uint64_t | value | ) |
|
◆ console_putc()
| void console_putc |
( |
char | c | ) |
|
Arranges the cursor and prints characters.
- Parameters
-
Definition at line 178 of file console.c.
◆ console_puts()
| void console_puts |
( |
char * | str | ) |
|
◆ draw_char()
| void draw_char |
( |
char | c, |
|
|
uint8_t | col, |
|
|
uint8_t | row ) |
Draws a character to the console.
- Parameters
-
| c | Character to draw |
| col | Column to draw it in |
| row | Row to draw it in |
Definition at line 111 of file console.c.
◆ fill32()
| void fill32 |
( |
uint32_t * | dest, |
|
|
uint32_t | value, |
|
|
size_t | count ) |
Fills 32 bytes count times starting at dest with value.
- Parameters
-
| dest | The address of the starting destination |
| value | The value to fill |
| count | The amount of times to fill |
Definition at line 172 of file console.c.
◆ get_bg_color()
| struct rgb get_bg_color |
( |
void | | ) |
|
Gets the current bg colour.
- Returns
- The current bg colour
Definition at line 105 of file console.c.
◆ get_console_status()
| bool get_console_status |
( |
void | | ) |
|
Returns the status of the console (initialized or uninitialized).
- Returns
- The console status
Definition at line 23 of file console.c.
◆ get_default_bg_color()
| struct rgb get_default_bg_color |
( |
void | | ) |
|
Gets the default bg colour.
- Returns
- The default bg colour
Definition at line 108 of file console.c.
◆ get_default_fg_color()
| struct rgb get_default_fg_color |
( |
void | | ) |
|
Gets the default fg colour.
- Returns
- The default fg colour
Definition at line 109 of file console.c.
◆ get_fg_color()
| struct rgb get_fg_color |
( |
void | | ) |
|
Gets the current fg colour.
- Returns
- The current fg colour
Definition at line 106 of file console.c.
◆ scroll_up()
Scrolls the whole console up.
Definition at line 28 of file console.c.
◆ set_bg_color()
| void set_bg_color |
( |
struct rgb | color | ) |
|
Sets the background colour.
- Parameters
-
| color | The colour to set the bg to |
Definition at line 102 of file console.c.
◆ set_fg_color()
| void set_fg_color |
( |
struct rgb | color | ) |
|
Sets the foreground colour.
- Parameters
-
| color | The colour to set the fg to |
Definition at line 103 of file console.c.