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 Proc_Start();
21 extern Uint Proc_Clone(Uint *Err, Uint Flags);
22 extern void Proc_Sleep();
23 extern void Proc_Exit();
28 int kmain(Uint MbMagic, tMBoot_Info *MbInfo)
33 // Adjust Multiboot structure address
34 MbInfo = (void*)( (Uint)MbInfo + KERNEL_BASE );
36 Desctab_Install(); // Set up GDT and IDT
37 MM_PreinitVirtual(); // Initialise vital mappings
38 MM_Install( MbInfo ); // Set up physical memory manager
39 MM_InstallVirtual(); // Clean up virtual address space
40 Heap_Install(); // Create initial heap
42 Log("Starting Multitasking...");
46 Log("Starting VFS...");
47 // Load Virtual Filesystem
50 Log("Loading Modules...");
52 // Load initial modules
53 mods = (void*)( MbInfo->Modules + KERNEL_BASE );
54 for(i=0;i<MbInfo->ModuleCount;i++)
56 // Adjust into higher half
57 mods[i].Start += KERNEL_BASE;
58 mods[i].End += KERNEL_BASE;
59 mods[i].String += KERNEL_BASE;
61 Log("Loading '%s'", mods[i].String);
63 if( !Module_LoadMem( (void *)mods[i].Start, mods[i].End-mods[i].Start, (char *)mods[i].String ) )
65 Warning("Unable to load module\n");
69 // Pass on to Independent Loader
70 Log("Loading Configuration...");
71 System_Init( (char*)(MbInfo->CommandLine + KERNEL_BASE) );
73 // Sleep forever (sleeping beauty)