The manual
ginnOS
The reference: libc, the libraries and the kernel
Loading...
Searching...
No Matches
vga.h
Go to the documentation of this file.
1#pragma once
2
3#include "common/stdint.h"
4
5/**
6 * enumeration of VGA colors.
7 */
27
28/**
29 * initializes the VGA driver. must be called before any other VGA functions.
30 */
31void vga_initialize(void);
32
33/**
34 * clears the VGA text buffer and resets the cursor position to the top left corner.
35 */
36void vga_clear(void);
37
38/**
39 * sets the foreground and background colors for text output.
40 * @param foreground the foreground color.
41 * @param background the background color.
42 */
43void vga_set_color(
44 uint8_t foreground,
45 uint8_t background);
46
47/**
48 * write a character at an explicit screen location.
49 * invalid row/column values are ignored.
50 */
51void vga_put_at(char c, uint8_t row, uint8_t col);
52
53/**
54 * scroll the text buffer up by one row and move the cursor to the last row.
55 */
56void vga_scroll(void);
57
58/**
59 * set the cursor position to the specified row and column.
60 * @param row the row to set the cursor to.
61 * @param col the column to set the cursor to.
62 */
63void vga_set_cursor(uint8_t row, uint8_t col);
64
65/**
66 * get the current cursor position.
67 * @param row pointer to a variable to receive the current cursor row.
68 * @param col pointer to a variable to receive the current cursor column.
69 */
70void vga_get_cursor(uint8_t *row, uint8_t *col);
71
72/**
73 * writes a single character to the VGA text buffer at the current cursor position.
74 * @param c the character to write.
75 */
76void vga_putchar(char c);
77
78/**
79 * writes a null-terminated string to the VGA text buffer starting at the current cursor position.
80 * @param str the string to write.
81 */
82void vga_write(const char *str);
unsigned char uint8_t
Definition fb.h:18
void vga_get_cursor(uint8_t *row, uint8_t *col)
get the current cursor position.
Definition vga.c:174
void vga_scroll(void)
scroll the text buffer up by one row and move the cursor to the last row.
Definition vga.c:85
void vga_set_color(uint8_t fg, uint8_t bg)
sets the foreground and background colors for text output.
Definition vga.c:107
void vga_write(const char *str)
writes a null-terminated string to the VGA text buffer starting at the current cursor position.
Definition vga.c:148
void vga_set_cursor(uint8_t row, uint8_t col)
set the cursor position to the specified row and column.
Definition vga.c:166
void vga_initialize(void)
initializes the VGA driver.
Definition vga.c:156
void vga_put_at(char c, uint8_t row, uint8_t col)
write a character at an explicit screen location.
Definition vga.c:75
void vga_clear(void)
clears the VGA text buffer and resets the cursor position to the top left corner.
Definition vga.c:112
void vga_putchar(char c)
writes a single character to the VGA text buffer at the current cursor position.
Definition vga.c:128
vga_color
enumeration of VGA colors.
Definition vga.h:9
@ VGA_LIGHT_MAGENTA
Definition vga.h:23
@ VGA_WHITE
Definition vga.h:25
@ VGA_MAGENTA
Definition vga.h:15
@ VGA_YELLOW
Definition vga.h:24
@ VGA_DARK_GREY
Definition vga.h:18
@ VGA_BLACK
Definition vga.h:10
@ VGA_LIGHT_GREY
Definition vga.h:17
@ VGA_BROWN
Definition vga.h:16
@ VGA_LIGHT_RED
Definition vga.h:22
@ VGA_GREEN
Definition vga.h:12
@ VGA_RED
Definition vga.h:14
@ VGA_LIGHT_GREEN
Definition vga.h:20
@ VGA_BLUE
Definition vga.h:11
@ VGA_LIGHT_BLUE
Definition vga.h:19
@ VGA_CYAN
Definition vga.h:13
@ VGA_LIGHT_CYAN
Definition vga.h:21