First of all, note that I'm trying to run this application from a DDCv4 stick using the ELF menu. Also, I already tried to search, and I can't seem to make up from that why it isn't working.
I need to format flash0, flash1 and flash2.
I did my best to write it as clean as possible with loops and stuff :) I reversed the modules to load from DDC.
Code: Select all
int sceLflashFatfmtStartFatfmt(int args_number,void* argv);
#define N_Modules 3
char* Modules [N_Modules] = { "ms0:/kd/nand_updater.prx", "ms0:/kd/lfatfs_updater.prx", "ms0:/kd/lflash_fatfmt_updater.prx" };
int main(){
char buf1[20];
/* Loading modules */
for(i = 0; i < N_Modules; i++){
printf("Loading %s...", Modules[i]);
mod = pspSdkLoadStartModule(Modules[i], PSP_MEMORY_PARTITION_KERNEL);
if (mod < 0)
ErrorExit(5, 1, "\nError 0x%08X loading/starting %s.", mod, Modules[i]);
printf(" done\n");
}
/* Unassigning Flashes */
printf("Unassigning flashes...");
for(i = 0; i < 2; i++){
sprintf(buf1, "flash%i:", i);
if (sceIoUnassign(buf1) < 0)
ErrorExit(5, 1, "\nError: Can't unassign flash%i.", i);
}
printf(" done\n");
/* Formatting flashes */
char *argv[2];
argv[0] = "fatfmt";
for(i = 0; i < 3; i++){
printf("Formatting flash%i...", i);
sprintf(buf1, "lflash0:0,%i", i);
argv[1] = buf1;
if (sceLflashFatfmtStartFatfmt(2, argv) < 0)
ErrorExit(5, 1, "\nError whilst formatting flash%i.", i);
printf(" done\n");
}
}
Code: Select all
.set noreorder
#include "pspstub.s"
STUB_START "LflashFatfmt",0x40090000,0x00010005
STUB_FUNC 0xB7A424A4,sceLflashFatfmtStartFatfmt
STUB_END
Is there a special trick needed because I'm loading it from the DDC stick or is there something wrong with my code?
Thanks,
JumpR :)