blob: ec012f5bdf22b27d42d4a46fc3c3ef96e39077f4 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Stefan Reinauere5627382005-01-15 00:29:10 +00002
Luc Verhaegen5c5beb72009-05-29 03:04:16 +00003#ifndef VGA_H
4#define VGA_H
Stefan Reinauere5627382005-01-15 00:29:10 +00005
Luc Verhaegen5c5beb72009-05-29 03:04:16 +00006#define VGA_FB 0xB8000
7#define VGA_FB_SIZE 0x4000 /* char + attr = word sized so 0x8000 / 2 */
8#define VGA_COLUMNS 80
9#define VGA_LINES 25
Stefan Reinauere5627382005-01-15 00:29:10 +000010
Subrata Banik3e3b78a2022-12-26 21:39:59 +053011#define VGA_TEXT_HORIZONTAL_TOP 0
12#define VGA_TEXT_HORIZONTAL_MIDDLE (VGA_LINES / 2)
13
14enum VGA_TEXT_ALIGNMENT {
15 VGA_TEXT_LEFT,
16 VGA_TEXT_CENTER,
17 VGA_TEXT_RIGHT,
18};
19
Luc Verhaegen5c5beb72009-05-29 03:04:16 +000020void vga_io_init(void);
Stefan Reinauere5627382005-01-15 00:29:10 +000021
Luc Verhaegen5c5beb72009-05-29 03:04:16 +000022void vga_textmode_init(void);
Stefan Reinauere5627382005-01-15 00:29:10 +000023
Luc Verhaegen5c5beb72009-05-29 03:04:16 +000024void vga_cursor_enable(int enable);
25void vga_cursor_reset(void);
26void vga_cursor_set(unsigned int line, unsigned int character);
Stefan Reinauere5627382005-01-15 00:29:10 +000027
Luc Verhaegen5c5beb72009-05-29 03:04:16 +000028void vga_frame_set(unsigned int line, unsigned int character);
Stefan Reinauere5627382005-01-15 00:29:10 +000029
Luc Verhaegen5c5beb72009-05-29 03:04:16 +000030void vga_line_write(unsigned int line, const char *string);
Stefan Reinauere5627382005-01-15 00:29:10 +000031
Subrata Banik3e3b78a2022-12-26 21:39:59 +053032/*
33 * vga_write_text() writes a line of text aligned left/center/right
34 * horizontally on the screen (i.e. enum VGA_TEXT_ALIGNMENT)
35 */
36void vga_write_text(enum VGA_TEXT_ALIGNMENT alignment, unsigned int line, const char *string);
37
Luc Verhaegen5c5beb72009-05-29 03:04:16 +000038#endif /* VGA_H */