]> pd.if.org Git - zos/blobdiff - tty.h
terminal and vga screen
[zos] / tty.h
diff --git a/tty.h b/tty.h
new file mode 100644 (file)
index 0000000..17a5c29
--- /dev/null
+++ b/tty.h
@@ -0,0 +1,42 @@
+#ifndef _TTY_H_
+#define _TTY_H_ 1
+
+#include <stddef.h>
+#include <stdint.h>
+
+enum vga_color {
+       VGA_BLACK = 0,
+       VGA_BLUE = 1,
+       VGA_GREEN = 2,
+       VGA_CYAN = 3,
+       VGA_RED = 4,
+       VGA_MAGENTA = 5,
+       VGA_BROWN = 6,
+       VGA_LIGHT_GREY = 7,
+       VGA_DARK_GREY = 8,
+       VGA_LIGHT_BLUE = 9,
+       VGA_LIGHT_GREEN = 10,
+       VGA_LIGHT_CYAN = 11,
+       VGA_LIGHT_RED = 12,
+       VGA_LIGHT_MAGENTA = 13,
+       VGA_LIGHT_BROWN = 14,
+       VGA_WHITE = 15
+};
+struct terminal {
+        void (*putchar)(int);
+        void (*clear)(void);
+        void (*scroll)(int);
+       void (*writestring)(const char *);
+       void (*update_cursor)(void);
+       uint16_t *vmem;
+        struct virtual_console *vc;
+       int row, column;
+       int color;
+       int escape;
+};
+
+extern struct terminal terminal;
+
+void terminal_initialize();
+#endif