Memorystick Raw Access

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

Moderators: cheriff, TyRaNiD

Post Reply
sebzzz
Posts: 2
Joined: Mon Jan 22, 2007 1:58 am

Memorystick Raw Access

Post by sebzzz »

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

Post by moonlight »

The following code works fine.

Code: Select all

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

if &#40;fd < 0&#41;
&#123;
	// Error handling here
&#125;

int read = sceIoRead&#40;fd, buf, 512&#41;;
sceIoClose&#40;fd&#41;;
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.
sebzzz
Posts: 2
Joined: Mon Jan 22, 2007 1:58 am

Post by sebzzz »

THX moonlight! It works now.

'msstor0' seems to be the only devicename that works, and that was the only one I havent testet out :)
Post Reply