aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
blob: 859b6f1fed8a319bdc36a857ea6d921c4e711049 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <kernel/graphics/vesa.h>
#include <kernel/gdt/gdt.h>
#include <kernel/interrupts/interrupts.h>
#include <kernel/io/io.h>
#include <kernel/timer/timer.h>
#include <kernel/paging/paging.h>
#include <kernel/input/input.h>

void init() {
    vga_log("Installing basic features of Melvix...", 0);
    timer_install();
    gdt_install();
    init_serial();
    paging_install();
    keyboard_install();
    idt_install();
    isrs_install();
    irq_install();
    set_optimal_resolution();
    asm volatile ("sti");
}

void kernel_main(void) {
    init();

    // __asm__  ("div %0" :: "r"(0)); // Exception testing x/0
    loop:
    asm volatile ("hlt");
    goto loop;
}