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

#include <console.hpp>

Inheritance diagram for Console:
Collaboration diagram for Console:

Classes

struct  reader

Public Member Functions

template<size_t buf_size>
 Console (mos::string_view name, ConsoleCapFlags caps, Buffer< buf_size > *readBuf, StandardColor fg, StandardColor bg)
virtual ~Console ()=default
void Register ()
size_t Write (const char *data, size_t size)
size_t WriteColored (const char *data, size_t size, StandardColor fg, StandardColor bg)
void putc (u8 c)
virtual size_t on_read (void *, size_t) override
virtual size_t on_write (const void *, size_t) override
virtual void on_closed () override
virtual mos::string name () const override
Public Member Functions inherited from IO
 IO (IOFlags flags, io_type_t type)
virtual ~IO ()=0
IOref ()
IOunref ()
virtual off_t seek (off_t, io_seek_whence_t) final
virtual off_t tell () final
virtual size_t read (void *buf, size_t count) final
virtual size_t pread (void *buf, size_t count, off_t offset) final
virtual size_t write (const void *buf, size_t count) final
virtual bool VerifyMMapPermissions (VMFlags flags, bool is_private) final
bool map (vmap_t *vmap, off_t offset)
bool unmap (vmap_t *vmap, bool *unmapped)

Public Attributes

StandardColor fg
StandardColor bg
Public Attributes inherited from IO
const IOFlags io_flags = IO_NONE
const io_type_t io_type = IO_NULL

Private Member Functions

virtual bool clear ()=0
virtual bool set_color (StandardColor fg, StandardColor bg)=0
virtual size_t do_write (const char *data, size_t size)=0
 Console (mos::string_view name, ConsoleCapFlags caps, StandardColor default_fg, StandardColor default_bg)

Private Attributes

const ConsoleCapFlags caps
const StandardColor default_fg = White
const StandardColor default_bg = Black
struct Console::reader reader
struct { 
   spinlock_t   lock 
writer
mos::string_view conName = "<unnamed>"
waitlist_t waitlist

Additional Inherited Members

Static Public Member Functions inherited from IO
static bool IsValid (const IO *io)

Detailed Description

Definition at line 34 of file console.hpp.

Constructor & Destructor Documentation

◆ Console() [1/2]

template<size_t buf_size>
Console ( mos::string_view name,
ConsoleCapFlags caps,
Buffer< buf_size > * readBuf,
StandardColor fg,
StandardColor bg )
inline

Definition at line 40 of file console.hpp.

Referenced by Console(), and SerialConsole::SerialConsole().

Here is the call graph for this function:

◆ ~Console()

virtual ~Console ( )
virtualdefault

◆ Console() [2/2]

Console ( mos::string_view name,
ConsoleCapFlags caps,
StandardColor default_fg,
StandardColor default_bg )
private

Definition at line 42 of file console.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ Register()

void Register ( )

Definition at line 51 of file console.cpp.

◆ Write()

size_t Write ( const char * data,
size_t size )

Definition at line 76 of file console.cpp.

◆ WriteColored()

size_t WriteColored ( const char * data,
size_t size,
StandardColor fg,
StandardColor bg )

Definition at line 58 of file console.cpp.

Referenced by print_to_console().

Here is the call graph for this function:

◆ putc()

void putc ( u8 c)

Definition at line 125 of file console.cpp.

Referenced by SerialConsole::handle_irq().

Here is the call graph for this function:

◆ clear()

virtual bool clear ( )
privatepure virtual

Implemented in SerialConsole.

◆ set_color()

virtual bool set_color ( StandardColor fg,
StandardColor bg )
privatepure virtual

Implemented in SerialConsole.

Referenced by on_write(), and WriteColored().

◆ do_write()

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

Implemented in SerialConsole.

Here is the call graph for this function:

◆ on_read()

size_t on_read ( void * data,
size_t size )
overridevirtual

Reimplemented from IO.

Definition at line 83 of file console.cpp.

Here is the call graph for this function:

◆ on_write()

size_t on_write ( const void * data,
size_t size )
overridevirtual

Reimplemented from IO.

Definition at line 117 of file console.cpp.

Here is the call graph for this function:

◆ on_closed()

void on_closed ( )
overridevirtual

Implements IO.

Definition at line 148 of file console.cpp.

◆ name()

mos::string name ( ) const
overridevirtual

Reimplemented from IO.

Definition at line 143 of file console.cpp.

Referenced by Console(), Console(), do_write(), and SerialConsole::SerialConsole().

Member Data Documentation

◆ fg

◆ bg

◆ caps

const ConsoleCapFlags caps
private

◆ default_fg

const StandardColor default_fg = White
private

Definition at line 76 of file console.hpp.

Referenced by Console(), do_write(), and on_write().

◆ default_bg

const StandardColor default_bg = Black
private

Definition at line 76 of file console.hpp.

Referenced by Console(), do_write(), and on_write().

◆ reader

struct Console::reader reader
private

◆ lock

spinlock_t lock

Definition at line 88 of file console.hpp.

◆ [struct]

struct { ... } writer

Referenced by on_write(), Write(), and WriteColored().

◆ conName

mos::string_view conName = "<unnamed>"
private

Definition at line 91 of file console.hpp.

Referenced by Console(), name(), on_closed(), and on_read().

◆ waitlist

waitlist_t waitlist
private

Definition at line 92 of file console.hpp.

Referenced by on_read(), and putc().


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