From c1455e0859e5acb4eea6587235a3d451485e9c30 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sun, 24 Oct 2021 19:23:40 +0200 Subject: [PATCH] Removed unneeded styling --- drivers/vga.c | 4 ++-- drivers/vga.h | 1 + kernel/kernel.c | 11 ++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/vga.c b/drivers/vga.c index 48dfa60..0d238dd 100644 --- a/drivers/vga.c +++ b/drivers/vga.c @@ -24,7 +24,7 @@ char* get_memory_charpos(unsigned int col, unsigned int row) { void writechar(char c, unsigned int col, unsigned int row, int attribute_byte) { if( !attribute_byte ) - attribute_byte = 0x0f; + attribute_byte = DEFAULT_COLOR; char* mem = get_memory_charpos(col, row); *mem = c; // Write the character @@ -44,7 +44,7 @@ void set_cursor_pos(unsigned int col, unsigned int row) { void clear_screen() { for( int c = 0; c < MAX_COLS; c++ ) for( int r = 0; r < MAX_ROWS; r++ ) - writechar(0x20, c, r, 0xf0); + writechar(0x20, c, r, 0x0); } /* diff --git a/drivers/vga.h b/drivers/vga.h index 04306ae..41cab80 100644 --- a/drivers/vga.h +++ b/drivers/vga.h @@ -1,6 +1,7 @@ #define VGA_ADDRESS (char*)0xb8000 #define VGA_ADDRESS_MAX (char*)0xb8fa0 +#define DEFAULT_COLOR 0x07 #define MAX_ROWS 25 #define MAX_COLS 80 diff --git a/kernel/kernel.c b/kernel/kernel.c index 517032e..f96074a 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -8,17 +8,14 @@ void main() { // i.e. clear the screen et cetera. char* title = "eOS Version 0.2 2021"; - set_cursor_pos(0, 2); - printalign(title, 0xf0, MIDDLE); + println(title, DEFAULT_COLOR); char* subtitle = "A x86 operating system, licenced under GPL-2.0"; - set_cursor_pos(0, 3); - printalign(subtitle, 0xf8, MIDDLE); - + println(subtitle, DEFAULT_COLOR); char* strbuf = "String concat: "; char* str2 = "WORKS! :D"; strbuf = strcat(strbuf, str2); - set_cursor_pos(0, 0); - println(strbuf, 0xf0); + set_cursor_pos(0, 4); + println(strbuf, DEFAULT_COLOR); }