A poorly written OS for the x86 arch. (WIP)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eOS/kernel/kernel.c

37 lines
1.1 KiB

#include "kernel.h"
3 years ago
void kernel_motd() {
3 years ago
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);
3 years ago
println("");
3 years ago
printalign("Fun fact: e = lim[h->0] (1+h)^(1/h)", DEFAULT_COLOR, MIDDLE);
printalign("Created by Elias Almqvist", DEFAULT_COLOR, MIDDLE);
3 years ago
}
void kernel_init() {
// Display a nice MOTD
clear_screen();
kernel_motd();
3 years ago
vga_init(); // Initialize the screen first
// i.e. clear the screen et cetera.
// Allocate VGA memory range
pm_malloc_range(VGA_ADDRESS, VGA_ADDRESS_MAX, true); // force alloc the VGA range
// ENABLE PAGING
// TODO: make this work
// enable_paging();
3 years ago
set_cursor_pos(0, 8);
print("E820 loaded entries: ", DEFAULT_COLOR);
uint entries = get_phys_mem_size();
char* buf;
buf = int_to_str(entries, buf);
println(buf, DEFAULT_COLOR);
}