15 extern void Heap_Install();
16 extern void Desctab_Install();
17 extern void MM_PreinitVirtual();
18 extern void MM_Install(tMBoot_Info *MBoot);
19 extern void MM_InstallVirtual();
20 extern void Threads_Init();
21 extern int Time_Setup();
22 extern Uint Proc_Clone(Uint *Err, Uint Flags);
23 extern void Threads_Sleep();
24 extern void Threads_Exit();
29 int kmain(Uint MbMagic, tMBoot_Info *MbInfo)
34 // Adjust Multiboot structure address
35 MbInfo = (void*)( (Uint)MbInfo + KERNEL_BASE );
37 Desctab_Install(); // Set up GDT and IDT
38 MM_PreinitVirtual(); // Initialise vital mappings
39 MM_Install( MbInfo ); // Set up physical memory manager
40 MM_InstallVirtual(); // Clean up virtual address space
41 Heap_Install(); // Create initial heap
43 Log("Starting Multitasking...");
50 Log("Starting VFS...");
51 // Load Virtual Filesystem
54 Log("Loading Modules...");
56 // Load initial modules
57 mods = (void*)( MbInfo->Modules + KERNEL_BASE );
58 for(i=0;i<MbInfo->ModuleCount;i++)
60 // Adjust into higher half
61 mods[i].Start += KERNEL_BASE;
62 mods[i].End += KERNEL_BASE;
63 mods[i].String += KERNEL_BASE;
65 Log("Loading '%s'", mods[i].String);
67 if( !Module_LoadMem( (void *)mods[i].Start, mods[i].End-mods[i].Start, (char *)mods[i].String ) )
69 Warning("Unable to load module\n");
73 // Pass on to Independent Loader
74 Log("Loading Configuration...");
75 System_Init( (char*)(MbInfo->CommandLine + KERNEL_BASE) );
77 // Sleep forever (sleeping beauty)
78 for(;;) Threads_Sleep();