summaryrefslogtreecommitdiff
path: root/include/vga.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/vga.h')
-rw-r--r--include/vga.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/vga.h b/include/vga.h
new file mode 100644
index 0000000..6d74671
--- /dev/null
+++ b/include/vga.h
@@ -0,0 +1,38 @@
+#ifndef _VGA_H_
+#define _VGA_H_
+
+#include <stdint.h>
+#include <stddef.h>
+
+/* Hardware text mode color constants. */
+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,
+};
+
+static const size_t VGA_WIDTH = 80;
+static const size_t VGA_HEIGHT = 25;
+
+void vga_init(void);
+void vga_putn(const size_t num);
+void vga_putx(const size_t hex);
+void vga_putc(const char c);
+void vga_puts(const char *s);
+void vga_putsn(const char *s, const size_t len);
+void vga_set_color(const uint8_t fg, const uint8_t bg);
+
+#endif