hippOS/kernel.c

46 lines
985 B
C
Raw Normal View History

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "std/kstd.h"
#include "gfx/terminal.h"
2022-02-22 21:20:57 +02:00
#include "cpu/pic.h"
#include "cpu/io.h"
2022-02-22 21:20:57 +02:00
#include "cpu/idt.h"
#include "cpu/exception.h"
#include "ps2/keyboard.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 keyboard");
keyboard_init();
kprintf("\r[ OK ]\n");
kprintf("[ ] Initializing IDT");
idt_init();
kprintf("\r[ OK ]\n");
2022-02-22 21:20:57 +02:00
kprintf("Initialization finished.\n\n");
for (;;) {}
}