Hello! I have created a simple program that loads the appropriate USB drivers to use a mass storage device. However, I can only run it from uLaunchelf. When I run it from ps2link, ps2link crashes and video output stops (blue screen).
int ret;
SifInitRpc(0);
init_scr();
// SBV Patches
sbv_patch_enable_lmb();
sbv_patch_disable_prefix_check();
ret = SifLoadModule("rom0:SIO2MAN", 0, NULL);
ret = SifLoadModule("rom0:MCMAN", 0, NULL);
ret = SifLoadModule("rom0:MCSERV", 0, NULL);
ret = SifLoadModule("rom0:PADMAN", 0, NULL);
ret = SifLoadModule("rom0:IOMAN", 0, NULL);
mcInit(MC_TYPE_MC);
ret = SifLoadModule("mc0:usbd.irx", 0, NULL);
ret = SifLoadModule("mc0:usb_mass.irx", 0, NULL);
nopdelay();
ret = usb_mass_bindRpc();
if (ret < 0 )
{
scr_printf("\nSifBindRpc failed: %d !!!!\n", ret);
}
else
{
scr_printf("Usb Driver Initialized\n");
}
When run from uLaunchelf, "Usb Driver Initialized" is printed to my screen.
When run from ps2link, crazy stuff happens :) Can someone please explain why this is happening and is there a way around it? Thanks
As far as I remember of the top of my head, I don't think you need to load rom0:IOMAN for USB support and I think PS2Link already loads a variant of this module in the form of iomanx.irx from PS2SDK, this conflict could be your problem.
Lukasz wrote:As far as I remember of the top of my head, I don't think you need to load rom0:IOMAN for USB support and I think PS2Link already loads a variant of this module in the form of iomanx.irx from PS2SDK, this conflict could be your problem.
Well I just tried loading it through ps2link again without loading IOMAN as you said, same thing occurs. However, I briefly saw the exception handler which stated that something was wrong w/ "Module Manager." I am still tinkering with this to figure it out.
This will print the exception in the console on your PC instead of on the screen.
You can also try to have a look at the source for my Memory Plus ELF loader, the only real difference between it and what you are trying to do is that it loads an ELF from the memory card instead of an IRX.
Update: Well I have reset the IOP, load all basic modules from rom0 (SIO2MAN, MCMAN, MCSERV, PADMAN), then try to load usbd.irx and usb_mass.irx from mc0. All goes well until
ret = SifLoadModule("mc0:usbd.irx", 0, NULL); is called. The ps2 hangs. And I am calling usbd.irx before usb_mass.irx
Edit: I will have a look at Memory Plus ELF loader tonight
Edit 2: Well even after resetting the IOP, When I load usbd.irx, the ps2 hangs once again :( Still looking through sources...
Edit 3 Update 2: Wow. I found the problem. All that precious time... wasted :( The problem was my usbd.irx file. I reckon it was incompatible. I got it from one of my retail games, and it worked fine with PS2 Reality Media Player... So i took the usbd.irx from "C:\ps2dev\ps2sdk\iop\irx\usbd.irx" and it worked beautufilly over ps2link with no problems. I didnt even need to reset the IOP. I never would have thought my usbd.irx was incompatible... oh well at least now I know. Thanks