blob: eeef8145bda27dfbb3f3f7e4132c076ca84076d1 [file] [log] [blame]
swissChilid8137922021-02-17 15:34:07 -08001#include "descriptor_tables.h"
swissChili825d46b2021-02-21 10:14:16 -08002#include "io.h"
3#include "log.h"
swissChilidefeb0d2021-02-18 15:28:36 -08004#include "timer.h"
swissChili825d46b2021-02-21 10:14:16 -08005#include "vga.h"
6#include "paging.h"
swissChilid8137922021-02-17 15:34:07 -08007
swissChili0b35bf22021-02-18 12:49:40 -08008int kmain(void *mboot)
swissChilid8137922021-02-17 15:34:07 -08009{
swissChilid3a652e2021-02-21 22:16:06 -080010// initialize_paging();
11
swissChilid8137922021-02-17 15:34:07 -080012 vga_clear();
13 vga_set_color(LIGHT_BLUE, BLACK);
14 vga_write("Hello!\nWelcome to Bluejay OS\n");
swissChilid8137922021-02-17 15:34:07 -080015 vga_set_color(WHITE, BLACK);
16
swissChili0b35bf22021-02-18 12:49:40 -080017 init_descriptor_tables();
swissChilid8137922021-02-17 15:34:07 -080018
swissChili0b35bf22021-02-18 12:49:40 -080019 vga_set_color(LIGHT_GREEN, BLACK);
20 vga_write("Setup complete!\n");
21 vga_set_color(WHITE, BLACK);
swissChilid8137922021-02-17 15:34:07 -080022
swissChili825d46b2021-02-21 10:14:16 -080023 init_timer(20);
24
swissChili19ef4182021-02-21 17:45:51 -080025 init_kbd();
swissChilidefeb0d2021-02-18 15:28:36 -080026 asm volatile("sti");
27
swissChili0b35bf22021-02-18 12:49:40 -080028
swissChili825d46b2021-02-21 10:14:16 -080029#ifdef TEST_PAGE_FAULT
30 kprintf("Causing page fault:\n");
31
32 volatile uint *ptr = (uint *) 0xa0000000;
33 volatile uint cause_page_fault = *ptr;
34
35 kprintf("Should have caused page fault: %d...\n", cause_page_fault);
36#endif
37
38 while (true)
39 asm volatile("hlt");
40
swissChilid8137922021-02-17 15:34:07 -080041 return 0xCAFEBABE;
42}