hippOS/kernel.c

45 lines
985 B
C

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "std/kstd.h"
#include "gfx/terminal.h"
#include "cpu/pic.h"
#include "cpu/io.h"
#include "cpu/idt.h"
#include "cpu/exception.h"
#include "ps2/keyboard.h"
#if defined(__linux__)
#error "You are not using a cross-compiler, you will most certainly run into trouble"
#endif
#if !defined(__i386__)
#error "This OS needs to be compiled with a ix86-elf compiler"
#endif
void kmain(void) {
terminal_initialize();
kprintf("kmain(): info: kernel init started\n");
kprintf("[ ] Remapping PIC");
pic_remap(0x20, 0x28);
kprintf("\r[ OK ]\n");
kprintf("[ ] Installing exception handlers");
exception_handlers_init();
kprintf("\r[ OK ]\n");
kprintf("[ ] Initializing keyboard");
keyboard_init();
kprintf("\r[ OK ]\n");
kprintf("[ ] Initializing IDT");
idt_init();
kprintf("\r[ OK ]\n");
kprintf("Initialization finished.\n\n");
for (;;) {}
}