diff --git a/drivers/i386/vga.c b/drivers/i386/vga.c index 9f729a1..b31cd7e 100644 --- a/drivers/i386/vga.c +++ b/drivers/i386/vga.c @@ -1,13 +1,28 @@ #include #include "../vga.h" +#define xy_to_mem(x,y) ((x+(y*height))*2) char* screen; int width; int height; vga_colors fg_color=VGA_WHITE; vga_colors bg_color=VGA_BLACK; +void vga_set_char(int x,int y,char c) { + screen[xy_to_mem(x,y)]=c; + screen[xy_to_mem(x,y)+1]=(bg_color<<4)|fg_color; +} + void vga_init(text_fb_info framebuffer_info) { screen=framebuffer_info.address; width=framebuffer_info.width; height=framebuffer_info.height; + vga_clear(); +} + +void vga_clear() { + for (int y=0;y