8002013C by loading kernel prx in user mode app
8002013C by loading kernel prx in user mode app
Hi there,
I try to load mymodule.prx from the SDK samples (testprx) in an user mode app (a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4) using the following code:
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0);
if (modid < 0) {
pspDebugScreenPrintf ("Result from loading %08X\n",modid);
}
else {
int ret = sceKernelStartModule(modid, 0, NULL, &fd, NULL);
if (ret < 0) {
pspDebugScreenPrintf ("Result from starting %08X\n", ret);
}
}
it returns:
Result from starting 8002013C
How can I fix this ?
mymodule.prx is extremely simple (see samples in PSPSDK)
I try to load mymodule.prx from the SDK samples (testprx) in an user mode app (a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4) using the following code:
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0);
if (modid < 0) {
pspDebugScreenPrintf ("Result from loading %08X\n",modid);
}
else {
int ret = sceKernelStartModule(modid, 0, NULL, &fd, NULL);
if (ret < 0) {
pspDebugScreenPrintf ("Result from starting %08X\n", ret);
}
}
it returns:
Result from starting 8002013C
How can I fix this ?
mymodule.prx is extremely simple (see samples in PSPSDK)
you say
but then you contradict with
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0) ;
Code: Select all
a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0) ;
10011011 00101010 11010111 10001001 10111010
yeah yeah.. And the state of the documentation is in such a good quality I *should* know anything about it. I don't have all the time and perhaps the intellect to reverse engineer the PSP like u do.... The fact remains that the most basic and simple prx module with only links with -lpspuser -lpspkernel -lpsplibc can't run in that environment. AND IT DID UNDER 3.10 oe.. And nobody of you can give me a proper answer about that. Of course I googled the damn error code, and I know what it means. But I hoped that you cracks did know something I didn't!TyRaNiD wrote:0x8002013C means library not found which means some library you are trying to link into your kernel prx is not there or available. Really I wonder why people touch kernel mode when they dont klnow anything about it :)
AND I NEED an USER mode application for WPA network and kernel for ME stuff for realtime video decoding.. Please don't lecture me.
Dickydick. Pimpware.org
The PBP runs and connects through WPA in user mode (1.50 doesn't know WPA) .. I need that..dot_blank wrote:you saybut then you contradict withCode: Select all
a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0) ;
Also I need a kernel module for ME stuff... So that's why I need kernel module. I don't see any contradiction in that.
And these EXACT statements DID run under 3.10 OE
Try pspSdkLoadStartModule:
Works fine for me under the 3.52 kernel.
Code: Select all
SceUID mod = pspSdkLoadStartModule("ms0:/blah.prx", PSP_MEMORY_PARTITION_KERNEL);
if (mod < 0) {
printf("Error 0x%08X loading/starting blah.prx.\n", mod);
}
i guess you TOTALLY missed what i was pointing out :) ...never did i say anything aboutDickyDick wrote:The PBP runs and connects through WPA in user mode (1.50 doesn't know WPA) .. I need that..dot_blank wrote:you saybut then you contradict withCode: Select all
a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0) ;
Also I need a kernel module for ME stuff... So that's why I need kernel module. I don't see any contradiction in that.
And these EXACT statements DID run under 3.10 OE
kernel mode and user mode / threads / access modes
point is that you say you put this module with your PSP/GAMExx/APP/xxx
but then you call to root of fatms0:/ for this same module ...so it would
not be able to find and link
also we are not "cracks" here :) ....also you dont NEED kernel mode
you just NEED to patch module init :)
10011011 00101010 11010111 10001001 10111010
That's what I learned today:also we are not "cracks" here :) ....also you dont NEED kernel mode
you just NEED to patch module init :)
1. some kind of dependancy on linking modules:
- they need to be in the same (GAME) folder
2. you don't need kernel mode for using the 'me'
Thanks, these are the answers I look for, thank you for your time (and patience ;-))
jas0nuk wrote:Try pspSdkLoadStartModule:
Works fine for me under the 3.52 kernel.Code: Select all
SceUID mod = pspSdkLoadStartModule("ms0:/blah.prx", PSP_MEMORY_PARTITION_KERNEL); if (mod < 0) { printf("Error 0x%08X loading/starting blah.prx.\n", mod); }
And you started the loading app in USER mode ? I still get the 8002013c. Also I run from GAME and not from GAME150 or other.
I used the prx module in the sdk example. Perhaps there is something wrong with that beast.
I suggest folks work from the nanddumper example in the 3.xx HEN archive. That works perfectly in 3.xx on the phat and slim. The main app is a user mode program that calls an external prx with the kernel stuff in it. The kernel mode prx is simple, just reading the nand, but it gives a nice skeleton for how 3.xx apps should be done.jas0nuk wrote:Yes, the app which calls pspSdkLoadStartModule is fully usermode, perhaps the 3.xx kernel doesn't like the SDK PRX sample? o_O
Now.. I got it to work.. With the PSP sdk example!
Solution: Had to strip all the ctr0 and startup stuff. (and provide module_start myself) now only -lpspkernel has to link. And the kernel PRX just loads and runs fine!
Solution: Had to strip all the ctr0 and startup stuff. (and provide module_start myself) now only -lpspkernel has to link. And the kernel PRX just loads and runs fine!
Code: Select all
psp-gcc -I/usr/local/pspdev/psp/sdk/include/libc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib -specs=/usr/local/pspdev/psp/sdk/lib/prxspecs -Wl,-q,-T/usr/local/pspdev/psp/sdk/lib/linkfile.prx -mno-crt0 -nostartfiles main.o exports.o -lpspkernel -o mymodule.elf
-
- Posts: 328
- Joined: Sun Jun 03, 2007 10:05 pm
I use the exact samefile EXCEPT... It uses build.mak instead of build_prx.mak... What would be the difference?TyRaNiD wrote:Seeing as people seem to have so much trouble with making a kernel prx I bothered to put my template into the sdk under samples/templates/kprx_template. Just add code to main_thread and you are in business.
Remember to always use only kernel libraries in the kernel prx. Use user libraries in the kernel prx is one of the main reasons you got that 8002013C error.
Anyways in 3.71 you will probably have more problems, since Sony has changed some kernel nids (they can't change the user ones that game use), like the ones of ctrl.prx, syscon, gpio, power, and some others.
Really in 3.XX you should restrict the kernel code to the minimum, and only use it for the things that really require it.
One of the main cases why a 1.50 application used kernel mode, was to load modules from flash and patch the device check and plain module check, in 3.XX, that is not necesary, since you don't need to do any patch, and you could usually call kuKernelLoadModule from cfw sdk to load a module with the same privileges than a kernel module would do it. You can also use sceKernelLoadModule, but that one fails with some of the modules of the flash.
The problem of net applications in 1.5X (that had to be kernel mode to load the flash modules), doesn't apply here either.
Anyways in 3.71 you will probably have more problems, since Sony has changed some kernel nids (they can't change the user ones that game use), like the ones of ctrl.prx, syscon, gpio, power, and some others.
Really in 3.XX you should restrict the kernel code to the minimum, and only use it for the things that really require it.
One of the main cases why a 1.50 application used kernel mode, was to load modules from flash and patch the device check and plain module check, in 3.XX, that is not necesary, since you don't need to do any patch, and you could usually call kuKernelLoadModule from cfw sdk to load a module with the same privileges than a kernel module would do it. You can also use sceKernelLoadModule, but that one fails with some of the modules of the flash.
The problem of net applications in 1.5X (that had to be kernel mode to load the flash modules), doesn't apply here either.