diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c index 13cd450..6d38209 100644 --- a/src/kernel/kernel.c +++ b/src/kernel/kernel.c @@ -1,8 +1,8 @@ #include "lib/vga.c" -#include void main() { - clear_screen(); + vga_init(); + set_cursor_pos(28, 2); print("eOS Version 0.1 2021", 0xf0); } diff --git a/src/kernel/lib/vga.c b/src/kernel/lib/vga.c index c3edfb8..cde216f 100644 --- a/src/kernel/lib/vga.c +++ b/src/kernel/lib/vga.c @@ -1,4 +1,5 @@ // VGA Graphics Library +#include // VGA base address: 0xb8000 // Charpos = 0xb8000 + 2(row*80 + col) @@ -34,6 +35,11 @@ void clear_screen() { *c = 0x20; } +void disable_cursor() { + outb(0x3d4, 0x0a); + outb(0x3d5, 0x20); +} + /* General Printing Functions @@ -52,3 +58,10 @@ void println(char* str, int colorcode) { print(str, colorcode); cursor_row++; // Increment to next y-pos (newline) } + + +// VGA Initialization Function +void vga_init() { + disable_cursor(); + clear_screen(); +}