Start work on VGA driver

This commit is contained in:
pjht 2019-02-09 14:35:29 -06:00
parent 9b707eb3f7
commit 60c56c064d
2 changed files with 15 additions and 0 deletions

13
drivers/i386/vga.c Normal file
View File

@ -0,0 +1,13 @@
#include <grub/text_fb_info.h>
#include "../vga.h"
char* screen;
int width;
int height;
vga_colors fg_color=VGA_WHITE;
vga_colors bg_color=VGA_BLACK;
void vga_init(text_fb_info framebuffer_info) {
screen=framebuffer_info.address;
width=framebuffer_info.width;
height=framebuffer_info.height;
}

View File

@ -1,4 +1,5 @@
#include "../cpu/cpu_init.h" #include "../cpu/cpu_init.h"
#include "../drivers/vga.h"
#include <grub/text_fb_info.h> #include <grub/text_fb_info.h>
#include <stdlib.h> #include <stdlib.h>
#include "multiboot.h" #include "multiboot.h"
@ -15,4 +16,5 @@ void kmain(multiboot_info_t* header) {
info.width=80; info.width=80;
info.height=25; info.height=25;
} }
vga_init(info);
} }