Unfortunately this is not a new technique to load modules in a user module without ever touching kernel mode, however it is a slightly better one than previous stuff :P
As many will know loading modules up on the 1.0 and 1.5 version PSPs generally require kernel mode somewhere. However it is also the case that trying to link in a user module (which you just loaded) into a kernel module will fail as the kernel doesn't want to link those two apps together. There has been various ways of resolving this issue for things like the net libs and atrac3 by manually scanning and resolving the functions at run time which is abit of a pain, or using a bootstrap which you tend to have to write to load up all your modules before your own user mode app starts in order that everything is working.
In pspsdk I have added a new patch (pspSdkInstallKernelLoadModulePatch) which once installed in kernel mode will allow a user app to load what ever modules it likes in what ever order it likes (potentially saving ram etc.) This superceeds the nodevice check patch which worked for encrypted kernel prx from flash but would crash the kernel when loading the all important user modules thereby making it fairly useless.
I have included the patch in psplink's bootstrap as well as psppacker so if you are developing an application which needs to load modules then you can first develop it under psplink loading modules when ever you feel like and for release you can run it through psppacker and the resultant binary should then work as expected on any 1.0 and 1.5 psp.
Of course you lot can just ignore me ;)
Loading modules from a user module (1.0/1.5)
-
- Posts: 339
- Joined: Thu Sep 29, 2005 4:19 pm
Re: Loading modules from a user module (1.0/1.5)
Does that mean that in my app I can change the PSP_MODULE_INFO argument from 0x1000 to 0x0 and then run the app in psplink if in psplink.ini I modload all the modules used by my app? That is provided my app does not include vfpu and me code.TyRaNiD wrote:I have included the patch in psplink's bootstrap as well as psppacker so if you are developing an application which needs to load modules then you can first develop it under psplink loading modules when ever you feel like and for release you can run it through psppacker and the resultant binary should then work as expected on any 1.0 and 1.5 psp.
EDIT:
No I seem to misunderstand something. I tried my assumption with the example in /usr/local/pspdev/psp/sdk/samples/net/simple
It returns: Error, command did not complete 0x800201A8
jockyw2001 well net/simple isn't the best place to start. That calls kernel functions so if you are a user mode app it will crash what ever. Adding the module using modload defeats the object, you can do that but this is not what the patch is designed to allow. The patch is to allow you to load modules directly from your user app.
If you add say
to the main function of net/simple_prx then you will see it works ;)
moonlight, if you want more stubs adding to pspsdk it isn't an issue just one of effort :) I personally just haven't been bothered to do so.
If you add say
Code: Select all
SceUID modID;
modID = pspSdkLoadStartModule("flash0:/kd/ifhandle.prx", PSP_MEMORY_PARTITION_KERNEL);
modID = pspSdkLoadStartModule("flash0:/kd/pspnet.prx", PSP_MEMORY_PARTITION_USER);
modID = pspSdkLoadStartModule("flash0:/kd/pspnet_inet.prx", PSP_MEMORY_PARTITION_USER);
modID = pspSdkLoadStartModule("flash0:/kd/pspnet_apctl.prx", PSP_MEMORY_PARTITION_USER);
modID = pspSdkLoadStartModule("flash0:/kd/pspnet_resolver.prx", PSP_MEMORY_PARTITION_USER);
moonlight, if you want more stubs adding to pspsdk it isn't an issue just one of effort :) I personally just haven't been bothered to do so.