diff options
author | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2023-12-13 13:24:48 +0100 |
---|---|---|
committer | Anna (navi) Figueiredo Gomes <navi@vlhl.dev> | 2023-12-25 18:37:20 +0100 |
commit | 30d6e8f850d2fe26fffdeef0c38fc627ef8bab9a (patch) | |
tree | cd786b6a79d6a58590b2d35308746761c1e3d977 /include/vga.h |
initial commit
currently with:
booted via multiboot 1
protected mode to long mode boostrap code
vga used for outputting
gdt and idt set up
identity paging for the whole memory reported by multiboot
pic and ps/2 set up
acpi code exists but is broken
Diffstat (limited to 'include/vga.h')
-rw-r--r-- | include/vga.h | 38 |
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 |