FreeNOS
Data Structures | Macros | Functions
terminal

The terminal server provides the system console via input/output devices. More...

Data Structures

class  Terminal
 A Terminal enables user to interact with the system. More...
 

Macros

#define BANNER   "FreeNOS " RELEASE " [" ARCH "/" SYSTEM "] (" BUILDUSER "@" BUILDHOST ") (" COMPILER_VERSION ") " DATETIME "\r\n"
 Print this banner per default on new Terminals. More...
 
#define _SGR(x)   "\033[" #x "m"
 Set Graphic Rendition. More...
 

Functions

void bell (Terminal *term)
 Makes a sound (bell). More...
 
void putchar (Terminal *term, const teken_pos_t *pos, teken_char_t ch, const teken_attr_t *attr)
 Output a new character. More...
 
void cursor (Terminal *term, const teken_pos_t *pos)
 Sets the Terminal cursor. More...
 
void fill (Terminal *ctx, const teken_rect_t *rect, teken_char_t ch, const teken_attr_t *attr)
 Fills the Terminal buffer with a character. More...
 
void copy (Terminal *ctx, const teken_rect_t *rect, const teken_pos_t *pos)
 Copy bytes to the terminal. More...
 
void param (Terminal *ctx, int key, int value)
 Set terminal parameters. More...
 
void respond (Terminal *ctx, const void *buf, size_t size)
 Unused. More...
 

Terminal Colors

See also
http://en.wikipedia.org/wiki/ANSI_escape_code
#define BLACK   _SGR(30)
 
#define RED   _SGR(31)
 
#define GREEN   _SGR(32)
 
#define YELLOW   _SGR(33)
 
#define BLUE   _SGR(34)
 
#define MAGENTA   _SGR(35)
 
#define CYAN   _SGR(36)
 
#define WHITE   _SGR(37)
 
#define RESET   _SGR(39)
 

Detailed Description

The terminal server provides the system console via input/output devices.

Macro Definition Documentation

◆ _SGR

#define _SGR (   x)    "\033[" #x "m"

Set Graphic Rendition.

Definition at line 30 of file TerminalCodes.h.

◆ BANNER

#define BANNER   "FreeNOS " RELEASE " [" ARCH "/" SYSTEM "] (" BUILDUSER "@" BUILDHOST ") (" COMPILER_VERSION ") " DATETIME "\r\n"

Print this banner per default on new Terminals.

Definition at line 38 of file Terminal.h.

◆ BLACK

#define BLACK   _SGR(30)

Definition at line 38 of file TerminalCodes.h.

◆ BLUE

#define BLUE   _SGR(34)

Definition at line 42 of file TerminalCodes.h.

◆ CYAN

#define CYAN   _SGR(36)

Definition at line 44 of file TerminalCodes.h.

◆ GREEN

#define GREEN   _SGR(32)

Definition at line 40 of file TerminalCodes.h.

◆ MAGENTA

#define MAGENTA   _SGR(35)

Definition at line 43 of file TerminalCodes.h.

◆ RED

#define RED   _SGR(31)

Definition at line 39 of file TerminalCodes.h.

◆ RESET

#define RESET   _SGR(39)

Definition at line 46 of file TerminalCodes.h.

◆ WHITE

#define WHITE   _SGR(37)

Definition at line 45 of file TerminalCodes.h.

◆ YELLOW

#define YELLOW   _SGR(33)

Definition at line 41 of file TerminalCodes.h.

Function Documentation

◆ bell()

void bell ( Terminal term)

Makes a sound (bell).

Parameters
termTerminal object pointer.

Definition at line 230 of file Terminal.cpp.

Referenced by Terminal::initialize().

◆ copy()

void copy ( Terminal ctx,
const teken_rect_t rect,
const teken_pos_t pos 
)

Copy bytes to the terminal.

Parameters
ctxTerminal object pointer.
rectSource rectagular area with VGA memory buffer.
posPosition to copy the rect to.

Definition at line 282 of file Terminal.cpp.

References Terminal::getBuffer(), Terminal::getWidth(), Terminal::hideCursor(), memcpy(), Terminal::showCursor(), teken_pos_t::tp_col, teken_pos_t::tp_row, teken_rect_t::tr_begin, and teken_rect_t::tr_end.

Referenced by Terminal::initialize(), String::split(), strdup(), and String::String().

◆ cursor()

void cursor ( Terminal term,
const teken_pos_t pos 
)

Sets the Terminal cursor.

Parameters
termTerminal object pointer.
posPosition to put the cursor.

Definition at line 253 of file Terminal.cpp.

References Terminal::hideCursor(), Terminal::setCursor(), and Terminal::showCursor().

Referenced by Terminal::initialize().

◆ fill()

void fill ( Terminal ctx,
const teken_rect_t rect,
teken_char_t  ch,
const teken_attr_t attr 
)

Fills the Terminal buffer with a character.

Parameters
ctxTerminal object pointer.
rectIndicates where to fill.
chCharacter to be used for filling.
attrAttributes for this character.

Definition at line 260 of file Terminal.cpp.

References BLACK, Terminal::getBuffer(), Terminal::getWidth(), Terminal::hideCursor(), Terminal::showCursor(), teken_attr_t::ta_fgcolor, tekenToVGA, teken_pos_t::tp_col, teken_pos_t::tp_row, teken_rect_t::tr_begin, and VGA_CHAR.

Referenced by Terminal::initialize().

◆ param()

void param ( Terminal ctx,
int  key,
int  value 
)

Set terminal parameters.

Parameters
ctxTerminal object pointer.
keyOption key identifier.
valueNew value for the option.

Definition at line 305 of file Terminal.cpp.

Referenced by Terminal::initialize(), PrivExec(), and PrivExecHandler().

◆ putchar()

void putchar ( Terminal term,
const teken_pos_t pos,
teken_char_t  ch,
const teken_attr_t attr 
)

Output a new character.

Parameters
termTerminal object pointer.
posTerminal position.
chCharacter to output.
attrAttributes for this character.

Definition at line 235 of file Terminal.cpp.

References BLACK, Terminal::getBuffer(), Terminal::getWidth(), Terminal::hideCursor(), Terminal::showCursor(), teken_attr_t::ta_fgcolor, tekenToVGA, teken_pos_t::tp_col, teken_pos_t::tp_row, and VGA_CHAR.

Referenced by Terminal::initialize().

◆ respond()

void respond ( Terminal ctx,
const void *  buf,
size_t  size 
)

Unused.

Definition at line 310 of file Terminal.cpp.

Referenced by Terminal::initialize().