From 5097d32bda220f3bc74e86c1f90630228e59bba9 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 15 Apr 2022 21:18:42 +0200 Subject: [PATCH] Better intro --- kernel/kernel.c | 26 ++++++++++++++++---------- kernel/kernel.h | 6 ++---- kernel/memory.c | 6 ------ kernel/memory.h | 2 -- 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/kernel/kernel.c b/kernel/kernel.c index 31ddc2f..948f8d0 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,11 +1,13 @@ #include "kernel.h" +char** eos_art = { + "\0" +}; + void kernel_init() { vga_init(); // Initialize the screen first // i.e. clear the screen et cetera. - println("Kernel loaded", SUCCESS_COLOR); - // Allocate VGA memory range pm_malloc_range(VGA_ADDRESS, VGA_ADDRESS_MAX, true); // force alloc the VGA range @@ -13,15 +15,19 @@ void kernel_init() { // TODO: make this work // enable_paging(); - println(""); - char* title = "eOS - lim[h->0] (1+h)^(1/h) OS"; - println(title, DEFAULT_COLOR); + printalign(" ___ ____ ", BANNER_COLOR, MIDDLE); + printalign(" ___ / _ \\/ ___| ", BANNER_COLOR, MIDDLE); + printalign(" / _ \\ | | \\___ \\ ", BANNER_COLOR, MIDDLE); + printalign("| __/ |_| |___) | A x86 operating system,", BANNER_COLOR, MIDDLE); + printalign(" \\___|\\___/|____/ licenced under GPL-2.0", BANNER_COLOR, MIDDLE); - char* subtitle = "A x86 operating system, licenced under GPL-2.0"; - println(subtitle, DEFAULT_COLOR); + println(""); - print("Ent count: ", DEFAULT_COLOR); - char* mem = (char*) get_phys_mem_size(); - println(mem, DEFAULT_COLOR); + printalign("Fun fact: e = lim[h->0] (1+h)^(1/h)", DEFAULT_COLOR, MIDDLE); + printalign("Created by Elias Almqvist", DEFAULT_COLOR, MIDDLE); +// for(char* line = *eos_art; line; line=*++eos_art) { +// print(":::: "); +// printalign(line, DEFAULT_COLOR); +// } } diff --git a/kernel/kernel.h b/kernel/kernel.h index d06c4ff..bb40f83 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -1,11 +1,9 @@ - #include "memory.h" #include "paging.h" #include "../drivers/vga.h" #include "../lib/str.h" #include "../lib/conv.h" -#define STATUS_TEXT_COLOR 0x0f +#define BANNER_COLOR 0x0f -void init(); -void display_status(char*, unsigned int); +void kernel_init(); diff --git a/kernel/memory.c b/kernel/memory.c index 0e732f2..f59362e 100644 --- a/kernel/memory.c +++ b/kernel/memory.c @@ -23,12 +23,6 @@ static int bitmap = 0; static uint last_block; -uint get_phys_mem_size() { - // TODO: read actual mappings - uint e820_count = (uint) *BIOS_E820; - return e820_count; -} - void mod_bitmap(uint bit, uint bflag) { // create a bitmask that will be applied to the bitmap int bitmask = 1 << bit; diff --git a/kernel/memory.h b/kernel/memory.h index aff184e..d35cd0a 100644 --- a/kernel/memory.h +++ b/kernel/memory.h @@ -25,5 +25,3 @@ void pm_malloc_range(ulong start, ulong end, bool force); // allocate a range of pointer pm_malloc(uint block_count); // allocate some blocks void pm_free(int* p); // free a var (if allocated with pm_malloc) - -uint get_phys_mem_size(); // physical memory size with e820 left by the bootloader