Basic Console Frontend¶
The basic console frontend is implemented in
os/drivers/console/basic_console.c.
This console frontend provides an interface for higher-level abstractions, like, hopefully, the virtual terminal layer, and other things in the kernel that need to print text to the sreen, like, e.g., printk. For output to the screen it uses the console backend that has been registered to the console subsystem, beforehand.
Initialization¶
This driver is initialized by calling
-
void basic_console_init(void)¶
Initialize the console frontend.
Allocating a Basic Console¶
A new instance of the basic console is allocated by calling
-
console_t *basic_console_alloc(void)¶
Allocate and return a new instance of a basic console.
Allocating a basic console in turn allocates a new console datastructure (console_t). The provided console operations are stored in the console data structure.
- Returns:
A pointer to the newly allocated console.
Console Operations¶
This frontend implements the console operation:
Write¶
Implements
of struct console_operations_t
(documentation):
Helper Functions¶
This frontend uses helper functions to wrap some of the tasks handled by the write operation:
-
static void __basic_con_newline(console_t *con)¶
Perform a carriage return, newline on the console
con.
-
static void __basic_con_putc(console_t *con, const char *c)¶
Write a character
cto the consolecon.