Patrick Georgi | ac95903 | 2020-05-05 22:49:26 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Stefan Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 2 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 3 | #ifndef VGA_H |
| 4 | #define VGA_H |
Stefan Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 5 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 6 | #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 Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 10 | |
Subrata Banik | 3e3b78a | 2022-12-26 21:39:59 +0530 | [diff] [blame^] | 11 | #define VGA_TEXT_HORIZONTAL_TOP 0 |
| 12 | #define VGA_TEXT_HORIZONTAL_MIDDLE (VGA_LINES / 2) |
| 13 | |
| 14 | enum VGA_TEXT_ALIGNMENT { |
| 15 | VGA_TEXT_LEFT, |
| 16 | VGA_TEXT_CENTER, |
| 17 | VGA_TEXT_RIGHT, |
| 18 | }; |
| 19 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 20 | void vga_io_init(void); |
Stefan Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 21 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 22 | void vga_textmode_init(void); |
Stefan Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 23 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 24 | void vga_cursor_enable(int enable); |
| 25 | void vga_cursor_reset(void); |
| 26 | void vga_cursor_set(unsigned int line, unsigned int character); |
Stefan Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 27 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 28 | void vga_frame_set(unsigned int line, unsigned int character); |
Stefan Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 29 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 30 | void vga_line_write(unsigned int line, const char *string); |
Stefan Reinauer | e562738 | 2005-01-15 00:29:10 +0000 | [diff] [blame] | 31 | |
Subrata Banik | 3e3b78a | 2022-12-26 21:39:59 +0530 | [diff] [blame^] | 32 | /* |
| 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 | */ |
| 36 | void vga_write_text(enum VGA_TEXT_ALIGNMENT alignment, unsigned int line, const char *string); |
| 37 | |
Luc Verhaegen | 5c5beb7 | 2009-05-29 03:04:16 +0000 | [diff] [blame] | 38 | #endif /* VGA_H */ |