From cec08e86097f404f95c5494d143496d4da6901ef Mon Sep 17 00:00:00 2001 From: pjht Date: Sat, 9 Feb 2019 17:55:06 -0600 Subject: [PATCH] VGA can now write strings --- drivers/i386/vga.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/i386/vga.c b/drivers/i386/vga.c index 07971eb..c5077d8 100644 --- a/drivers/i386/vga.c +++ b/drivers/i386/vga.c @@ -1,9 +1,12 @@ #include #include "../vga.h" +#include #define xy_to_indx(x,y) ((x+(y*height))*2) char* screen; int width; int height; +int x; +int y; vga_colors fg_color; vga_colors bg_color; @@ -13,6 +16,8 @@ void vga_set_char(int x,int y,char c) { } void vga_init(text_fb_info framebuffer_info) { + x=0; + y=0; fg_color=VGA_WHITE; bg_color=VGA_BLACK; screen=framebuffer_info.address; @@ -28,3 +33,28 @@ void vga_clear() { } } } + +void vga_write_string(const char* string) { + for (int i=0;i