LogF("Acess2 x86-"PLATFORM" v"EXPAND_STR(KERNEL_VERSION)"\r\n");
LogF(" Build %i, Git Hash %s\r\n", BUILD_NUM, gsGitHash);
- Log("MbMagic = %08x, MbInfoPtr = %p", MbMagic, MbInfoPtr);
-
// Set up non-boot info dependent stuff
Desctab_Install(); // Set up GDT and IDT
MM_PreinitVirtual(); // Initialise virtual mappings
}
else
gaArch_BootModules[i].ArgString = (char *)mods[i].String + KERNEL_BASE;
+ Log_Log("Arch", " - %s", gaArch_BootModules[i].ArgString);
}
// Pass on to Independent Loader
gaPageReferences = (void*)MM_REFCOUNT_BASE;
Log_Log("PMem", "Physical memory set up (%lli pages of ~%lli MiB used)",
- giPhysAlloc, (giTotalMemorySize*4)/1024
+ giPhysAlloc, (giTotalMemorySize*PAGE_SIZE)/(1024*1024)
);
}
#define USE_EDI 0
#define USE_UDI 0
+#define MODULE_FLAG_LOADERROR 0x1
// === PROTOTYPES ===
int Module_int_Initialise(tModule *Module, const char *ArgString);
"Module %p (%s) is for another architecture (%i)",
Module, Module->Name, Module->Arch
);
+ LEAVE('i', MODULE_ERR_BADMODULE);
+ return MODULE_ERR_BADMODULE;
+ }
+
+ LOG("Module->Flags = %x", Module->Flags);
+ if(Module->Flags & MODULE_FLAG_LOADERROR ) {
+ Log_Warning("Module", "%s has already attempted to load and encountered errors", Module->Name);
+ LEAVE('i', MODULE_ERR_MISC);
+ return MODULE_ERR_MISC;
}
deps = Module->Dependencies;
Log_Warning("Module", "Unable to load, reason: Miscelanious");
break;
case MODULE_ERR_NOTNEEDED:
-// Log_Debug("Module", "Unable to load, reason: Module not needed");
+ Log_Debug("Module", "Unable to load, reason: Module not needed");
break;
case MODULE_ERR_MALLOC:
Log_Warning("Module", "Unable to load, reason: Error in malloc/realloc/calloc, probably not good");
Log_Warning("Module", "Unable to load reason - Unknown code %i", ret);
break;
}
+ Module->Flags |= MODULE_FLAG_LOADERROR;
LEAVE_RET('i', ret);
return ret;
}