hazel/kernel/kernel.c

20 lines
538 B
C

#include <kernel/kernel.h>
#include <kernel/multiboot.h>
#include <kernel/serial.h>
kernel_ctx_t ctx = {0};
void kernel(multiboot_info_t *info) {
if (!CHECK_FLAG(info->flags, 6)) goto halt; // Memory map
if (!CHECK_FLAG(info->flags, 12)) goto halt; // VBE data
ctx.mem_map = (multiboot_memory_map_t *)info->memmapaddress;
ctx.mem_map_len = info->memmaplength;
if (serial_port_init(COM1)) ctx.log_method = LOG_COM1;
LOG("Kernel log being sent to COM1\n");
halt:
asm volatile ("cli" ::);
for (;;) {}
}