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 

porting a 1.50 PSP app to 3.xx

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



Joined: 10 Jan 2006
Posts: 12
Location: USA

PostPosted: Fri Apr 04, 2008 5:33 am    Post subject: porting a 1.50 PSP app to 3.xx Reply with quote

hi everyone, i'm the author of PSPSeq (http://dspmusic.org/psp). at the moment i do all my development on a 1.50 fat and have users use various apps like eloader or timemachine to run on new firmware. that's ok, but what i would really like is to get this program running natively on 3.xx/slim hardware.

as i understand it, the common issue is whether or not your program requires kernel mode function calls. if it does, they are put into a separate library and loaded into the main user mode app, right? is there a complete list of functions that are kernel mode only? if not, is there an easy way to tell from the function name if it is kernel or user?

once i have this list, i assume the next step is to follow the general procedure outlined in this post:

http://forums.ps2dev.org/viewtopic.php?t=9022

take all kernel functions, add a small wrapper, include the necessary module_start() and module_stop() functions, build as a prx, include in the main user mode app, and then be done with it.

does that sound generally correct? is there anything else that i need to watch out for? thanks!

ethan
dspmusic.org/psp
Back to top
View user's profile Send private message Visit poster's website
jean



Joined: 05 Jan 2008
Posts: 489

PostPosted: Fri Apr 04, 2008 6:11 am    Post subject: Reply with quote

over and over again....Functions messing up with hardware are generally kernel side. I can't point you to a list, but you can figure it out trying to compile a small program with the functions you need and then launch prxtool on the compiled binary and see what are the modules exporting your functions. If i'm not wrong, when you see "_Driver" you are in kernel mode. To be honest, i'm currently doing it by error-and-retry..... :)
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Fri Apr 04, 2008 7:11 am    Post subject: Reply with quote

Quote:
is there anything else that i need to watch out for?




Spaghetti code you started writing two years ago.
Sorry, couldn't help it.
_________________
If not actually, then potentially.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Apr 04, 2008 8:02 am    Post subject: Re: porting a 1.50 PSP app to 3.xx Reply with quote

plankton wrote:
hi everyone, i'm the author of PSPSeq (http://dspmusic.org/psp). at the moment i do all my development on a 1.50 fat and have users use various apps like eloader or timemachine to run on new firmware. that's ok, but what i would really like is to get this program running natively on 3.xx/slim hardware.

as i understand it, the common issue is whether or not your program requires kernel mode function calls. if it does, they are put into a separate library and loaded into the main user mode app, right? is there a complete list of functions that are kernel mode only? if not, is there an easy way to tell from the function name if it is kernel or user?


The easiest way to tell if it's a kernel-mode function is to look at the name of the library it's in - if the library ends with "_driver", it's kernel-mode. If not, it's user-mode. In general, there are VERY few kernel-mode functions that you would ever use. One is to change the audio playback sample rate from 44100 to 48000. Another is to activate and run functions on the MediaEngine. Another would be to add a debug exception handler. In general, if you don't do one of those three, you won't have any kernel-mode functions to worry about.

Quote:
once i have this list, i assume the next step is to follow the general procedure outlined in this post:

http://forums.ps2dev.org/viewtopic.php?t=9022

take all kernel functions, add a small wrapper, include the necessary module_start() and module_stop() functions, build as a prx, include in the main user mode app, and then be done with it.

does that sound generally correct?


Yes. Read the explanation of the 3.xx HEN example I posted a little ways down in that thread for more info.

http://forums.ps2dev.org/viewtopic.php?p=58653#58653


Quote:
is there anything else that i need to watch out for? thanks!

ethan
dspmusic.org/psp


If you use a kernel-mode prx, you have to compile the main program as a prx as well (you'll see "BUILD_PRX = 1" in the makefile of the example). If you want to use the extra RAM in the Slim, put "PSP_LARGE_MEMORY = 1" in the makefile as well. If you DO build the main program as a prx, the default heap size is tiny - you should add either "PSP_HEAP_SIZE_MAX();" to main.c, or "PSP_HEAP_SIZE_KB(48000);" if you use threads in the main program. The number in the macro is the number of kB to make the heap; obviously you wouldn't use 48000 on a Phat PSP.
Back to top
View user's profile Send private message AIM Address
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