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 flashing camera_plugin.rco from flash0

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



Joined: 28 Mar 2009
Posts: 61

PostPosted: Sat Apr 11, 2009 7:03 am    Post subject: problem flashing camera_plugin.rco from flash0 Reply with quote

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
View user's profile Send private message Visit poster's website
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sat Apr 11, 2009 9:06 am    Post subject: Reply with quote

Do you sceIOClose the file somewhere?

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Sat Apr 11, 2009 9:32 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sat Apr 11, 2009 11:59 am    Post subject: Reply with quote

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
View user's profile Send private message
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Sat Apr 11, 2009 8:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sat Apr 11, 2009 10:56 pm    Post subject: Reply with quote

this:
sceIoClose;
does nothing.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Sat Apr 11, 2009 11:12 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Mon Apr 13, 2009 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Mon Apr 13, 2009 6:58 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Mon Apr 13, 2009 11:27 am    Post subject: Reply with quote

What error code are you getting from it?
Back to top
View user's profile Send private message AIM Address
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Mon Apr 13, 2009 2:04 pm    Post subject: Reply with quote

Try making it usermode with iop.prx. Though I know that you CAN assign/unassign from a VSH mode eboot.
Back to top
View user's profile Send private message
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Mon Apr 13, 2009 11:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Tue Apr 14, 2009 10:55 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Fri Apr 17, 2009 5:22 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Sat Apr 18, 2009 11:25 pm    Post subject: :@ Reply with quote

so your saying no one knows how to this?
Back to top
View user's profile Send private message Visit poster's website
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Apr 19, 2009 10:36 pm    Post subject: Reply with quote

Theres no need for VSH mode 0x800 if you are using iop.prx, make it user mode 0x0
Back to top
View user's profile Send private message
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Sun Apr 19, 2009 11:49 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Mon Apr 20, 2009 2:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Tue Apr 21, 2009 2:22 am    Post subject: O.o Reply with quote

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
View user's profile Send private message Visit poster's website
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Tue Apr 21, 2009 8:09 am    Post subject: Reply with quote

You still are not closing the files!
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Tue Apr 21, 2009 12:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
PsPfReAK



Joined: 28 Mar 2009
Posts: 61

PostPosted: Wed Apr 22, 2009 1:52 am    Post subject: Reply with quote

@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
View user's profile Send private message Visit poster's website
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Wed Apr 22, 2009 7:27 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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