Move src/modules/main -> src/kernel

This commit is contained in:
Justin C. Miller
2018-04-17 09:44:40 -07:00
parent 504de44ff3
commit 2050b89334
20 changed files with 26 additions and 14 deletions

56
src/kernel/main.cpp Normal file
View File

@@ -0,0 +1,56 @@
#include <stddef.h>
#include <stdint.h>
#include "console.h"
#include "device_manager.h"
#include "font.h"
#include "interrupts.h"
#include "kernel_data.h"
#include "screen.h"
extern "C" {
void do_the_set_registers(popcorn_data *header);
void kernel_main(popcorn_data *header);
}
console
load_console(const popcorn_data *header)
{
console cons{
font::load(header->font),
screen{
header->frame_buffer,
header->hres,
header->vres,
header->rmask,
header->gmask,
header->bmask},
header->log,
header->log_length};
cons.set_color(0x21, 0x00);
cons.puts("Popcorn OS ");
cons.set_color(0x08, 0x00);
cons.puts(GIT_VERSION " booting...\n");
return cons;
}
void
kernel_main(popcorn_data *header)
{
console cons = load_console(header);
interrupts_init();
interrupts_enable();
cons.puts("Interrupts initialized.\n");
device_manager devices(header->acpi_table);
// int x = 1 / 0;
// __asm__ __volatile__("int $15");
cons.puts("boogity!");
do_the_set_registers(header);
}