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 

How to include IRX files in .ELF ?

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



Joined: 27 Feb 2004
Posts: 36
Location: France

PostPosted: Tue Aug 24, 2004 11:48 pm    Post subject: How to include IRX files in .ELF ? Reply with quote

Hi all,

I see that some programs don't have .IRX files but load modules anyway.
I deduce they are included in the .ELF file.

I saw that in the Altimit project, but when reading source code, i don't know how it loads module.

Can someone tell me how does it works ?

thx
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Wed Aug 25, 2004 12:37 am    Post subject: Reply with quote

1) produce a .s file out of the irx file:

Code:
bin2s my_module.irx my_module.s my_module



2) declare the module into your C code:

Code:
extern unsigned char my_module[];
extern unsigned int size_my_module;



3) load the module into your C code:

Code:
int ret;
SifExecModuleBuffer(my_module, size_my_module, 0, NULL, &ret);



4) don't forget to compile the .s file with your C code:

Code:
ee-gcc -o final_binary.elf my_code.c my_module.s

_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
BiB



Joined: 27 Feb 2004
Posts: 36
Location: France

PostPosted: Wed Aug 25, 2004 1:24 am    Post subject: Reply with quote

ok thanks a lot for your quick and very precise answer.

However i still have a problem.

I downloaded Altimit 0.1 (src and bin) ans when i compile sources, i don't have the same size as the original ELF (this last works)
Mine is 328 Ko (uncompressed) whereas the original is 1 Mb

What am i doing wrong
Back to top
View user's profile Send private message
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Wed Aug 25, 2004 1:20 pm    Post subject: Reply with quote

yours might be stripped from symbols, the distributed 0.1 elf might not, wich would make debugging easier for tombola.
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
evilo



Joined: 22 Apr 2004
Posts: 230

PostPosted: Wed Aug 25, 2004 6:36 pm    Post subject: Reply with quote

very very interesting information, I will certainely resuse it also for my project ;)

thanks for the tip !
Back to top
View user's profile Send private message Visit poster's website
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