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 

Problem accessing ms0: from flash0:

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



Joined: 24 Jul 2007
Posts: 37

PostPosted: Tue Oct 02, 2007 5:58 am    Post subject: Problem accessing ms0: from flash0: Reply with quote

I'm having a problem loading any sort of file from ms0: when running an app from flash0:...

My program starts when the PSP is load, as its in place of vshmain.prx, the app itself works perfect when saved on the memstick, and can access everything it needs, but when its loaded from flash, it causes lots of errors and crashes.

The app starts, and tries to access a config file, if the config file fails to load, I display a RSoD, this appears every time I boot the PSP, if I remove the line that reads the config, it gets as far as loading the images but crashes again as it fails to read them...

I tried making a plugin to load the app a while back, and I made a mistake and loaded it using this code:

Code:
    struct SceKernelLoadExecVSHParam param;
    memset(&param, 0, sizeof(param));
    param.size = sizeof(param);
    param.argp = bpath;
    param.args = strlen(bpath)+1;
    param.key  = "vsh"; //should have been game

    sctrlKernelLoadExecVSHMs2(bpath, &param);

this gave the exact same problems as I'm experiancing when loading from flash, but when I changed the key to game, it worked perfect.

I've tried replacing vshmain.prx with some code to force load my app with the game key, but I've had no luck, I can't get it to load at all.

I also had the thought that because it was a usermode app that it might not be able to access ms0: from flash0:, so I tried loading the image from flash0:, same error.

I'm assuming its possible to work around this somehow, but I've had little luck finding one myself, and I have no idea how to word a search to see if anyone has had this same problem.

Thanks for any input.
-Aura

_________________
Live. Love. Be. Believe.

Free downgrading/unbricking service list!
Back to top
View user's profile Send private message
J-Fox



Joined: 26 Sep 2007
Posts: 15
Location: Hannover, Germany

PostPosted: Wed Oct 03, 2007 5:52 am    Post subject: Reply with quote

I could imagine that the device is not mapped at the time you try to access it.
It would make sense if vshmain.prx is loaded as one of the first prx, meaning that it might take 5-10 seconds until ms0:/ was mapped to the correct device / driver
Back to top
View user's profile Send private message
Aura



Joined: 24 Jul 2007
Posts: 37

PostPosted: Wed Oct 03, 2007 6:04 am    Post subject: Reply with quote

That seems quite a logical idea, but unfortunatly its having none of it, I've also tried unassigning and reassigning ms0:/ but that didn't make any difference either.

I have realised though that I had absolutly no problem what so ever in a previous app I made to replace vshmain.prx which read from ms0:/ and flash1:/, so I'll check that and see if I can spot any differences.

-Aura

_________________
Live. Love. Be. Believe.

Free downgrading/unbricking service list!
Back to top
View user's profile Send private message
Aura



Joined: 24 Jul 2007
Posts: 37

PostPosted: Wed Oct 03, 2007 6:18 am    Post subject: Reply with quote


I've just removed the PSP_HEAP_SIZE_KB macro, and this has allowed the config file to be read, but I still crash upon loading images, so I've had a fiddle with the heap size, it appears I can't go above 1930, but this value doesn't quite allow me to load all the images I require, even freeing those images that arn't needed, then re-assigning them when they are required doesn't work, any advice is greatly welcome.

All of the above was based on PSPLink and using reset vsh then loading the plugin... I've just tried this in the actual flash and its crashing again.

-Aura

*Oops, quoted myself instead of editing by accident >.>

_________________
Live. Love. Be. Believe.

Free downgrading/unbricking service list!
Back to top
View user's profile Send private message
Hellcat



Joined: 24 Jan 2007
Posts: 84

PostPosted: Thu Oct 04, 2007 1:08 pm    Post subject: Reply with quote

Hmm....

Two ideas:
Try putting your main code into a seperate .PRX, and replace VSHMAIN.PRX by a small loader, that only kicks off your "main" .PRX

or

Try removing the leading "%%" from the pspbtcnf.txt file when loading your replaced VSHMAIN.PRX
Back to top
View user's profile Send private message
Aura



Joined: 24 Jul 2007
Posts: 37

PostPosted: Fri Oct 05, 2007 5:04 am    Post subject: Reply with quote

I've tried making a replacement vshmain.prx to load the main (infact, this is exactly what I need to do when its complete anyway).

The %% in the pspbtcnf.txt indicates a file which is to be loaded in the vsh partition, removing these just seems to do nothing, which I actually think is rather odd because it must be loaded for some purpose, but I'm not sure to what purpose.

I think the way forward would be to load it with a different key, such as with the game key, but all my attempts thus far have proved fruitless, I get nothing happen at all, and the only functions that appear to work are those which just load it in the current key (vsh in this case), which isn't much help.

I found a good balance between the heap sizes that work, 1930 was the highest it would go and still read the config file, anything higher would cause a bug, but setting the heap to this size meant images wouldn't load correctly, I have to load various and its just not enough to cover them all. And either way, changing the heap size didn't appear to make any difference when it was actually flashed, no images would load what so ever.

Anyway, I guess its back to the drawing board, somethings got to work eventually (I hope...).

-Aura

Edit:
Ok, I've taken a long look through most of the headers and I've come across this
Code:
SceUID sceKernelCreateHeap(SceUID partitionid, SceSize size, int unk, const char *name);
which looks promising, but obviously it doesn't work as required because its a kmode function (and I've not got my kmode stuff set up yet), so I was just wondering if anyone knows if this is likely to work, and also if they can tell me what to put in the first argument?
_________________
Live. Love. Be. Believe.

Free downgrading/unbricking service list!
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