- mods = (void*)( mbInfo->Modules + KERNEL_BASE );
- giArch_NumBootModules = mbInfo->ModuleCount;
- gaArch_BootModules = malloc( giArch_NumBootModules * sizeof(*gaArch_BootModules) );
- for( i = 0; i < mbInfo->ModuleCount; i ++ )
- {
- int ofs;
-
- Log_Log("Arch", "Multiboot Module at 0x%08x, 0x%08x bytes (String at 0x%08x)",
- mods[i].Start, mods[i].End-mods[i].Start, mods[i].String);
-
- gaArch_BootModules[i].PBase = mods[i].Start;
- gaArch_BootModules[i].Size = mods[i].End - mods[i].Start;
-
- // Always HW map the module data
- ofs = mods[i].Start&0xFFF;
- gaArch_BootModules[i].Base = (void*)( MM_MapHWPages(mods[i].Start,
- (gaArch_BootModules[i].Size+ofs+0xFFF) / 0x1000
- ) + ofs );
-
- // Only map the string if needed
- if( (tVAddr)mods[i].String > MAX_ARGSTR_POS )
- {
- // Assumes the string is < 4096 bytes long)
- gaArch_BootModules[i].ArgString = (void*)(
- MM_MapHWPages(mods[i].String, 2) + (mods[i].String&0xFFF)
- );
- }
- else
- gaArch_BootModules[i].ArgString = (char *)mods[i].String + KERNEL_BASE;
- }