MOS Source Code
Loading...
Searching...
No Matches
Console Struct Referenceabstract

#include <console.hpp>

+ Inheritance diagram for Console:
+ Collaboration diagram for Console:

Public Member Functions

template<size_t buf_size>
 Console (const char *name, console_caps caps, Buffer< buf_size > *read_buf, standard_color_t default_fg, standard_color_t default_bg)
 
virtual ~Console ()=default
 
size_t write (const char *data, size_t size)
 
size_t write_color (const char *data, size_t size, standard_color_t fg, standard_color_t bg)
 
void putc (u8 c)
 
virtual bool extra_setup ()
 
virtual bool get_size (u32 *width, u32 *height)=0
 
virtual bool set_color (standard_color_t fg, standard_color_t bg)=0
 
virtual bool clear ()=0
 
virtual size_t do_write (const char *data, size_t size)=0
 

Public Attributes

 as_linked_list
 
io_t io
 
const char * name = "<unnamed>"
 
console_caps caps
 
waitlist_t waitlist
 
struct { 
 
   spinlock_t   lock 
 
   ring_buffer_pos_t   pos 
 
   u8 *   buf = nullptr 
 
   size_t   size = 0 
 
reader 
 
struct { 
 
   spinlock_t   lock 
 
writer 
 
standard_color_t fg
 
standard_color_t bg
 
standard_color_t default_fg = White
 
standard_color_t default_bg = Black
 

Detailed Description

Definition at line 33 of file console.hpp.

Constructor & Destructor Documentation

◆ Console()

template<size_t buf_size>
Console ( const char * name,
console_caps caps,
Buffer< buf_size > * read_buf,
standard_color_t default_fg,
standard_color_t default_bg )
inline

Definition at line 42 of file console.hpp.

Referenced by SerialConsole::SerialConsole().

+ Here is the call graph for this function:

◆ ~Console()

virtual ~Console ( )
virtualdefault

Member Function Documentation

◆ write()

size_t write ( const char * data,
size_t size )
inline

Definition at line 69 of file console.hpp.

◆ write_color()

size_t write_color ( const char * data,
size_t size,
standard_color_t fg,
standard_color_t bg )
inline

Definition at line 77 of file console.hpp.

Referenced by print_to_console().

+ Here is the call graph for this function:

◆ putc()

void putc ( u8 c)

Definition at line 21 of file console.cpp.

Referenced by SerialConsole::handle_irq().

+ Here is the call graph for this function:

◆ extra_setup()

virtual bool extra_setup ( )
inlinevirtual

Reimplemented in SerialConsole.

Definition at line 98 of file console.hpp.

Referenced by console_register().

◆ get_size()

virtual bool get_size ( u32 * width,
u32 * height )
pure virtual

Implemented in SerialConsole.

◆ set_color()

virtual bool set_color ( standard_color_t fg,
standard_color_t bg )
pure virtual

Implemented in SerialConsole.

Referenced by console_io_write(), and write_color().

◆ clear()

virtual bool clear ( )
pure virtual

Implemented in SerialConsole.

◆ do_write()

virtual size_t do_write ( const char * data,
size_t size )
pure virtual

Implemented in SerialConsole.

Referenced by console_io_write().

Member Data Documentation

◆ as_linked_list

as_linked_list

Definition at line 35 of file console.hpp.

◆ io

io_t io

Definition at line 36 of file console.hpp.

Referenced by console_register(), and mos_start_kernel().

◆ name

const char* name = "<unnamed>"

◆ caps

◆ waitlist

waitlist_t waitlist

Definition at line 39 of file console.hpp.

Referenced by Console(), console_io_read(), console_register(), and putc().

◆ lock

spinlock_t lock

Definition at line 54 of file console.hpp.

Referenced by console_io_read(), and console_io_write().

◆ pos

Definition at line 55 of file console.hpp.

Referenced by console_io_read(), and console_register().

◆ buf

u8* buf = nullptr

Definition at line 56 of file console.hpp.

Referenced by console_io_read(), console_register(), and SerialConsole::set_color().

◆ size

size_t size = 0

Definition at line 57 of file console.hpp.

Referenced by console_register(), do_write(), SerialConsole::do_write(), write(), and write_color().

◆ [struct]

struct { ... } reader

◆ [struct]

struct { ... } writer

◆ fg

◆ bg

◆ default_fg

standard_color_t default_fg = White

Definition at line 66 of file console.hpp.

Referenced by Console(), and console_io_write().

◆ default_bg

standard_color_t default_bg = Black

Definition at line 66 of file console.hpp.

Referenced by Console(), and console_io_write().


The documentation for this struct was generated from the following files: