forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SecKernelLoadExec in PRX with devhook(FW2.xx)?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
fishdrop



Joined: 31 Oct 2006
Posts: 16

PostPosted: Tue Oct 31, 2006 9:09 pm    Post subject: SecKernelLoadExec in PRX with devhook(FW2.xx)? Reply with quote

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
View user's profile Send private message
tnt



Joined: 11 Oct 2006
Posts: 9

PostPosted: Tue Oct 31, 2006 10:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
etenia



Joined: 07 Sep 2006
Posts: 6

PostPosted: Wed Nov 01, 2006 5:55 am    Post subject: Reply with quote

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
View user's profile Send private message
fishdrop



Joined: 31 Oct 2006
Posts: 16

PostPosted: Wed Nov 01, 2006 11:09 am    Post subject: Reply with quote

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
View user's profile Send private message
fishdrop



Joined: 31 Oct 2006
Posts: 16

PostPosted: Wed Nov 01, 2006 11:21 am    Post subject: Reply with quote

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
View user's profile Send private message
etenia



Joined: 07 Sep 2006
Posts: 6

PostPosted: Thu Nov 02, 2006 4:43 am    Post subject: Reply with quote

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
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Thu Nov 02, 2006 10:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
fishdrop



Joined: 31 Oct 2006
Posts: 16

PostPosted: Thu Nov 02, 2006 10:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group