summaryrefslogtreecommitdiff
path: root/kernel/include/drivers/vga.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--kernel/include/drivers/vga.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/kernel/include/drivers/vga.h b/kernel/include/drivers/vga.h
new file mode 100644
index 0000000..68e8690
--- /dev/null
+++ b/kernel/include/drivers/vga.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <stdbool.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,
+};
+
+#define VGA_TEXT_W 80
+#define VGA_TEXT_H 25
+
+void vgatext_write_char(char c, enum vga_color color, uint8_t x, uint8_t y);
+void vgatext_write_data(uint16_t data, uint16_t index);
+void vgatext_write_buf(const uint16_t *buffer);
+void vgatext_cur_mov(uint8_t x, uint8_t y);
+void vgatext_cur_resize(uint8_t start, uint8_t end);
+void vgatext_cur_visible(bool visible);