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 

loading an irx from ee memory

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



Joined: 12 Dec 2008
Posts: 6

PostPosted: Fri Dec 12, 2008 9:34 pm    Post subject: loading an irx from ee memory Reply with quote

EDIT: Problem Solved :)

Last edited by Ramja on Tue Dec 16, 2008 6:22 am; edited 1 time in total
Back to top
View user's profile Send private message
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Fri Dec 12, 2008 11:44 pm    Post subject: Reply with quote

IOP module loading from EE memory is not supported in the BIOS modules by default, you need to use the sbv patches library in PS2SDK which enables it by patching the running modules.

You can check my mplus loader source as a reference on how to use sbv:

http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb/
_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
Ramja



Joined: 12 Dec 2008
Posts: 6

PostPosted: Sat Dec 13, 2008 6:07 am    Post subject: Reply with quote

hi thanks for the reply

the same thing still happens.

here is wat my files look like nw:

main.c

Code:

#include <tamtypes.h>
#include <debug.h>
#include <fileio.h>
#include <iopcontrol.h>
#include <kernel.h>
#include <loadfile.h>
#include <sbv_patches.h>

extern u32 ps2ips_irx;
extern u32 size_ps2ips_irx;

int main()
{
   int ret;

   init_scr();

   SifLoadFileInit();

   SifExecModuleBuffer(&ps2ips_irx, &size_ps2ips_irx, 0, NULL, &ret);

        scr_printf("Module Loaded");

   SleepThread();
}



Makefile:
Code:

EE_BIN = test.elf
EE_OBJS = test.o ps2ips.o

EE_LDFLAGS = -s -Ttext 0x01800000 # Load ELF at 24 MB offset
EE_LIBS += -lps2ip -lc -ldebug -lpatches
EE_CFLAGS = -DRESETIOP #-DDEBUG


all: $(EE_BIN)
   
clean:
   rm -f $(EE_BIN) ORG_$(EE_BIN) $(EE_OBJS) ps2ips.s

ps2ips.s:
   bin2s ps2ips.irx ps2ips.s ps2ips_irx

$(EE_BIN) : $(EE_OBJS)
   $(EE_CC) -mno-crt0 -T$(PS2SDK)/ee/startup/linkfile $(EE_LDFLAGS) \
      -o ORG_$(EE_BIN) $(EE_OBJS) $(EE_LIBS)
   ps2-packer-lite ORG_$(EE_BIN) $(EE_BIN)


include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
Back to top
View user's profile Send private message
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Sat Dec 13, 2008 7:09 am    Post subject: Reply with quote

You havn't called the patch function sbv_patch_enable_lmb

Check the header sbv header:

sbv_patches.h
_________________
Lukasz.dk
Back to top
View user's profile Send private message Visit poster's website
Ramja



Joined: 12 Dec 2008
Posts: 6

PostPosted: Sat Dec 13, 2008 7:27 am    Post subject: Reply with quote

greetings lukasz,

we still have no luck.

Thanks agan


Code:
int main()
{
   init_scr();

   
   scr_printf("   Loading Modules...\n");

   int ret;

   SifLoadFileInit();

   sbv_patch_enable_lmb();

   SifExecModuleBuffer(&ps2ips_irx, &size_ps2ips_irx, 0, NULL, &ret);

        scr_printf("   Loaded Modules...\n");

}
Back to top
View user's profile Send private message
Ramja



Joined: 12 Dec 2008
Posts: 6

PostPosted: Sat Dec 13, 2008 2:43 pm    Post subject: Reply with quote

Further greetings,

It turns out the IRX has been loaded successfully (I know because I added a scr_printf afterwards), but when calling ps2ip_init() it just hangs.

I am not using Ps2link to test this.

Thankz
Back to top
View user's profile Send private message
Lukasz



Joined: 19 Jan 2004
Posts: 248
Location: Denmark

PostPosted: Sat Dec 13, 2008 6:31 pm    Post subject: Reply with quote

You need to load some modules before ps2ip.irx. SifExecModuleBuffer in your case probably returns -203, which is a dependency error.

As suggested in this thread, take a look at existing source code and go from there.

You need to research more on your own, look at existing source code etc. Instead of asking very basic questions you can easily find the answer for yourself, because eventually people will just stop caring and answering them :-)
_________________
Lukasz.dk
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