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 

flash USB connection

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



Joined: 28 Dec 2006
Posts: 23

PostPosted: Wed Mar 14, 2007 4:47 am    Post subject: flash USB connection Reply with quote

How can I make the USB connect to the flash0 or flash1 instead of the ms0?

I have tried this:

Code:
   sceIoUnassign("ms0:");
   sceIoAssign("flash0:", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);


but that doesn't seem to do anything... I know I'm missing something but I've completely forgotten what it is.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Mar 14, 2007 5:30 am    Post subject: Reply with quote

Who cares?
Back to top
View user's profile Send private message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Wed Mar 14, 2007 6:43 am    Post subject: Reply with quote

=(

I do. I wanted to be able to access my flash drives through an eboot program so I could modify the files.
Back to top
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Wed Mar 14, 2007 4:20 pm    Post subject: Reply with quote

that is a function allowed in one of the recovery mode of one of the latter DAX firmwares I think
Back to top
View user's profile Send private message
harleyg



Joined: 05 Oct 2005
Posts: 123

PostPosted: Wed Mar 14, 2007 5:48 pm    Post subject: Reply with quote

Yeah it is, but he wants to copy it...
Back to top
View user's profile Send private message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Thu Mar 15, 2007 6:36 am    Post subject: Reply with quote

not exactly copy it, but use it in a different program.
Back to top
View user's profile Send private message
glynnder



Joined: 04 Sep 2005
Posts: 35

PostPosted: Thu Mar 15, 2007 8:45 pm    Post subject: Reply with quote

so, copy it?
Back to top
View user's profile Send private message
codes02



Joined: 08 Oct 2006
Posts: 12

PostPosted: Fri Mar 16, 2007 8:36 am    Post subject: Reply with quote

the only problem with that code is that on the assign the mention of the device needs to be "ms0:"
Code:
sceIoAssign("ms0:", "lflash0:0,0", "fatms0:", IOASSIGN_RDWR, NULL, 0);


before you were just reassigning flash0, probably returning an error code because it was already mounted. I also put in a change in the map for the block device, which may also be nessicary (or not).

Now you just have to start up the usb mass storage drivers
Back to top
View user's profile Send private message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Fri Mar 16, 2007 11:00 am    Post subject: Reply with quote

ooohhhh... so shouldn't this work? It didn't work when I tried to compile it in the complete program. Well, it compiled but when I ran it on the PSP it connected to the ms0 instead of the flash0. Should I remove sceIoUnassign() or the "fatms0:" part? (I have a gut feeling it's one of those two)

Code:
void start_usbf0()
{
   sceIoUnassign("ms0:");
   sceIoAssign("ms0:", "lflash0:0,0", "fatms0:", IOASSIGN_RDWR, NULL, 0);

   pspSdkLoadStartModule("flash0:/kd/semawm.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstor.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstormgr.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstorms.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstorboot.prx", PSP_MEMORY_PARTITION_KERNEL);

   sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
   sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
   sceUsbstorBootSetCapacity(0x800000);

   sceUsbActivate(0x1c8);

   usbStarted = 1;
   printf("\nUSB activated\n");
}


Last edited by Sleepy566 on Sun Mar 18, 2007 5:11 am; edited 1 time in total
Back to top
View user's profile Send private message
ai3gtmc30



Joined: 16 Mar 2007
Posts: 3

PostPosted: Fri Mar 16, 2007 10:38 pm    Post subject: Reply with quote

how do u activate it with buttons?
Back to top
View user's profile Send private message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Sun Mar 18, 2007 5:09 am    Post subject: Reply with quote

ai3gtmc30 wrote:
how do u activate it with buttons?


LOL. Looks like a newcomer is trying to take my idea.
Back to top
View user's profile Send private message
hallo007



Joined: 13 May 2006
Posts: 36

PostPosted: Sun Mar 18, 2007 7:03 am    Post subject: Reply with quote

Sleepy566 wrote:
ooohhhh... so shouldn't this work? It didn't work when I tried to compile it in the complete program. Well, it compiled but when I ran it on the PSP it connected to the ms0 instead of the flash0. Should I remove sceIoUnassign() or the "fatms0:" part? (I have a gut feeling it's one of those two)

Code:
void start_usbf0()
{
   sceIoUnassign("ms0:");
   sceIoAssign("ms0:", "lflash0:0,0", "fatms0:", IOASSIGN_RDWR, NULL, 0);

   pspSdkLoadStartModule("flash0:/kd/semawm.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstor.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstormgr.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstorms.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstorboot.prx", PSP_MEMORY_PARTITION_KERNEL);

   sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
   sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
   sceUsbstorBootSetCapacity(0x800000);

   sceUsbActivate(0x1c8);

   usbStarted = 1;
   printf("\nUSB activated\n");
}

if it was like this , it shouldnt took 2years before somebody founds out xD
wasnt USB SSS open source?
Back to top
View user's profile Send private message
pspwill



Joined: 17 Nov 2005
Posts: 51

PostPosted: Mon Mar 19, 2007 12:42 am    Post subject: Reply with quote

To assign flash0:/ to usb you need to create a new driver for it using the sceIoDrv functions. Theres an example of this in the mph fw launcher source.
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Mar 19, 2007 5:49 pm    Post subject: Reply with quote

It is more complicated that simple assign/unassign.

You have to redirect the msstor driver functions to the lflash driver functions, and handle some msstor specific ioctl codes (0x02125008, 0x02125803) and devctl codes (0x02125801).
Back to top
View user's profile Send private message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Tue Mar 20, 2007 5:38 am    Post subject: Reply with quote

pspwill wrote:
To assign flash0:/ to usb you need to create a new driver for it using the sceIoDrv functions. Theres an example of this in the mph fw launcher source.


Thanks a bunch, I'll check it out asap!
Back to top
View user's profile Send private message
MSN



Joined: 09 Apr 2007
Posts: 5

PostPosted: Mon Apr 09, 2007 1:17 am    Post subject: Reply with quote

were you able to connet the flash to usb?
Back to top
View user's profile Send private message
Sleepy566



Joined: 28 Dec 2006
Posts: 23

PostPosted: Thu Apr 12, 2007 7:52 am    Post subject: Reply with quote

Not yet, the driver functions from MPHL's firmware launcher code are a bit confusing.

Don't worry, I'm still working it on it.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP 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