Assign flash0 in read/write mode [Solved]

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

Moderators: cheriff, TyRaNiD

Post Reply
Magniot
Posts: 4
Joined: Tue Dec 30, 2008 9:55 pm

Assign flash0 in read/write mode [Solved]

Post by Magniot »

Hi, i'm new on this forum. I'm french.

I've got one problem: i'm trying to create an homebrew to flash files in flash0 but i don't arrive to create directories in flash0.

Code: Select all

sceIoUnassign("flash0");
sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
sceIoMkdir("flash0:/test", 0777);
Is this code correct? Because nothing is created in flash0.
Thanks
Last edited by Magniot on Wed Dec 31, 2008 6:36 am, edited 2 times in total.
hibbyware
Posts: 78
Joined: Wed Mar 28, 2007 10:29 am

Post by hibbyware »

You was almost correct you are missing a ":"

Here is the function I use it has error checking but I don't use it, lol

Code: Select all

/**
  * Reassign flash0/flash1 to enable read and write access.
  *
  * @param - n/a
  *
  * @returns - n/a
  **********************************************************************************************************/
	void Reassign() {
		
		
		if &#40;sceIoUnassign&#40;"flash0&#58;"&#41; < 0&#41; &#123;
			// Unassign failed
		&#125;
		
		if &#40;sceIoAssign&#40;"flash0&#58;", "lflash0&#58;0,0", "flashfat0&#58;", IOASSIGN_RDWR, NULL, 0&#41; < 0&#41; &#123;
			// Assign failed
		&#125;
		
		
		
		if &#40;sceIoUnassign&#40;"flash1&#58;"&#41; < 0&#41; &#123;
			// Unassign failed
		&#125;
		
		if &#40;sceIoAssign&#40;"flash1&#58;", "lflash0&#58;0,1", "flashfat1&#58;", IOASSIGN_RDWR, NULL, 0&#41; < 0&#41; &#123;
			// Assign failed
		&#125;
		
		
		
	&#125;
	
/***********************************************************************************************************/
Magniot
Posts: 4
Joined: Tue Dec 30, 2008 9:55 pm

Post by Magniot »

Thanks. now i've got another problem lol

Code: Select all

void Reassign&#40;&#41; &#123;
      
      
      if &#40;sceIoUnassign&#40;"flash0&#58;"&#41; < 0&#41; &#123;
         // Unassign failed
      &#125;
      
      if &#40;sceIoAssign&#40;"flash0&#58;", "lflash0&#58;0,0", "flashfat0&#58;", IOASSIGN_RDWR, NULL, 0&#41; < 0&#41; &#123;
         // Assign failed
      &#125;
      
      
      
      if &#40;sceIoUnassign&#40;"flash1&#58;"&#41; < 0&#41; &#123;
         // Unassign failed
      &#125;
      
      if &#40;sceIoAssign&#40;"flash1&#58;", "lflash0&#58;0,1", "flashfat1&#58;", IOASSIGN_RDWR, NULL, 0&#41; < 0&#41; &#123;
         // Assign failed
      &#125;
      
      
      
   &#125; 
and in int main after my part of code there is:

Code: Select all

Reassign&#40;&#41;;
sceIoMkdir&#40;"flash0&#58;/test", 0777&#41;;
And it's the same, nothing was created when i launched my eboot on my psp. my text is on the screen but when i toogle usb flash0 the directorie isn't here.
hibbyware
Posts: 78
Joined: Wed Mar 28, 2007 10:29 am

Post by hibbyware »

Try...

sceIoMkdir("flash0:/test/", 0777);
Magniot
Posts: 4
Joined: Tue Dec 30, 2008 9:55 pm

Post by Magniot »

and it doesn't work too. I've already tested it and i have tested it again.

If you've got a flasher source code made by you or someone else please upload it or post it to have an example. Thanks for all and sorry :)
hibbyware
Posts: 78
Joined: Wed Mar 28, 2007 10:29 am

Post by hibbyware »

I have not messed with flash0 since 3.80 / 3.90

I remember having problems with certain modes and ended up using 0x800 in my module info,

Code: Select all

PSP_MODULE_INFO&#40;"Write2Flash380", 0x800, 1, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;
PSP_HEAP_SIZE_MAX&#40;&#41;;
Magniot
Posts: 4
Joined: Tue Dec 30, 2008 9:55 pm

Post by Magniot »

It works!!!!! Thanks!
and to create dirs:

Code: Select all

sceIoMkdir&#40;"flash0&#58;/test", 0777&#41;;
without "/" after name directorie.

Thanks again.
Post Reply