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 

Memorystick Raw Access

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



Joined: 22 Jan 2007
Posts: 2

PostPosted: Mon Jan 22, 2007 2:11 am    Post subject: Memorystick Raw Access Reply with quote

Hi,
for my program I need raw access to the memorystick. My Idea is to open 'ms0:' like a block device (in linux I would simply open '/dev/ms0' or something like that), but sceIoOpen denies that.
I already searched the forum and found other names for the memorystick device, like 'mscm', mscm0', msstore' ... and so on.
Most of these devices I can sceIoOpen but when I try to read from them, I just get an error.
I am able to raw-access 'umd0:' or any files on the memorystick, but I cant access ms0 as a block-device.
The purpose for this is for example the ability to format the stick by myself through the psp (yes yes, I know, you could do it from the xmb) or to measure the rawspeed of the memorystick (without going through the file-system).
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Jan 22, 2007 5:11 am    Post subject: Reply with quote

The following code works fine.

Code:

SceUID fd = sceIoOpen("msstor0:", PSP_O_RDONLY, 0);

if (fd < 0)
{
   // Error handling here
}

int read = sceIoRead(fd, buf, 512);
sceIoClose(fd);


It seems that the size to read has to be multiple of 512.
I guess that the same goes for writing, but not tested that.

Unlike umd0: where the unit is the sector (2048 bytes), the unit here is the byte.
Back to top
View user's profile Send private message
sebzzz



Joined: 22 Jan 2007
Posts: 2

PostPosted: Mon Jan 22, 2007 5:35 am    Post subject: Reply with quote

THX moonlight! It works now.

'msstor0' seems to be the only devicename that works, and that was the only one I havent testet out :)
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