feat: cleanup init code, small other refactors

This commit is contained in:
2021-09-01 21:43:21 +02:00
parent e693b12915
commit 073051c99e
21 changed files with 118 additions and 76 deletions

View File

@@ -3,9 +3,11 @@
//
#include <string.h>
#include <myke/drivers/vgascreen.h>
#include <myke/drivers/ports.h>
#include <myke/drivers/vgascreen.h>
#include <myke/libk/kprint.h>
#include <myke/util/init.h>
char *_vga_character_memory = (char *) VGA_CHARACTER_MEMORY_LOCATION;
@@ -136,3 +138,14 @@ int get_offset_row(int offset) {
int get_offset_col(int offset) {
return (offset - (get_offset_row(offset) * 2 * VGA_COL_MAX)) / 2;
}
void vga_init() {
vga_clear_screen();
kprint_register(vga_kprint);
}
INIT_FUNCTION(100) = {
.name = "vga",
.stage = INIT_STAGE_EARLY_BOOT_0,
.init = vga_init,
};