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 

Run ELF within an ELF?

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



Joined: 29 Nov 2009
Posts: 27

PostPosted: Tue Dec 01, 2009 10:45 am    Post subject: Run ELF within an ELF? Reply with quote

i want to embed code that will run an ELF file like ULaunchELF but automaticly (without user interaction) any ideas?
Back to top
View user's profile Send private message MSN Messenger
barf



Joined: 14 Aug 2008
Posts: 8
Location: Norway

PostPosted: Wed Dec 02, 2009 5:42 am    Post subject: Reply with quote

I suggest intersecting uLauncELF
Back to top
View user's profile Send private message AIM Address
jgrimm



Joined: 29 Nov 2009
Posts: 27

PostPosted: Wed Dec 02, 2009 6:09 am    Post subject: Reply with quote

yes, thats what i was thinking, but how exactly do i do that? im kinda noob at this. im guessing i include some header or .c from ulauncheELF source right? i just need to know wich file
Back to top
View user's profile Send private message MSN Messenger
cosmito



Joined: 04 Mar 2007
Posts: 314
Location: Portugal

PostPosted: Wed Dec 02, 2009 8:14 pm    Post subject: Reply with quote

It's not that simple. You have to understand ULaunchELF source code. We will not do it for it, of course :) . If you don't, the only way is to start learning programming.
Back to top
View user's profile Send private message Visit poster's website
jgrimm



Joined: 29 Nov 2009
Posts: 27

PostPosted: Thu Dec 03, 2009 6:45 am    Post subject: Reply with quote

ok, im not i t much of a c or c++ person but i can program my ps2, havent looked at ulaunchelf source much though i dont need u to do it for me, but could u tell me how? or at least give me a vauge idea? thx
Back to top
View user's profile Send private message MSN Messenger
dlanor



Joined: 28 Oct 2004
Posts: 269
Location: Stockholm, Sweden

PostPosted: Sat Dec 05, 2009 8:42 am    Post subject: Reply with quote

jgrimm wrote:
ok, im not i t much of a c or c++ person but i can program my ps2, havent looked at ulaunchelf source much though i dont need u to do it for me, but could u tell me how? or at least give me a vauge idea? thx
If you want the ability to do generic elf launching exactly like uLE, to get the same degree of compatibility to other elfs, then you will need to copy quite a lot of the methods used by uLE into your own program. This includes, but is not limited to, a special 'loader' subprogram that is compiled as a separate elf file which is embedded as data inside the main uLE program file.

uLE normally does not launch an external target elf directly, but instead does it by preparing the full pathname of that target elf and passing this as an argument in launching the 'loader' elf from embedded storage. It is this 'loader' program that then launches the real target elf.

The advantage of such a method, widely used in other PS2 homebrews as well, is that all the memory spaces normally used by uLE are freed up before the real target elf is launched. Thus there will be no memory conflicts with any such elfs, unless they happen to use the same memory segments in which the tiny 'loader' program resides. And those memory segments were of course chosen so as to avoid overlapping any area used by normal programs, including both commercial games and homebrews.

Inside the uLE source package you will find the "loader" subprogram source code in a subfolder with the same name, and the code of the main program that invokes this 'loader' is found in the file "elf.c".

For the rest you're on your own...
Good Luck!

Best regards: dlanor
Back to top
View user's profile Send private message
jgrimm



Joined: 29 Nov 2009
Posts: 27

PostPosted: Sat Dec 05, 2009 10:26 am    Post subject: Reply with quote

Ok thats just about exactly what i needed to know! i thought it had somthing to do with elf.c thanx thats just what i was looking for dlanor
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 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