From f1334567e1e43fa1b426d62d21c1504a565d2c7c Mon Sep 17 00:00:00 2001 From: pjht Date: Mon, 11 Feb 2019 09:28:25 -0600 Subject: [PATCH] Add cursor to VGA driver --- drivers/i386/vga.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/drivers/i386/vga.c b/drivers/i386/vga.c index 4f5a31b..fadbdac 100644 --- a/drivers/i386/vga.c +++ b/drivers/i386/vga.c @@ -15,6 +15,22 @@ void vga_set_char(int x,int y,char c) { screen[xy_to_indx(x,y)+1]=(bg_color<<4)|fg_color; } +void vga_clear() { + for (int y=0;y>8); +} + void vga_init(text_fb_info framebuffer_info) { x=0; y=0; @@ -23,17 +39,14 @@ void vga_init(text_fb_info framebuffer_info) { screen=framebuffer_info.address; width=framebuffer_info.width; height=framebuffer_info.height; + port_byte_out(0x3D4,0xA); + port_byte_out(0x3D5,(port_byte_in(0x3D5)&0xC0)|14); + port_byte_out(0x3D4,0xB); + port_byte_out(0x3D5,(port_byte_in(0x3D5)&0xE0)|15); + set_cursor(0,0); vga_clear(); } -void vga_clear() { - for (int y=0;y