 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
ahman
Joined: 31 May 2006 Posts: 22
|
Posted: Wed Sep 12, 2007 3:56 pm Post subject: Correct usage of usbmass to avoid MS corruption |
|
|
I noticed that some homebrews enable the use of usb mass storage, but incorrect usage will result in memory stick corruption.
Once a particular homebrew turned on usbmass and allow the user to use a PC to copy some files to the MS. Upon completion, the homebrew turned off usbmass. At this moment, the memory stick driver cache (consists of FAT table, etc) on the PSP is out of date and if the homebrew modify files on the MS, the memory stick will be corrupted. To avoid corruption, you'll need to invalidate the MS driver cache after unmounting usbmass, like this.
| Code: |
sceIoDevctl("fatms0:", 0x0240D81E, NULL, 0, NULL, 0 );
|
The above call to sceIoDevCtl will invalidate the cache and that's also what XMB did when the usbmass is unmounted. This will also result in all open file describtors to be closed. |
|
| Back to top |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Wed Sep 12, 2007 8:36 pm Post subject: |
|
|
Wow, good info!
I will put that into the program I am currently writing....
sceIoDevctl("flashfat0:", 0x0240D81E, NULL, 0, NULL, 0 );
would do the same for flash0:/, am I right? |
|
| Back to top |
|
 |
e_boris
Joined: 19 May 2007 Posts: 25
|
Posted: Wed Sep 12, 2007 10:37 pm Post subject: |
|
|
| Thanks for the tip. How do you get the device names? is there any name lists? I mean for the “fatms0:” |
|
| Back to top |
|
 |
ahman
Joined: 31 May 2006 Posts: 22
|
Posted: Thu Sep 13, 2007 1:57 pm Post subject: |
|
|
| Hellcat wrote: | Wow, good info!
I will put that into the program I am currently writing....
sceIoDevctl("flashfat0:", 0x0240D81E, NULL, 0, NULL, 0 );
would do the same for flash0:/, am I right? |
I doubt this command code will work on the flash. However, I haven't tried it myself.
| e_boris wrote: | | Thanks for the tip. How do you get the device names? is there any name lists? I mean for the “fatms0:” |
Actually, the "fatms0:" is a well known device name for the memory stick. If you try to disassemble some of the firmware PRXes, you'll find many different device names. I believe someone has also posted a device name list in this forum. You may wanna search for it. |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Fri Sep 14, 2007 3:40 pm Post subject: |
|
|
| thanks for the tip ahman :) |
|
| Back to top |
|
 |
kururin
Joined: 05 Jul 2006 Posts: 36
|
Posted: Fri Sep 14, 2007 8:31 pm Post subject: |
|
|
| Hellcat wrote: | Wow, good info!
I will put that into the program I am currently writing....
sceIoDevctl("flashfat0:", 0x0240D81E, NULL, 0, NULL, 0 );
would do the same for flash0:/, am I right? |
the devctl codes are specific for each device. The one to flush flashfats is 0x00005802. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sun Jun 22, 2008 8:28 pm Post subject: |
|
|
| Does anyone have more information about devctl commands for the flash. Such as free space, etc? |
|
| Back to top |
|
 |
|
|
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
|