aboutsummaryrefslogtreecommitdiff
path: root/drivers/include
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2015-02-02 21:48:38 -0500
committerFranklin Wei <frankhwei536@gmail.com>2015-02-02 21:48:38 -0500
commitc8a195e1eb19d346c03c1dfa6ed66c6215caefa2 (patch)
tree3096ea08f7f213d7efe56a86391ab79b27333d40 /drivers/include
parent5c84e678defa9333aefcdcd0870564fb945a8c61 (diff)
downloadkappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.zip
kappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.tar.gz
kappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.tar.bz2
kappa-c8a195e1eb19d346c03c1dfa6ed66c6215caefa2.tar.xz
Refactor, begin writing a PS/2 driver
Diffstat (limited to 'drivers/include')
-rw-r--r--drivers/include/ps2.h9
-rw-r--r--drivers/include/tty.h9
-rw-r--r--drivers/include/vga.h26
3 files changed, 44 insertions, 0 deletions
diff --git a/drivers/include/ps2.h b/drivers/include/ps2.h
new file mode 100644
index 0000000..924ef24
--- /dev/null
+++ b/drivers/include/ps2.h
@@ -0,0 +1,9 @@
+#include <stdint.h>
+
+#define PS2_SCROLL_LOCK (1 << 0)
+#define PS2_NUM_LOCK (1 << 1)
+#define PS2_CAPS_LOCK (1 << 2)
+
+void ps2_set_leds(uint8_t status);
+
+void ps2_init(void);
diff --git a/drivers/include/tty.h b/drivers/include/tty.h
new file mode 100644
index 0000000..0e142c6
--- /dev/null
+++ b/drivers/include/tty.h
@@ -0,0 +1,9 @@
+#include <stdint.h>
+
+void tty_init(void);
+void tty_clear(void);
+void tty_set_color(uint8_t);
+uint8_t tty_get_color(void);
+void tty_putchar_at(char ch, uint8_t color, int x, int y);
+void tty_putchar(char ch);
+void tty_puts(const char*);
diff --git a/drivers/include/vga.h b/drivers/include/vga.h
new file mode 100644
index 0000000..bf13cba
--- /dev/null
+++ b/drivers/include/vga.h
@@ -0,0 +1,26 @@
+#include <stdint.h>
+
+enum vga_color_t {
+ VGA_BLACK = 0,
+ VGA_BLUE = 1,
+ VGA_GREEN = 2,
+ VGA_CYAN = 3,
+ VGA_RED = 4,
+ VGA_MAGENTA = 5,
+ VGA_BROWN = 6,
+ VGA_LIGHT_GRAY = 7,
+ VGA_DARK_GRAY = 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_WIDTH 80
+#define VGA_HEIGHT 25
+
+#define VGA_MAKE_COLOR(fg, bg) (fg | bg << 4)
+#define VGA_MAKE_ENTRY(ch, col) (((uint16_t)ch)|((uint16_t)col<<8))