summaryrefslogtreecommitdiff
path: root/src/vga.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vga.c')
-rw-r--r--src/vga.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/vga.c b/src/vga.c
index 71faa1a..f176d70 100644
--- a/src/vga.c
+++ b/src/vga.c
@@ -1,14 +1,31 @@
#include<stdbool.h>
#include<stddef.h>
#include<stdint.h>
-#include"vga.h"
+#include"string.h"
static const size_t VGA_WIDTH = 80;
static const size_t VGA_HEIGHT = 25;
extern char ioport_in(uint8_t port);
extern void ioport_out(uint8_t port, char data);
-bool stringcmp(char *str1,char *str2);
+enum vga_color {
+ VGA_COLOR_BLACK = 0,
+ VGA_COLOR_BLUE = 1,
+ VGA_COLOR_GREEN = 2,
+ VGA_COLOR_CYAN = 3,
+ VGA_COLOR_RED = 4,
+ VGA_COLOR_MAGENTA = 5,
+ VGA_COLOR_BROWN = 6,
+ VGA_COLOR_LIGHT_GREY = 7,
+ VGA_COLOR_DARK_GREY = 8,
+ VGA_COLOR_LIGHT_BLUE = 9,
+ VGA_COLOR_LIGHT_GREEN = 10,
+ VGA_COLOR_LIGHT_CYAN = 11,
+ VGA_COLOR_LIGHT_RED = 12,
+ VGA_COLOR_LIGHT_MAGENTA = 13,
+ VGA_COLOR_LIGHT_BROWN = 14,
+ VGA_COLOR_WHITE = 15,
+};
static inline uint8_t vga_entry_color(enum vga_color fg, enum vga_color bg)
{
@@ -80,6 +97,14 @@ void terminal_writestring(const char* data)
for(int i=0;data[i]!='\0';i++) terminal_putchar(data[i]);
}
+void terminal_writeint(const uint32_t num)
+{
+ char string[100];
+ char *str=string;
+ itos(str,num);
+ terminal_writestring(str);
+}
+
void prompt()
{
terminal_writestring("[user@myos] > ");