 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
sebzzz
Joined: 22 Jan 2007 Posts: 2
|
Posted: Mon Jan 22, 2007 2:11 am Post subject: Memorystick Raw Access |
|
|
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 |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Mon Jan 22, 2007 5:11 am Post subject: |
|
|
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 |
|
 |
sebzzz
Joined: 22 Jan 2007 Posts: 2
|
Posted: Mon Jan 22, 2007 5:35 am Post subject: |
|
|
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 |
|
 |
|
|
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
|