libmeinos: +llist2
[meinos.git] / kernel2 / include / vga.h
blob7b40009a8fe19d38366c860748652cf61996b502
1 /*
2 meinOS - A unix-like x86 microkernel operating system
3 Copyright (C) 2008 Janosch Gräf <janosch.graef@gmx.net>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef _SCREEN_H_
20 #define _SCREEN_H_
22 #include <stdint.h>
24 /// Videotext Address
25 #define VGA_TEXT_ADDRESS 0xB8000
26 /// 80 cols (chars per line)
27 #define VGA_TEXT_WIDTH 80
28 /// 25 rows (lines)
29 #define VGA_TEXT_HEIGHT 25
30 /// 2 bytes per char
31 #define VGA_TEXT_BPC sizeof(vga_text_char_t)
32 /// Size of VGA text buffer
33 #define VGA_TEXT_SIZE (VGA_TEXT_WIDTH*VGA_TEXT_HEIGHT*VGA_TEXT_BPC)
34 /// Default color
35 #define VGA_TEXT_COLOR_DEFAULT VGA_TEXT_COLOR_GRAY_BLACK
36 /// Tabsize
37 #define VGA_TEXT_TABSIZE 8
39 typedef enum {
40 VGA_TEXT_COLOR_GREEN_BLACK = 0x02,
41 VGA_TEXT_COLOR_GRAY_BLACK = 0x07,
42 VGA_TEXT_COLOR_RED_BLACK = 0x0C,
43 VGA_TEXT_COLOR_WHITE_BLUE = 0x1F
44 } vga_text_color_t;
46 typedef struct {
47 /// X position on screen
48 int x;
49 /// Y position on screen
50 int y;
51 /// Color of next char
52 vga_text_color_t color;
53 } vga_text_cursor_t;
55 typedef struct {
56 uint8_t chr;
57 uint8_t attr;
58 } vga_text_char_t;
60 vga_text_char_t *vga_text_video;
61 vga_text_cursor_t vga_text_cursor;
63 void vga_init();
64 void vga_text_clear();
65 void vga_text_set_hwcursor(int x,int y);
66 void vga_text_setcolor(vga_text_color_t color);
67 void vga_text_printchar(char chr);
69 /// @todo remove
70 void com_init();
71 void com_send(char a);
72 void bochs_send(char a);
74 #endif