#include #include #include #include #include #include #include #include #include #include #include #include /* Check if the compiler thinks you are targeting the wrong operating system. */ #if defined(__linux__) #error "You are not using a cross-compiler, you will most certainly run into trouble" #endif /* This tutorial will only work for the 32-bit ix86 targets. */ //#if !defined(__i386__) | !defined(__x86_64__) //#error "This tutorial needs to be compiled with a ix86-elf compiler" //#endif void kernel_main(void) { vga_init(); vga_puts("hello world\n"); vga_puts("welcome to nirvanna\n\n"); vga_puts("initializing interrupt tables..."); idt_init(); vga_puts("interrupt tables initialized\n"); vga_puts("initializing the pic..."); pic_init(); vga_puts("pic initialized\n"); vga_puts("initializing memory pages... "); if (paging_init()) { vga_puts("memory pages allocated\n"); } else { vga_puts("failed to allocate memory pages\n"); asm volatile ("cli"); asm volatile ("hlt"); } // TODO -- fix acpi vga_puts("initializing ps/2...\n"); if (ps2_init(NULL)) vga_puts("ps/2 initialized.\n"); else vga_puts("ps/2 initialization failed.\n"); while (1); }