]> pd.if.org Git - zos/blob - tty.h
add a readme with a public domain note
[zos] / tty.h
1 #ifndef _TTY_H_
2 #define _TTY_H_ 1
3
4 #include <stddef.h>
5 #include <stdint.h>
6
7 enum vga_color {
8         VGA_BLACK = 0,
9         VGA_BLUE = 1,
10         VGA_GREEN = 2,
11         VGA_CYAN = 3,
12         VGA_RED = 4,
13         VGA_MAGENTA = 5,
14         VGA_BROWN = 6,
15         VGA_LIGHT_GREY = 7,
16         VGA_DARK_GREY = 8,
17         VGA_LIGHT_BLUE = 9,
18         VGA_LIGHT_GREEN = 10,
19         VGA_LIGHT_CYAN = 11,
20         VGA_LIGHT_RED = 12,
21         VGA_LIGHT_MAGENTA = 13,
22         VGA_LIGHT_BROWN = 14,
23         VGA_WHITE = 15
24 };
25  
26 struct terminal {
27         void (*putchar)(int);
28         void (*clear)(void);
29         void (*scroll)(int);
30         void (*writestring)(const char *);
31         void (*update_cursor)(void);
32         uint16_t *vmem;
33         struct virtual_console *vc;
34         int row, column;
35         int color;
36         int escape;
37 };
38
39 extern struct terminal terminal;
40
41 void terminal_initialize();
42 #endif