LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
console.c File Reference

Console utilities and configuration. More...

#include <limine/limine.h>
#include <stddef.h>
#include <stdbool.h>
#include <lib/kstring.h>
#include <lib/color.h>
#include <kernel/tests.h>
#include <drivers/console.h>
Include dependency graph for console.c:

Go to the source code of this file.

Functions

bool get_console_status (void)
 Returns the status of the console (initialized or uninitialized).
void scroll_up (void)
 Scrolls the whole console up.
void console_init (void)
 Initializes the console struct and fills all the properties.
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_bg_color (void)
 Gets the current bg colour.
struct rgb get_fg_color (void)
 Gets the current fg 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.
void draw_char (const char c, const uint8_t col, const uint8_t row)
 Draws a character to the console.
void fill32 (uint32_t *dest, uint32_t value, size_t count)
 Fills 32 bytes count times starting at dest with value.
void console_putc (char c)
 Arranges the cursor and prints characters.
void console_puts (char *str)
 Prints a non-formatted string.
void console_clear (void)
 Clears the console (fills with bg color).
void console_print_int (uint64_t value)
 Prints an int to the console.

Variables

int font_type
struct console main_console
 The main console info.
bool console_enabled = false

Detailed Description

Console utilities and configuration.

Author
Matheus Boscariol
Since
30/10/2026

Definition in file console.c.

Function Documentation

◆ console_clear()

void console_clear ( void )

Clears the console (fills with bg color).

Definition at line 235 of file console.c.

Here is the call graph for this function:

◆ 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)

Prints an int to the console.

Parameters
valueInt to print
Deprecated
Use kprintf()

Definition at line 246 of file console.c.

Here is the call graph for this function:

◆ console_putc()

void console_putc ( char c)

Arranges the cursor and prints characters.

Parameters
cThe character to put

Definition at line 178 of file console.c.

Here is the call graph for this function:

◆ console_puts()

void console_puts ( char * str)

Prints a non-formatted string.

Parameters
strString to print
Deprecated
Use kprintf()

Definition at line 219 of file console.c.

Here is the call graph for this function:

◆ draw_char()

void draw_char ( char c,
uint8_t col,
uint8_t row )

Draws a character to the console.

Parameters
cCharacter to draw
colColumn to draw it in
rowRow 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
destThe address of the starting destination
valueThe value to fill
countThe 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ scroll_up()

void scroll_up ( void )

Scrolls the whole console up.

Definition at line 28 of file console.c.

Here is the call graph for this function:

◆ set_bg_color()

void set_bg_color ( struct rgb color)

Sets the background colour.

Parameters
colorThe 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
colorThe colour to set the fg to

Definition at line 103 of file console.c.

Variable Documentation

◆ console_enabled

bool console_enabled = false

Definition at line 22 of file console.c.

◆ font_type

int font_type

Definition at line 17 of file console.c.

◆ main_console

struct console main_console

The main console info.

Definition at line 20 of file console.c.