PRX sample in PSPSDK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
daniel.franzini
Posts: 5
Joined: Tue Sep 01, 2009 8:24 pm
Location: São Paulo/SP (Brasil)

PRX sample in PSPSDK

Post by daniel.franzini »

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?
unsigned int
Posts: 18
Joined: Thu Aug 13, 2009 11:42 pm

Post by unsigned int »

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):
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
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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.
daniel.franzini
Posts: 5
Joined: Tue Sep 01, 2009 8:24 pm
Location: São Paulo/SP (Brasil)

pRX

Post by daniel.franzini »

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?
unsigned int
Posts: 18
Joined: Thu Aug 13, 2009 11:42 pm

Re: pRX

Post by unsigned int »

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.
daniel.franzini
Posts: 5
Joined: Tue Sep 01, 2009 8:24 pm
Location: São Paulo/SP (Brasil)

prx - try #1

Post by daniel.franzini »

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: Select all

#include <pspkernel.h>

PSP_MODULE_INFO&#40; "MyPRX", PSP_MODULE_USER, 0 , 0 &#41;;
PSP_NO_CREATE_MAIN_THREAD&#40;&#41;;

int func&#40;void&#41;
&#123;
	return 0;
&#125;

int module_start&#40;SceSize argc, void* argp&#41;
&#123;
	return 0;
&#125;

int module_stop&#40;SceSize args, void* argp&#41;
&#123;
	return 0;
&#125;
myprx_exp.exp

Code: Select all

PSP_BEGIN_EXPORTS

PSP_EXPORT_START&#40;syslib, 0, 0x8000&#41;
	PSP_EXPORT_FUNC&#40;module_start&#41;
	PSP_EXPORT_VAR&#40;module_info&#41;
PSP_EXPORT_END

PSP_EXPORT_START&#40;myprx, 0, 0x0001&#41;
	PSP_EXPORT_FUNC&#40;func&#41;
PSP_EXPORT_END

PSP_END_EXPORTS
Makefile

Code: Select all

TARGET=myprx

$&#40;shell psp-build-exports -k $&#40;TARGET&#41;_exp.exp&#41;
$&#40;shell psp-build-exports -s -k $&#40;TARGET&#41;_exp.exp&#41;

OBJS = $&#40;TARGET&#41;.o $&#40;TARGET&#41;_exp.o 

BUILD_PRX=1
PRX_EXPORTS=myprx_exp.exp

INCDIR = 
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;
LIBDIR =
LDFLAGS += -mno-crt0 -nostartfiles

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
Altough compilation and linking goes fine (an ELF is generated) psp-fixup-imports.exe gives me this error message:

Code: Select all

Error, no .lib.stub section found
Thank you.

Than
Davee
Posts: 43
Joined: Mon Jun 22, 2009 3:58 am

Post by Davee »

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.
victorprosa
Posts: 37
Joined: Wed Jan 14, 2009 5:53 am

Post by victorprosa »

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...
Post Reply