| View previous topic :: View next topic |
| Author |
Message |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Sat Apr 11, 2009 7:03 am Post subject: problem flashing camera_plugin.rco from flash0 |
|
|
well camera_plugin.rco wont flash from flash0, it copies with 0bytes why is this?
any help?
Last edited by PsPfReAK on Thu Apr 23, 2009 2:06 am; edited 1 time in total |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Sat Apr 11, 2009 9:32 am Post subject: |
|
|
| Jim wrote: | Do you sceIOClose the file somewhere?
Jim |
i do this
| Code: | printf("\n Assigning Flash");
if (sceIoUnassign("flash0:") < 0)
printf("Cannot Un-Assign flash0:");
if (sceIoAssign("flash0:", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0) < 0) {
printf("Error Assigning flash0 in write mode"); }
printf("Flash Assigned...\n\n");
printf("\n Flashing camera plugins ");
copyFile("flash0:/vsh/module/camera_plugin.prx", "ms0:/camera_plugin.prx");
copyFile("flash0:/vsh/resource/camera_plugin.rco", "ms0:/camera_plugin.rco");
sceIoClose;
printf("done"); |
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sat Apr 11, 2009 11:59 am Post subject: |
|
|
There is no access to flash0:/ from even a kernel module or user module. You unassign and reassign must be failing, but the code you've given just prints an error and continues without stopping. You can use one of these methods.
1) If you are just making an EBOOT application, then instead of making it user mode, make it VSH mode by giving 0x800 in PSP_MODULE_INFO("flash0w", 0x800, 1, 0);
Now you can unassign and reassign then freely read and write flash0:/.
2) If you are making a user mode prx or an EBOOT, then load DAX's iop.prx first. It comes with his LEDA application.
3) If you are making a kernel mode prx then #include <systemctrl.h> and add -lpspsystemctrl_kernel to your makefile libs. Then call this before assign, or open file, or read, or write.
int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
sceIoOpen(...);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1); |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Sat Apr 11, 2009 8:25 pm Post subject: |
|
|
| Torch wrote: | There is no access to flash0:/ from even a kernel module or user module. You unassign and reassign must be failing, but the code you've given just prints an error and continues without stopping. You can use one of these methods.
1) If you are just making an EBOOT application, then instead of making it user mode, make it VSH mode by giving 0x800 in PSP_MODULE_INFO("flash0w", 0x800, 1, 0);
Now you can unassign and reassign then freely read and write flash0:/.
2) If you are making a user mode prx or an EBOOT, then load DAX's iop.prx first. It comes with his LEDA application.
3) If you are making a kernel mode prx then #include <systemctrl.h> and add -lpspsystemctrl_kernel to your makefile libs. Then call this before assign, or open file, or read, or write.
int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
sceIoOpen(...);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1); |
its an eboot.
but i am in vsh mode because it copys over camera_plugin.prx but not camera_plugin.rco.... |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Sat Apr 11, 2009 11:12 pm Post subject: |
|
|
| Jim wrote: | this:
sceIoClose;
does nothing.
Jim |
i figured that out, but how do i flash the camera_plugin.rco?
do i need to change the copy code?
how do i call iop.prx that torch mentioned? |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Mon Apr 13, 2009 3:30 am Post subject: |
|
|
okay this is gettng annoying, i called the iop.prx, it loaded it but still only flashed the camera_plugin.prx but it left the camera_plugin.rco empty
whats going on here? |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Mon Apr 13, 2009 6:58 am Post subject: |
|
|
okay i found out my flash isnt un assigning, this is my code
| Code: | p2c(" - Assigning flash0....\n ");
sceKernelDelayThread(1000000);
if (sceIoUnassign( "flash0:" ) < 0)
errorExit("Cannot Unassign Flash0\n");
if (sceIoAssign( "flash0:", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0 ) < 0) {
errorExit("Cannot Assign Flash0 In Write Mode\n"); } |
whats wrong with it?
my eboot has the 0x800 flag at the begining... |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Mon Apr 13, 2009 11:27 am Post subject: |
|
|
| What error code are you getting from it? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Apr 13, 2009 2:04 pm Post subject: |
|
|
| Try making it usermode with iop.prx. Though I know that you CAN assign/unassign from a VSH mode eboot. |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Mon Apr 13, 2009 11:51 pm Post subject: |
|
|
dont worry about the assigning problem, turned out that i was giving my psp to many kernal commands, i think....
im still trying to get that camera_plugin.rco though, still no hope
also
| Quote: | int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
sceIoOpen(...);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1); |
where eactly does this go, before i assign thew flash?
and sceIoOpen(...); <--is that the part where i flash the files or do i open iop.prx?
EDIT- solved, thank you very much for your help |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Tue Apr 14, 2009 10:55 am Post subject: |
|
|
okay, another error, when i use the code above when i try to assign flasho afterwards it wont let me, its say cannot un-assign flash....
any suggestions? |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Fri Apr 17, 2009 5:22 am Post subject: |
|
|
okay when i use this before assigning
int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
sceIoOpen("flash0:/vsh/camera_plugin.rco", PSP_O_RDONLY, 0777);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1);
it wont let me un assign flash
so can someone tell me how to do it, like ive tried everything i can think off
this is it currently
int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
sceIoOpen("flash0:/vsh/camera_plugin.rco", PSP_O_RDONLY, 0777);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1);
pspSdkLoadStartModule("iop.prx", PSP_MEMORY_PARTITION_KERNEL);
p2c(" Assigning flash0....\n ");
if (sceIoUnassign("flash0:") < 0)
errorExit("Cannot Un-Assign flash0:");
if (sceIoAssign("flash0:", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0) < 0) {
errorExit("Error Assigning flash0 in write mode"); }
p2c(" Flash Assigned\n");
copyFile("flash0:/vsh/module/camera_plugin.prx", "ms0:/camera_plugin.prx");
copyFile("flash0:/vsh/resource/camera_plugin.rco", "ms0:/camera_plugin.rco");
but yet it only copies the prx
its a eboot it vsh mode (0x800)
can anyone help? |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Sat Apr 18, 2009 11:25 pm Post subject: :@ |
|
|
| so your saying no one knows how to this? |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sun Apr 19, 2009 10:36 pm Post subject: |
|
|
| Theres no need for VSH mode 0x800 if you are using iop.prx, make it user mode 0x0 |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Sun Apr 19, 2009 11:49 pm Post subject: |
|
|
still in user mode it wont let me unnassign flash0
it only does this when this is in
int k1 = pspSdkSetK1(0);
int level = sctrlKernelSetUserLevel(8);
sceIoOpen("flash0:/vsh/camera_plugin.rco", PSP_O_RDONLY, 0777);
sctrlKernelSetUserLevel(level);
pspSdkSetK1(k1);
so how should i go about it?
any help!!!!
Last edited by PsPfReAK on Wed Apr 22, 2009 6:47 am; edited 1 time in total |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Apr 20, 2009 2:09 pm Post subject: |
|
|
First of all how can you call sctrlKernelSetUserLevel from a user mode prx?? I'm not at my dev PC but I'm pretty sure its a kernel only export.
If you're in kernel mode then iop.prx won't work. |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Tue Apr 21, 2009 2:22 am Post subject: O.o |
|
|
| well, it works when i go to test m33 but when i test it in the actual psp it still only copies the prx not the rco |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Apr 21, 2009 12:43 pm Post subject: |
|
|
| Thats probably because of the permissions of the files. Test M33 or DC installed firmware sets all permissions on the files to 0777 which is full access. |
|
| Back to top |
|
 |
PsPfReAK
Joined: 28 Mar 2009 Posts: 61
|
Posted: Wed Apr 22, 2009 1:52 am Post subject: |
|
|
@jim
where do i close them
in the flashing code or where i actually flash it?
SOLVED
i just rewrite the copy code |
|
| Back to top |
|
 |
Jim

Joined: 02 Jul 2005 Posts: 487 Location: Sydney
|
Posted: Wed Apr 22, 2009 7:27 am Post subject: |
|
|
For every file you handle=sceIoOpen, you should have a matching call to sceIoClose(handle). I'm not saying it'll fix your problem, but there are a limited number of file handles available (32?) and once they are all gone you won't be able to open any more files ever.
Jim _________________ http://www.dbfinteractive.com |
|
| Back to top |
|
 |
|