| View previous topic :: View next topic |
| Author |
Message |
fishdrop
Joined: 31 Oct 2006 Posts: 16
|
Posted: Tue Oct 31, 2006 9:09 pm Post subject: SecKernelLoadExec in PRX with devhook(FW2.xx)? |
|
|
I want to write prx code execute homebrew(fw1.50) in emulating mode(fw 2.xx).
So, my testing code following....
PSP_MODULE_INFO("ExecuteHB", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
.........
ercd = sceKernelLoadExec(homebrewpath, NULL);
.........
But Error ocurs 0x80020149 which is SCE_KERNEL_ERROR_ILLEGAL_PERM_CALL
What is problem?
( I think this code in kernel mode. but behavior is not in --.)
Let me know please.... |
|
| Back to top |
|
 |
tnt
Joined: 11 Oct 2006 Posts: 9
|
Posted: Tue Oct 31, 2006 10:54 pm Post subject: |
|
|
Do you have USE_KERNEL_LIBS in your prx makefile ?
I think it's needed to use the kernel version of sceKernelLoadExec ... |
|
| Back to top |
|
 |
etenia
Joined: 07 Sep 2006 Posts: 6
|
Posted: Wed Nov 01, 2006 5:55 am Post subject: |
|
|
Correct me if I'm wrong, but I thought homebrew voor 2xx (using Devhook) was only in user mode.
nice to hear that I'm not the only one who tries to load 1.50 homebrew in 2.71 firmware (devhook or not, but expecialy for native 2.71 TA-82 users). I'm stucked at the point to emulate the 1.50 firmware to execute the 1.50 homebrew :p |
|
| Back to top |
|
 |
fishdrop
Joined: 31 Oct 2006 Posts: 16
|
Posted: Wed Nov 01, 2006 11:09 am Post subject: |
|
|
| tnt wrote: | Do you have USE_KERNEL_LIBS in your prx makefile ?
I think it's needed to use the kernel version of sceKernelLoadExec ... |
Of cource, I use USE_KERNEL_LIBS=1 in makefile. |
|
| Back to top |
|
 |
fishdrop
Joined: 31 Oct 2006 Posts: 16
|
Posted: Wed Nov 01, 2006 11:21 am Post subject: |
|
|
| etenia wrote: | Correct me if I'm wrong, but I thought homebrew voor 2xx (using Devhook) was only in user mode.
nice to hear that I'm not the only one who tries to load 1.50 homebrew in 2.71 firmware (devhook or not, but expecialy for native 2.71 TA-82 users). I'm stucked at the point to emulate the 1.50 firmware to execute the 1.50 homebrew :p |
I think, no exists any restriction in prx because prx is a part of kernel.
If not, there is a cause or problem.
Let me know this. |
|
| Back to top |
|
 |
etenia
Joined: 07 Sep 2006 Posts: 6
|
Posted: Thu Nov 02, 2006 4:43 am Post subject: |
|
|
With HEN enabled, you can load other (kernel mode) modules trough a usermode module. HEN is also avaible for devhook
HEN is made by Dark_Alex and should be good to find. I thought Moonlight (from this forum) and Dark_Alex were the same :p
Edit: I made a Module Extender (a prx loader) for SE-A/B, but it only works on Devhook, because you can't load modules from a memorystick from SE (atm).
But what I want to say is that my Module Extender is in user mode. So it should be possible (but I will test my own code to make sure I'm not lying :p )
| Code: |
PSP_MODULE_INFO("SE_ME", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
|
| Code: |
SceUID mod = pspSdkLoadStartModule(line, PSP_MEMORY_PARTITION_KERNEL);
if (mod < 0 )
{
fprintf(strout,"Loading module: '%s' failed (%x)\n", line, mod);
errorsCount++;
}
|
where line is the module path.
I should mention that this a module wich loads other modules, so it's not in eboot format |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Thu Nov 02, 2006 10:02 pm Post subject: |
|
|
You can't loadexec anything from kernel mode in 2.XX, the function sceKernelLoadExec in LoadExecForKernel doesn't exit anymore, and the function for LoadExecForUser gives the error illegal perm call when called from a vsh or kernel thread.
Of course in kernel mode you can patch everything. Looking at the asm code, you only have to patch a couple of conditionals to get rid of the illegal permanent call error.
Using user functions in kernel prx's is not a good idea in 2.XX. In fact, in 2.8X it is prohibited and a kernel prx with user imports doesn't load anymore... |
|
| Back to top |
|
 |
fishdrop
Joined: 31 Oct 2006 Posts: 16
|
Posted: Thu Nov 02, 2006 10:15 pm Post subject: |
|
|
| moonlight wrote: | You can't loadexec anything from kernel mode in 2.XX, the function sceKernelLoadExec in LoadExecForKernel doesn't exit anymore, and the function for LoadExecForUser gives the error illegal perm call when called from a vsh or kernel thread.
Of course in kernel mode you can patch everything. Looking at the asm code, you only have to patch a couple of conditionals to get rid of the illegal permanent call error.
Using user functions in kernel prx's is not a good idea in 2.XX. In fact, in 2.8X it is prohibited and a kernel prx with user imports doesn't load anymore... |
Thanks for your answer.
I already found it from your prx document home.
So, I try to another and have a question.
Why can't use pspsdk's libc in kernel mode?
(same reason above?) |
|
| Back to top |
|
 |
|