| View previous topic :: View next topic |
| Author |
Message |
DickyDick
Joined: 21 Aug 2004 Posts: 29
|
Posted: Sat Sep 15, 2007 7:16 am Post subject: 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) |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Sat Sep 15, 2007 7:21 am Post subject: |
|
|
| 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 :) |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Sat Sep 15, 2007 9:56 am Post subject: |
|
|
you say | Code: | | a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4 |
but then you contradict with
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0) ; _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
DickyDick
Joined: 21 Aug 2004 Posts: 29
|
Posted: Sun Sep 16, 2007 6:05 am Post subject: |
|
|
| 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 :) |
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!
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 |
|
| Back to top |
|
 |
DickyDick
Joined: 21 Aug 2004 Posts: 29
|
Posted: Sun Sep 16, 2007 6:07 am Post subject: |
|
|
| dot_blank wrote: | you say | Code: | | a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4 |
but then you contradict with
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0) ; |
The PBP runs and connects through WPA in user mode (1.50 doesn't know WPA) .. I need that..
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 |
|
| Back to top |
|
 |
jas0nuk
Joined: 27 Apr 2006 Posts: 137
|
Posted: Sun Sep 16, 2007 6:52 am Post subject: |
|
|
Try pspSdkLoadStartModule:
| Code: | SceUID mod = pspSdkLoadStartModule("ms0:/blah.prx", PSP_MEMORY_PARTITION_KERNEL);
if (mod < 0) {
printf("Error 0x%08X loading/starting blah.prx.\n", mod);
} |
Works fine for me under the 3.52 kernel. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Sun Sep 16, 2007 10:04 am Post subject: |
|
|
| DickyDick wrote: | | dot_blank wrote: | you say | Code: | | a PRX inside PBP which is running from dir /PSP/GAME on 3.52 M33-4 |
but then you contradict with
SceUID modid = sceKernelLoadModule("ms0:/mymodule.prx",0,0) ; |
The PBP runs and connects through WPA in user mode (1.50 doesn't know WPA) .. I need that..
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 |
i guess you TOTALLY missed what i was pointing out :) ...never did i say anything about
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 |
|
| Back to top |
|
 |
DickyDick
Joined: 21 Aug 2004 Posts: 29
|
Posted: Sun Sep 16, 2007 4:33 pm Post subject: |
|
|
| Quote: |
also we are not "cracks" here :) ....also you dont NEED kernel mode
you just NEED to patch module init :) |
That's what I learned today:
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 ;-)) |
|
| Back to top |
|
 |
DickyDick
Joined: 21 Aug 2004 Posts: 29
|
Posted: Sun Sep 16, 2007 5:03 pm Post subject: |
|
|
| jas0nuk wrote: | Try pspSdkLoadStartModule:
| Code: | SceUID mod = pspSdkLoadStartModule("ms0:/blah.prx", PSP_MEMORY_PARTITION_KERNEL);
if (mod < 0) {
printf("Error 0x%08X loading/starting blah.prx.\n", mod);
} |
Works fine for me under the 3.52 kernel. |
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. |
|
| Back to top |
|
 |
jas0nuk
Joined: 27 Apr 2006 Posts: 137
|
Posted: Sun Sep 16, 2007 9:01 pm Post subject: |
|
|
| Yes, the app which calls pspSdkLoadStartModule is fully usermode, perhaps the 3.xx kernel doesn't like the SDK PRX sample? o_O |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Mon Sep 17, 2007 2:11 am Post subject: |
|
|
perhaps you shouldnt be touching the kernel memory partitions
SceUID mod = pspSdkLoadStartModule("ms0:/blah.prx", PSP_MEMORY_PARTITION_KERNEL); _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Sep 17, 2007 5:33 am Post subject: |
|
|
| 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 |
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. |
|
| Back to top |
|
 |
DickyDick
Joined: 21 Aug 2004 Posts: 29
|
Posted: Mon Sep 17, 2007 5:42 am Post subject: |
|
|
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!
| Code: | | 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 |
|
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Mon Sep 17, 2007 6:02 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Mon Sep 17, 2007 10:02 am Post subject: |
|
|
| 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. |
I use the exact samefile EXCEPT... It uses build.mak instead of build_prx.mak... What would be the difference? |
|
| Back to top |
|
 |
kururin
Joined: 05 Jul 2006 Posts: 36
|
Posted: Mon Sep 17, 2007 10:48 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
|