diff options
author | Tyler Murphy <=> | 2023-07-17 19:34:52 -0400 |
---|---|---|
committer | Tyler Murphy <=> | 2023-07-17 19:34:52 -0400 |
commit | 7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5 (patch) | |
tree | 4e86ff20e73171285156631db043e12aaf63bf04 /kernel/include/drivers | |
parent | paging (diff) | |
download | finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.tar.gz finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.tar.bz2 finix-7a912d1b668ab86ffe088eca3ac7e6f78a04a0c5.zip |
refactoring
Diffstat (limited to 'kernel/include/drivers')
-rw-r--r-- | kernel/include/drivers/ps2kb.h | 15 | ||||
-rw-r--r-- | kernel/include/drivers/ps2mouse.h | 18 | ||||
-rw-r--r-- | kernel/include/drivers/vga.h | 32 |
3 files changed, 65 insertions, 0 deletions
diff --git a/kernel/include/drivers/ps2kb.h b/kernel/include/drivers/ps2kb.h new file mode 100644 index 0000000..1aaefb2 --- /dev/null +++ b/kernel/include/drivers/ps2kb.h @@ -0,0 +1,15 @@ +#pragma once + +#include <stdbool.h> +#include <stdint.h> +#include <keycodes.h> + +struct Keycode { + uint8_t key; + uint8_t flags; +}; + +void ps2kb_init(void); + +void ps2kb_recv(void); +struct Keycode ps2kb_get(void); diff --git a/kernel/include/drivers/ps2mouse.h b/kernel/include/drivers/ps2mouse.h new file mode 100644 index 0000000..9cd4818 --- /dev/null +++ b/kernel/include/drivers/ps2mouse.h @@ -0,0 +1,18 @@ +#pragma once + +#include <stdbool.h> +#include <stdint.h> + +struct MouseEvent { + bool updated; + bool lmb; + bool rmb; + bool mmb; + int relx; + int rely; +}; + +void ps2mouse_init(void); + +void ps2mouse_recv(void); +struct MouseEvent ps2mouse_get(void); 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); |