void INIT NORETURN kMain(unsigned int mBootCode, multiboot_info_t * mBootInfo) { //Kernel C Entry Point // Check boot code if(mBootCode != MULTIBOOT_BOOTLOADER_MAGIC) { Panic("kMain: OS must be loaded by a multiboot bootloader"); } // Wipe screen MemSet((void *) 0xC00B8000, 0, 0xFA0); // Core Initialization (most other stuff depends on this) IntrInit(); CpuInit(); MemManagerInit(mBootInfo); MemSlabInit(); // Other Initializations CpuInitLate(); TimerInit(); ProcInit(); IoBlockCacheInit(); IoDevFsInit(); // Exit boot mode MemFreeInitPages(); ProcIntSelfExit(); }
int main(void) { #ifdef chat InitScreen(); InitSystem(); ClientConnectChat(1); MessageType(); ClientConnectChat(0); DeleteScreen(); EndClient(); #endif #ifdef server ProcInit(); printf("server end \n"); #endif #ifdef test InitSystem(); #endif return 0; }
void KernelMain(void) { void *text; ArchInit(); MemInit(); ProcInit(); MemMapRange(0, 0, (void*) 0x00100000, 0); KeMapPhysicalRange(0x00000000, 0x00001000, false); KeMapPhysicalRange(0x00001000, 0x000A0000, false); KeMapPhysicalRange(0x000A0000, 0x000B8000, false); text = KeMapPhysicalRange(0x000B8000, 0x000C0000, false); KeMapPhysicalRange(0x000C0000, 0x00100000, false); VmmShare(text, L"_fb_text"); enable(); ScEnableSwitch(true); ThrCreateThread(&proc_idle, true, KeStartupThread, false, NULL, 16, L"KeStartupThread"); for (;;) ArchProcessorIdle(); }