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 

Help, opening files on UMD

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 7:19 am    Post subject: Help, opening files on UMD Reply with quote

Is there a special way to read files from UMD?

I can open the file with either of the following:-

int fd = sceIoOpen("umd0:/UMD_DATA.BIN", O_RDONLY, 0);
int fd = sceIoOpen("disc0:/UMD_DATA.BIN", O_RDONLY, 0);

However, when I try and read the file with:

res = sceIoRead(fd, buf, read_size);

It fails. Is there some special way to Open these files? Anyone done it?

Steddy
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 7:46 am    Post subject: Reply with quote

Sorry, slight change to the above statement.

umd0: Opens the file without error, but won't read.
disc0: Fails on the Open

The error I get on the read with UMD0: is -2147373053.

Does anyone have a clue what that error means? Someone must have tried this and got it working.

Steddy
Back to top
View user's profile Send private message
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Thu Jun 02, 2005 7:54 am    Post subject: Reply with quote

umd0 is a block device
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 7:58 am    Post subject: Reply with quote

Vampire wrote:
umd0 is a block device


Emm... not according to this:-

http://forums.ps2dev.org/viewtopic.php?t=1646

The Open command succeeds with the full path to the file in there, so I don't think it can be a block device.

Steddy
Back to top
View user's profile Send private message
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Thu Jun 02, 2005 8:30 am    Post subject: Reply with quote

steddy wrote:
The Open command succeeds with the full path to the file in there, so I don't think it can be a block device.

Much to learn, you still have...my old padawan. ;-)
Back to top
View user's profile Send private message
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Thu Jun 02, 2005 6:36 pm    Post subject: Reply with quote

[DELETED]

Last edited by Vampire on Thu Jun 02, 2005 8:30 pm; edited 2 times in total
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 7:01 pm    Post subject: Reply with quote

[DELETED]
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Thu Jun 02, 2005 8:11 pm    Post subject: Reply with quote

[DELETED]
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 9:01 pm    Post subject: Reply with quote

Really... seems a little odd to me. How long is eventually.

I left it going 2 minutes and it still didn't complete the open.

Code:
   /* Now attempt to dump the UMD file passed */
   int fd;

   do {
         int fd = sceIoOpen(fromfile, O_RDONLY, 0);
   } while (fd<0);

Steddy
Back to top
View user's profile Send private message
tomt



Joined: 23 May 2005
Posts: 12

PostPosted: Thu Jun 02, 2005 9:19 pm    Post subject: Reply with quote

steddy wrote:
Really... seems a little odd to me. How long is eventually.

I left it going 2 minutes and it still didn't complete the open.

Code:
   /* Now attempt to dump the UMD file passed */
   int fd;

   do {
         int fd = sceIoOpen(fromfile, O_RDONLY, 0);
   } while (fd<0);

Steddy


could you actually read from it then or does that just make the ioopen succeed?

if it is dma then you probably need to register a callback which is called with the address of the data when it arrives..
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 9:48 pm    Post subject: Reply with quote

No it doesn't work, it always returns an error.

None of the File IO on the PSP requires callbacks. This is just a snippit of code, you use sceIoRead to actually get the data.

Steddy
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Thu Jun 02, 2005 9:49 pm    Post subject: Reply with quote

No, I didn't try a read...and the delay was only a few seconds.

I started with the UMD already in there by the way....might matter?

I'll try some more :)

0xdf
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Thu Jun 02, 2005 9:53 pm    Post subject: Reply with quote

Steddy,
There's an error in your code.

You redefine fd inside the while loop again, so the value you check as termination is the one defined outside the loop....that one will never change.
Remove the 'int' from the inner loop :)

0xdf
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 9:53 pm    Post subject: Reply with quote

Thanks for offering to try it.

I also haven't got to the read, that above loop never exits.

I boot the device with the Wipeout UMD inserted, then run the code. I have tried ejecting and reinserting also.

I doubt that code running from the UMD needs to do anything special, since its already on the UMD so it must be open. Sony may have made it so the disk needs unlocking in some way when running from another location.

Steddy
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Thu Jun 02, 2005 9:55 pm    Post subject: Reply with quote

We posted at the same time...I hope you didn't miss message I posted just above yours.

0xdf
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 10:04 pm    Post subject: Reply with quote

0xdeadface wrote:
Steddy,
There's an error in your code.

You redefine fd inside the while loop again, so the value you check as termination is the one defined outside the loop....that one will never change.
Remove the 'int' from the inner loop :)

0xdf


I really thought you had it then and I was being really dumb. I introduced that error when I put the delay in, it wasn't there before.

I changed it to this:-

Code:
   int fd;

   do {
         fd = sceIoOpen(fromfile, O_RDONLY, 0);
   } while (fd<0);

It still fails :( What the heck is going on.

I am wondering if it doesn't like the '_' in the file name. Mine is a JAP PSP and I wonder if it should be encoded differently.

Steddy
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Thu Jun 02, 2005 10:06 pm    Post subject: Reply with quote

I guess most of us use a JAP PSP..as the others have no 1.0?

But I tried opening the same file as you and it did pass. I did try it on RR USA btw.

Weird :\

0xdf
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Thu Jun 02, 2005 10:19 pm    Post subject: Reply with quote

Okay...

I did have other code in the while to display the result so I could see it change. Because my output macro by default waits for the VBlank, I think that made it work. With the loop as posted above it indeed does not...thread starvation?

However, if you insert a sceDisplayWaitVblankStart() in the while loop.....any better?

0xdf
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Thu Jun 02, 2005 10:26 pm    Post subject: Reply with quote

Code:
   do {
         fd = sceIoOpen(fromfile, O_RDONLY, 0);
      sceDisplayWaitVblankStart();
   } while (fd<0);


Still the same :(
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Fri Jun 03, 2005 1:53 am    Post subject: Reply with quote

As per this ongoing discussion, I'm afraid we can't have threads showing folks how to dump their UMDs.

Vampire I'm a bit surprised you would post that even after the discussion.

steddy if you want to know how to get files off of UMD, you're going to have to find out on your own or somewhere else.

Locked.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    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