kornos/kernel/src/main.c

32 lines
927 B
C

#include "arch/x86/vga.h"
#include "hal/ops.h"
#include "hal/info.h"
#include "print/print.h"
char TESTBUF[128] = "eeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeee - gigakubica";
char PRINTBUF[128];
void kmain() {
if(!validate_boot_info()) {
PANIC("Error: boot_info not entered!");
}
printf("Kernel initialized! Platform: %s\n", arch);
printf("Bootloader type: %s (%s %s)\n", boot_info.boot_protocol, boot_info.bootloader_name, boot_info.bootloader_ver);
printf("System time: %d\n", boot_info.epoch);
printf("Usable memory: %h (at %x)\n", boot_info.usable.len, boot_info.usable.start);
printf("Cmdline: %s\n", boot_info.cmdline);
// kalloc_init(boot_info.usable.start);
zigmain();
// memcpy(PRINTBUF, TESTBUF, 32);
// puts(PRINTBUF);
kalloc_init(boot_info.usable.start, boot_info.usable.len);
vga_setcolor(VGA_DARK_GRAY);
vga_write_elsewhere("(c) Quinten Kock 2020 (MIT License)", 24, 0);
halt_catch_fire();
}