hazel/kernel/kernel.c

20 lines
458 B
C
Raw Normal View History

2024-06-27 18:36:32 -04:00
#include <kernel/kernel.h>
2024-06-25 22:47:21 -04:00
#include <kernel/multiboot.h>
2024-06-27 18:36:32 -04:00
#include <kernel/serial.h>
kernel_ctx_t ctx = {0};
2024-06-25 22:47:21 -04:00
void kernel(multiboot_info_t *info) {
2024-06-27 18:36:32 -04:00
if (!(info->flags & (1<<6))) goto halt;
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;
2024-06-25 22:47:21 -04:00
2024-06-27 18:36:32 -04:00
LOG("Kernel log being sent to COM1\n");
halt:
2024-06-25 15:28:44 -04:00
asm volatile ("cli" ::);
for (;;) {}
}