PatchworkOS
Loading...
Searching...
No Matches
log_screen.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/config.h>
4#include <kernel/log/glyphs.h>
5#include <kernel/utils/ring.h>
6
7#include <boot/boot_info.h>
8
9#include <stdint.h>
10
22#define SCREEN_WRAP_INDENT 4
23
27#define SCREEN_LINE_MAX_LENGTH (130)
28
32#define SCREEN_LINE_STRIDE (SCREEN_LINE_MAX_LENGTH * GLYPH_WIDTH)
33
37typedef struct
38{
42
51
65
72void log_screen_init(const boot_gop_t* bootGop);
73
77void log_screen_clear(void);
78
83
88
96void log_screen_write(const char* string, uint64_t length);
97
#define GLYPH_HEIGHT
Definition glyphs.h:7
void log_screen_write(const char *string, uint64_t length)
Write a string to the screen.
Definition log_screen.c:204
uint64_t log_screen_get_width(void)
Get screen width in characters.
Definition log_screen.c:194
void log_screen_init(const boot_gop_t *bootGop)
Initialize the screen logging.
Definition log_screen.c:83
void log_screen_clear(void)
Clear the screen.
Definition log_screen.c:172
uint64_t log_screen_get_height(void)
Get screen height in characters.
Definition log_screen.c:199
#define SCREEN_LINE_STRIDE
The stride of a screen line in pixels.
Definition log_screen.h:32
#define CONFIG_SCREEN_MAX_LINES
Maximum screen lines configuration.
Definition config.h:164
__UINT32_TYPE__ uint32_t
Definition stdint.h:15
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
A single line in the screen buffer.
Definition log_screen.h:47
uint64_t length
The distance from the start of the line to the end of the furthest away char, in chars.
Definition log_screen.h:48
Represents a position on the screen in character coordinates.
Definition log_screen.h:38
The screen buffer.
Definition log_screen.h:56
log_screen_pos_t invalidStart
The start of the invalid region in the buffer, forms a rectangle with invalidEnd.
Definition log_screen.h:61
log_screen_pos_t invalidEnd
The end of the invalid region in the buffer, forms a rectangle with invalidStart.
Definition log_screen.h:62
uint64_t height
The height of the buffer in chars.
Definition log_screen.h:58
uint64_t width
The width of the buffer in chars.
Definition log_screen.h:57
uint64_t firstLineIndex
The index of the first line in the buffer.
Definition log_screen.h:59