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 

PRX sample in PSPSDK

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



Joined: 01 Sep 2009
Posts: 6
Location: São Paulo/SP (Brasil)

PostPosted: Thu Feb 11, 2010 10:47 pm    Post subject: PRX sample in PSPSDK Reply with quote

Hi all

I'm trying the PRX example in pspsdk but I can't get it to work.

I can build both the prx-loader and the example prx and i copy the .prx file to the root of MS. I'm using Windows Vista.

But when I launch the Sample PRX Loader the app starts and exits out without printing anything to the screen.

I have a PSP-3000 with ChickHEN/CF 5.03GEN-B. Is it possible that it is not compatible with the sample? If so, is there any other way to use PRX?
Back to top
View user's profile Send private message
unsigned int



Joined: 13 Aug 2009
Posts: 22

PostPosted: Thu Feb 11, 2010 11:34 pm    Post subject: Reply with quote

The sample only works on 1.50 kernel because the eboot uses some kernel functions to load the prx and display informations about it.

Nice writeups on creating and using a PRX on 3.x+ firmwares are here (from the sticky of this subforum):

Quote:
Porting a 1.50 firmware homebrew to 3.xx firmware: http://forums.ps2dev.org/viewtopic.php?p=59266#59266
Making a kernel mode PRX: http://forums.ps2dev.org/viewtopic.php?p=58653#58653
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Fri Feb 12, 2010 2:43 am    Post subject: Reply with quote

Those samples really are legacy now, what you want is the prx_template or kprx_template in the samples/template directory. They should work out of the box.
Back to top
View user's profile Send private message
daniel.franzini



Joined: 01 Sep 2009
Posts: 6
Location: São Paulo/SP (Brasil)

PostPosted: Fri Feb 12, 2010 5:10 am    Post subject: pRX Reply with quote

Thanks for the answers

unsigned int: thank you but some of these information seems to be outdated as well as those samples

TyRaNiD: thanks, but i have studied those examples and i don't seem to understand how a prx gets loaded and unloaded and how does one export any routines from a prx?
Back to top
View user's profile Send private message
unsigned int



Joined: 13 Aug 2009
Posts: 22

PostPosted: Fri Feb 12, 2010 6:06 am    Post subject: Re: pRX Reply with quote

daniel.franzini wrote:
i don't seem to understand how a prx gets loaded and unloaded and how does one export any routines from a prx?


The second link I posted describes exactly these steps (hint: pspSdkLoadStartModule() and creating an .exp-file).

Those informations are still relevant, the methods of creating and loading a prx have not changed since 3.00.
Back to top
View user's profile Send private message
daniel.franzini



Joined: 01 Sep 2009
Posts: 6
Location: São Paulo/SP (Brasil)

PostPosted: Fri Feb 12, 2010 8:16 am    Post subject: prx - try #1 Reply with quote

Hi

Thank you for the explanations. I found this link with a detailed tutorial on PRX.

I read it and tried to apply the info in it. Unfortunately, it did not work.

Here is the example I'm trying to run.

myprx.c
Code:

#include <pspkernel.h>

PSP_MODULE_INFO( "MyPRX", PSP_MODULE_USER, 0 , 0 );
PSP_NO_CREATE_MAIN_THREAD();

int func(void)
{
   return 0;
}

int module_start(SceSize argc, void* argp)
{
   return 0;
}

int module_stop(SceSize args, void* argp)
{
   return 0;
}


myprx_exp.exp
Code:

PSP_BEGIN_EXPORTS

PSP_EXPORT_START(syslib, 0, 0x8000)
   PSP_EXPORT_FUNC(module_start)
   PSP_EXPORT_VAR(module_info)
PSP_EXPORT_END

PSP_EXPORT_START(myprx, 0, 0x0001)
   PSP_EXPORT_FUNC(func)
PSP_EXPORT_END

PSP_END_EXPORTS


Makefile
Code:

TARGET=myprx

$(shell psp-build-exports -k $(TARGET)_exp.exp)
$(shell psp-build-exports -s -k $(TARGET)_exp.exp)

OBJS = $(TARGET).o $(TARGET)_exp.o

BUILD_PRX=1
PRX_EXPORTS=myprx_exp.exp

INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS += -mno-crt0 -nostartfiles

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Altough compilation and linking goes fine (an ELF is generated) psp-fixup-imports.exe gives me this error message:
Code:
Error, no .lib.stub section found


Thank you.

Than
Back to top
View user's profile Send private message
Davee



Joined: 22 Jun 2009
Posts: 59

PostPosted: Fri Feb 12, 2010 10:53 am    Post subject: Reply with quote

It's a bug in the toolchain. You can safely type "make" again after you get that error, or you can import a function and never use it.
Back to top
View user's profile Send private message
victorprosa



Joined: 14 Jan 2009
Posts: 38

PostPosted: Fri Feb 12, 2010 10:53 am    Post subject: Reply with quote

An effort should be started in order to port 1.50 SDK stuff to newer kernels...

When necessary to use it for projects, it gives a lot of headaches...
Back to top
View user's profile Send private message Send e-mail
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