| View previous topic :: View next topic |
| Author |
Message |
Ramja
Joined: 12 Dec 2008 Posts: 6
|
Posted: Fri Dec 12, 2008 9:34 pm Post subject: loading an irx from ee memory |
|
|
EDIT: Problem Solved :)
Last edited by Ramja on Tue Dec 16, 2008 6:22 am; edited 1 time in total |
|
| Back to top |
|
 |
Lukasz

Joined: 19 Jan 2004 Posts: 248 Location: Denmark
|
Posted: Fri Dec 12, 2008 11:44 pm Post subject: |
|
|
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 |
|
 |
Ramja
Joined: 12 Dec 2008 Posts: 6
|
Posted: Sat Dec 13, 2008 6:07 am Post subject: |
|
|
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 |
|
 |
Lukasz

Joined: 19 Jan 2004 Posts: 248 Location: Denmark
|
Posted: Sat Dec 13, 2008 7:09 am Post subject: |
|
|
You havn't called the patch function sbv_patch_enable_lmb
Check the header sbv header:
sbv_patches.h _________________ Lukasz.dk |
|
| Back to top |
|
 |
Ramja
Joined: 12 Dec 2008 Posts: 6
|
Posted: Sat Dec 13, 2008 7:27 am Post subject: |
|
|
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 |
|
 |
Ramja
Joined: 12 Dec 2008 Posts: 6
|
Posted: Sat Dec 13, 2008 2:43 pm Post subject: |
|
|
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 |
|
 |
Lukasz

Joined: 19 Jan 2004 Posts: 248 Location: Denmark
|
Posted: Sat Dec 13, 2008 6:31 pm Post subject: |
|
|
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 |
|
 |
|