flash USB connection

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Sleepy566
Posts: 23
Joined: Thu Dec 28, 2006 2:30 am

flash USB connection

Post by Sleepy566 »

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

I have tried this:

Code: Select all

   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.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Who cares?
Sleepy566
Posts: 23
Joined: Thu Dec 28, 2006 2:30 am

Post by Sleepy566 »

=(

I do. I wanted to be able to access my flash drives through an eboot program so I could modify the files.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

that is a function allowed in one of the recovery mode of one of the latter DAX firmwares I think
User avatar
harleyg
Posts: 123
Joined: Wed Oct 05, 2005 6:15 am

Post by harleyg »

Yeah it is, but he wants to copy it...
Sleepy566
Posts: 23
Joined: Thu Dec 28, 2006 2:30 am

Post by Sleepy566 »

not exactly copy it, but use it in a different program.
glynnder
Posts: 35
Joined: Sun Sep 04, 2005 9:54 pm

Post by glynnder »

so, copy it?
codes02
Posts: 12
Joined: Sun Oct 08, 2006 8:56 am

Post by codes02 »

the only problem with that code is that on the assign the mention of the device needs to be "ms0:"

Code: Select all

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
Sleepy566
Posts: 23
Joined: Thu Dec 28, 2006 2:30 am

Post by Sleepy566 »

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: Select all

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.
ai3gtmc30
Posts: 3
Joined: Fri Mar 16, 2007 9:15 pm

Post by ai3gtmc30 »

how do u activate it with buttons?
Sleepy566
Posts: 23
Joined: Thu Dec 28, 2006 2:30 am

Post by Sleepy566 »

ai3gtmc30 wrote:how do u activate it with buttons?
LOL. Looks like a newcomer is trying to take my idea.
hallo007
Posts: 36
Joined: Sat May 13, 2006 6:15 pm

Post by hallo007 »

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: Select all

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?
pspwill
Posts: 51
Joined: Thu Nov 17, 2005 8:07 am

Post by pspwill »

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.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

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).
Sleepy566
Posts: 23
Joined: Thu Dec 28, 2006 2:30 am

Post by Sleepy566 »

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!
MSN
Posts: 5
Joined: Mon Apr 09, 2007 1:14 am

Post by MSN »

were you able to connet the flash to usb?
Sleepy566
Posts: 23
Joined: Thu Dec 28, 2006 2:30 am

Post by Sleepy566 »

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