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;
|
2024-06-27 22:31:22 -04:00
|
|
|
if (!(info->flags & (1<<12))) goto halt;
|
2024-06-27 18:36:32 -04:00
|
|
|
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 (;;) {}
|
|
|
|
}
|