hippOS/kernel.c

37 lines
812 B
C
Raw Normal View History

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "gfx/terminal.h"
2022-02-22 21:20:57 +02:00
#include "cpu/pic.h"
#include "cpu/idt.h"
#include "std/kstd.h"
2022-02-22 21:20:57 +02:00
#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
2022-02-22 21:20:57 +02:00
void kmain(void) {
terminal_initialize();
2022-02-22 21:20:57 +02:00
kprintf("kmain(): info: kernel init started\n");
2022-02-22 21:20:57 +02:00
kprintf("[ ] Remapping PIC");
2022-02-22 21:20:57 +02:00
pic_remap(0x20, 0x28);
kprintf("\r[ OK ]\n");
2022-02-22 21:20:57 +02:00
kprintf("[ ] Installing exception handlers");
exception_handlers_init();
kprintf("\r[ OK ]\n");
kprintf("[ ] Initializing IDT");
idt_init();
kprintf("\r[ OK ]\n");
2022-02-22 21:20:57 +02:00
terminal_writestring("Initialization finished.\n");
}