#include "alloc.h" #include "debug.h" #include "drivers.h" #include "gdt.h" #include "idt.h" #include "kprintf.h" #include "memory.h" #include "power.h" #include "shell.h" #include "string.h" #include "terminal.h" #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__) #error "This tutorial needs to be compiled with a ix86-elf compiler" #endif void kernel_main(void) { terminal_initialize(); init_gdt(); init_idt(); init_memory(); load_drivers(); kprintf(KERN_ALERT "I see no way to confuse an array of 256 seg:off pairs with a " "complex 8*unknown quantity -byte descriptor table. -- Troy " "Martin 03:50, 22 March 2009 (UTC)\n"); /* int i = 0; */ /* while (vmalloc(10)) */ /* ; */ /* if (i++ > 70000) */ /* kprintf("%d\n", i); */ /* void *tab[1024]; */ /* for (int i = 0; i < 1023; i++) { */ /* tab[i] = alloc_pages(1, NULL); */ /* PRINT_INT(i); */ /* PRINT_PTR(tab[i]); */ /* if (!tab[i]) */ /* break; */ /* memset(tab[i], i, 4096); */ /* } */ /* PRINT_UINT(((uint8_t *)tab[0])[0]); */ /* for (int i = 0; i < 10; i++) */ /* PRINT_UINT(((uint8_t *)tab[i])[0]); */ /* PRINT_PTR(tab[i]); */ shell_init(); }