usb_mass and ps2link problems

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
Derek8588
Posts: 62
Joined: Fri Oct 22, 2004 2:14 pm

usb_mass and ps2link problems

Post by Derek8588 »

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).

Code: Select all

    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 &#40;ret < 0 &#41; 
    &#123;
         scr_printf&#40;"\nSifBindRpc failed&#58; %d !!!!\n", ret&#41;;
    &#125; 
    else
    &#123; 
         scr_printf&#40;"Usb Driver Initialized\n"&#41;;
    &#125;
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
cheriff
Regular
Posts: 258
Joined: Wed Jun 23, 2004 5:35 pm
Location: Sydney.au

Post by cheriff »

Could it be that ps2link does not reset the IOP before starting your app? I do not know how uLaunchelf behaves.

In which case the MC related modules would already be loaded, and may object to a 2nd attempt.... Just a suggestion :)
Damn, I need a decent signature!
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

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.
Derek8588
Posts: 62
Joined: Fri Oct 22, 2004 2:14 pm

Post by Derek8588 »

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.
User avatar
Lukasz
Posts: 248
Joined: Mon Jan 19, 2004 8:37 pm
Location: Denmark
Contact:

Post by Lukasz »

Use the netdump option in ps2client

Code: Select all

ps2client netdump
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.

http://lukasz.dk/2008/04/22/datel-memory-plus-64-mb/
Derek8588
Posts: 62
Joined: Fri Oct 22, 2004 2:14 pm

Post by Derek8588 »

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
Post Reply