MOS Source Code
Loading...
Searching...
No Matches
console.c File Reference
#include "mos/tasks/signal.h"
#include "mos/tasks/thread.h"
#include <limits.h>
#include <mos/device/console.h>
#include <mos/io/io.h>
#include <mos/lib/structures/list.h>
#include <mos/lib/structures/ring_buffer.h>
#include <mos/syslog/printk.h>
#include <mos/tasks/schedule.h>
#include <mos/tasks/wait.h>
#include <mos_string.h>
+ Include dependency graph for console.c:

Go to the source code of this file.

Functions

static size_t console_io_read (io_t *io, void *data, size_t size)
 
static size_t console_io_write (io_t *io, const void *data, size_t size)
 
void console_register (console_t *con)
 
console_tconsole_get (const char *name)
 
console_tconsole_get_by_prefix (const char *prefix)
 
size_t console_write (console_t *con, const char *data, size_t size)
 
size_t console_write_color (console_t *con, const char *data, size_t size, standard_color_t fg, standard_color_t bg)
 
void console_putc (console_t *con, u8 c)
 

Variables

list_head consoles = LIST_HEAD_INIT(consoles)
 
static const io_op_t console_io_ops
 

Function Documentation

◆ console_io_read()

static size_t console_io_read ( io_t * io,
void * data,
size_t size )
static

Definition at line 18 of file console.c.

+ Here is the call graph for this function:

◆ console_io_write()

static size_t console_io_write ( io_t * io,
const void * data,
size_t size )
static

Definition at line 55 of file console.c.

◆ console_register()

void console_register ( console_t * con)

Definition at line 71 of file console.c.

Referenced by limine_entry(), and platform_startup_early().

+ Here is the call graph for this function:

◆ console_get()

console_t * console_get ( const char * name)

Definition at line 101 of file console.c.

Referenced by MOS_SETUP().

+ Here is the call graph for this function:

◆ console_get_by_prefix()

console_t * console_get_by_prefix ( const char * prefix)

Definition at line 114 of file console.c.

Referenced by MOS_SETUP().

+ Here is the call graph for this function:

◆ console_write()

size_t console_write ( console_t * con,
const char * data,
size_t size )

Definition at line 124 of file console.c.

◆ console_write_color()

size_t console_write_color ( console_t * con,
const char * data,
size_t size,
standard_color_t fg,
standard_color_t bg )

Definition at line 132 of file console.c.

Referenced by print_to_console().

◆ console_putc()

void console_putc ( console_t * con,
u8 c )

Definition at line 148 of file console.c.

Referenced by serial_console_irq_handler().

+ Here is the call graph for this function:

Variable Documentation

◆ consoles

list_head consoles = LIST_HEAD_INIT(consoles)

Definition at line 16 of file console.c.

Referenced by console_get(), console_get_by_prefix(), console_register(), and lvprintk().

◆ console_io_ops

const io_op_t console_io_ops
static
Initial value:
= {
.read = console_io_read,
.write = console_io_write,
}
static size_t console_io_read(io_t *io, void *data, size_t size)
Definition console.c:18
static size_t console_io_write(io_t *io, const void *data, size_t size)
Definition console.c:55

Definition at line 66 of file console.c.

Referenced by console_register().