| View previous topic :: View next topic |
| Author |
Message |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Mar 29, 2009 5:28 am Post subject: [Solved] Module Manager busy? |
|
|
| Code: | // User Module Loading Options
SceKernelLMOption option;
SceUID mpid = PSP_MEMORY_PARTITION_USER;
memset(&option, 0, sizeof(option));
option.size = sizeof(option);
option.mpidtext = mpid;
option.mpiddata = mpid;
option.position = 0;
option.access = 1;
// Load User Module
SceUID usermodule = kuKernelLoadModule(USER_MODULE_PATH, 0, &option);
// Start User Module
int startstatus = 0;
char * test = "Coldbird loaded a Usermodule!";
result = sceKernelStartModule(usermodule, strlen(test), (void*)test, &startstatus, NULL); |
Both usermodule & result get the value 0x80020143 which equals the constant of "Module Manager Busy".
I know that the errors' meaning is quite self-explaining but how am I ment to counteract this?
Hook into the module-loading dialog using the M33 SDK and wait for all modules to be loaded?
I'm hoping someone of you has a idea.
Greetings, Coldbird. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Last edited by Coldbird on Thu Apr 02, 2009 1:22 am; edited 1 time in total |
|
| Back to top |
|
 |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Sun Mar 29, 2009 11:10 am Post subject: |
|
|
Could try
| Code: | | while(!sceKernelFindModuleByName("sceKernelLibrary")) sceKernelDelayThread(100000); |
_________________ Programming with:
Geany + Latest PSPSDK from svn |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Mar 29, 2009 11:16 am Post subject: |
|
|
I don't quite see what this has to do with the Kernel Library...
Mind giving a explanation? _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sun Mar 29, 2009 1:56 pm Post subject: |
|
|
| There's appears to be nothing wrong with that code. Where are you calling it from? And why do you need kuKernelLoadModule? |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Mar 29, 2009 8:16 pm Post subject: |
|
|
Because other Module Loading Functions fail to execute.
I found the hint to use this ku function in a old topic of yours aswell. It doesn't crash, thus I think it's the right function to use, but the just mentioned Module Manager is busy stuff pops up.
First attempt was to call it in module_start but I figured that this might be the problem because module_start still belongs to the Module Manager Initialization...
So I moved it to the Main Thread by moving it into main. But still no different.
I even coded a few debug routines to output me what's happening...
Here goes the tracelog...
| Code: | Entering int main(int argc, char * argv[])
Entering int initPlayNet(void)
Leaving int initPlayNet(void)
Entering int hookModules(void)
Entering SceUID loadModule(const char * path, SceUID mpid, uint32 maxattempts)
Leaving int SceUID loadModule(const char * path, SceUID mpid, uint32 maxattempts)
Leaving int hookModules(void) |
And here the debuglog...
| Code: | ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #1
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #2
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #3
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #4
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #5
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #6
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #7
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #8
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #9
ms0:/seplugins/adhocwrapper/usermodule.prx Load Attempt #10
ms0:/seplugins/adhocwrapper/usermodule.prx Load Failed - 80020143
ms0:/seplugins/adhocwrapper/usermodule.prx Failed to load |
Don't wonder about main not leaving properly... I did a while(1) loop in there with sceKernelDelayThread to keep the thread alive.
I did a few wrapper functions for everything, to have a easier time calling complex stuff without having to triple check every error possibility.
There are two wrappers, namely loadModule and startModule... startModule only get's called when loadModule did it's job properly... judging from the debuglog we can see it doesn't.
From the tracelog you can figure out the calling conventions too, not that they are important but the more info the better I suppose. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sun Mar 29, 2009 9:30 pm Post subject: |
|
|
ku* functions are nothing but syscalls to the kernel mode equivalent of the sce* function. Its the same as calling sceKernelLoadModule from a kernel PRX. AFAIK kernel mode is only needed to load special modules like vshmain.prx.
You've screwed up something elsewhere which is causing this. You might have some plugins enabled thats causing this or something. |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Sun Mar 29, 2009 9:40 pm Post subject: |
|
|
Can't be the plugins, the only one in game.txt is my kernelmodule.prx - which attempts to load usermodule.prx.
Edit: I exchanged the ku one for the normal sceKernelLoadModuleMS and now I get the error code 0x8002013A which equals the constant SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED.
But how can that thing not be linked?
Edit #2: I think I know what's the problem. The library that contains the sceKernelLoadModuleMS function isn't loaded yet...
But without the function being residing in memory I can't load other libraries, can I? I mean... the loader functions are located in that library.
I'm probably misinterpreting the error, if so please correct me. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Mon Mar 30, 2009 7:33 am Post subject: |
|
|
| Coldbird wrote: | Can't be the plugins, the only one in game.txt is my kernelmodule.prx - which attempts to load usermodule.prx.
Edit: I exchanged the ku one for the normal sceKernelLoadModuleMS and now I get the error code 0x8002013A which equals the constant SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED.
But how can that thing not be linked?
Edit #2: I think I know what's the problem. The library that contains the sceKernelLoadModuleMS function isn't loaded yet...
But without the function being residing in memory I can't load other libraries, can I? I mean... the loader functions are located in that library.
I'm probably misinterpreting the error, if so please correct me. |
The little thing I posted waits until all the kernel modules are loaded, which should solve the problem of it not being loaded. _________________ Programming with:
Geany + Latest PSPSDK from svn |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Mon Mar 30, 2009 9:15 am Post subject: |
|
|
I figured as much. The problem is that never happens. With your code in there it ends in a endless loop. _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
NoEffex
Joined: 27 Nov 2008 Posts: 108
|
Posted: Tue Mar 31, 2009 5:10 am Post subject: |
|
|
| Coldbird wrote: | | I figured as much. The problem is that never happens. With your code in there it ends in a endless loop. | Have you tried it? It's always worked fine for me. In english: "Lets check if sceKernelLibrary is loaded, you know, the kernel. If it is, lets go ahead and skip this delay here, else we'll delay and start from square one". _________________ Programming with:
Geany + Latest PSPSDK from svn |
|
| Back to top |
|
 |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Tue Mar 31, 2009 7:02 am Post subject: |
|
|
I know what it means. My C / C++ knowledge ain't that basic.
The problem is just what I told you. I've placed debug code around the command... it's stuck there.
I can't understand that myself... cause I know that the kernel library for usermode modules is loaded as a standard module from firmware config on flash...
Nor can I see anything wrong with the snippet you provided.
I'm far more trying to understand why this is the case.
Edit: SOLVED! All I had to do was use the sceKernelLoadModule & sceKernelStartModule in their own thread so they can't block the caller.
The sceKernelDelayThread while waiting for Kernel Module was needed aswell.
In combination. It works very well. Thanks everyone! _________________ Been gone for some time. Now I'm back. Someone mind getting me up-2-date? |
|
| Back to top |
|
 |
|