Better intro

rust
E. Almqvist 3 years ago
parent 608a1fe5e2
commit 5097d32bda
  1. 26
      kernel/kernel.c
  2. 6
      kernel/kernel.h
  3. 6
      kernel/memory.c
  4. 2
      kernel/memory.h

@ -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);
// }
}

@ -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();

@ -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;

@ -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

Loading…
Cancel
Save