PatchworkOS
Loading...
Searching...
No Matches
Screen

Screen logging. More...

Data Structures

struct  log_screen_pos_t
 Represents a position on the screen in character coordinates. More...
 
struct  log_screen_line_t
 A single line in the screen buffer. More...
 
struct  log_screen_t
 The screen buffer. More...
 

Macros

#define SCREEN_WRAP_INDENT   4
 Number of spaces to indent when a line wraps.
 
#define SCREEN_LINE_MAX_LENGTH   (130)
 Maximum number of characters in a single line.
 
#define SCREEN_LINE_STRIDE   (SCREEN_LINE_MAX_LENGTH * GLYPH_WIDTH)
 The stride of a screen line in pixels.
 

Functions

void log_screen_init (const boot_gop_t *bootGop)
 Initialize the screen logging.
 
void log_screen_clear (void)
 Clear the screen.
 
uint64_t log_screen_get_width (void)
 Get screen width in characters.
 
uint64_t log_screen_get_height (void)
 Get screen height in characters.
 
void log_screen_write (const char *string, uint64_t length)
 Write a string to the screen.
 

Detailed Description

Screen logging.

Macro Definition Documentation

◆ SCREEN_LINE_MAX_LENGTH

#define SCREEN_LINE_MAX_LENGTH   (130)

Maximum number of characters in a single line.

Definition at line 27 of file log_screen.h.

◆ SCREEN_LINE_STRIDE

#define SCREEN_LINE_STRIDE   (SCREEN_LINE_MAX_LENGTH * GLYPH_WIDTH)

The stride of a screen line in pixels.

Definition at line 32 of file log_screen.h.

◆ SCREEN_WRAP_INDENT

#define SCREEN_WRAP_INDENT   4

Number of spaces to indent when a line wraps.

Definition at line 22 of file log_screen.h.

Function Documentation

◆ log_screen_clear()

◆ log_screen_get_height()

uint64_t log_screen_get_height ( void  )

Get screen height in characters.

Definition at line 199 of file log_screen.c.

References log_screen_t::height, and screen.

Referenced by log_file_flush_to_screen().

◆ log_screen_get_width()

uint64_t log_screen_get_width ( void  )

Get screen width in characters.

Definition at line 194 of file log_screen.c.

References screen, and log_screen_t::width.

Referenced by log_file_advance_fake_cursor().

◆ log_screen_init()

void log_screen_init ( const boot_gop_t bootGop)

Initialize the screen logging.

Parameters
screenThe screen state to initialize.
bootGopPointer to the bootloader-provided GOP information for screen logging.

Definition at line 83 of file log_screen.c.

References CONFIG_SCREEN_MAX_LINES, cursor, log_screen_t::firstLineIndex, GLYPH_HEIGHT, GLYPH_WIDTH, gop, boot_gop_t::height, log_screen_t::height, log_screen_t::invalidEnd, log_screen_t::invalidStart, log_screen_t::lines, log_screen_clear(), memset(), MIN, screen, SCREEN_LINE_MAX_LENGTH, boot_gop_t::width, and log_screen_t::width.

Referenced by log_init().

◆ log_screen_write()

void log_screen_write ( const char *  string,
uint64_t  length 
)

Write a string to the screen.

Parameters
screenThe screen state.
stringThe string to write.
lengthThe length of the string.

Definition at line 204 of file log_screen.c.

References lock, LOCK_SCOPE, log_screen_advance_cursor(), log_screen_flush(), and log_screen_put().

Referenced by log_file_flush_to_screen(), and log_write().