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 

sceKernelExitVSHVSH()?

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



Joined: 17 Oct 2009
Posts: 55

PostPosted: Sun Oct 25, 2009 2:41 am    Post subject: sceKernelExitVSHVSH()? Reply with quote

Code:

#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <psploadexec_kernel.h>

PSP_MODULE_INFO("recovery", 0x0800, 1, 0);
PSP_MAIN_THREAD_ATTR(0);

SceCtrlData pad;
        
int app_main(SceSize args, void *argp)
{
    pspDebugScreenInit();
    pspDebugScreenPrintf("RECOVERYYYYYYYYYYYYYYYYYYYY");
    sceKernelDelayThread(1000);
    sceKernelExitVSHVSH(NULL);
    pspDebugScreenClear();
    return 0;
}

int module_start(SceSize args, void *argp)
{
   SceUID thid1 = sceKernelCreateThread("recovery_thread", app_main, 0x18, 0x4000, PSP_THREAD_ATTR_VSH, NULL);
   if(thid1 >= 0)
   {
      sceKernelStartThread(thid1, 0, 0);
   }
   return 0;
}

int module_stop(SceSize args, void *argp)
{
   return 0;
}


sceKernelExitVSHVSH(NULL); - Does nothing. I've got black screen, but I think psp is not hanged, because it doesn't power off.
Any solution? (note: I know about sceKernelExitGame(); but I want to use this to restart vsh)
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Oct 25, 2009 3:24 am    Post subject: Reply with quote

You need to give the VSH parameters structure with arguments to restart from Sony logo.
Back to top
View user's profile Send private message
Draan



Joined: 17 Oct 2009
Posts: 55

PostPosted: Sun Oct 25, 2009 3:37 am    Post subject: Reply with quote

But even in 1.50 POC sceKernelExitVSHVSH has NULL instead of SceKernelLoadExecVSHParam structure.
Edit: And even in 1.50 POC recovery it's not working :) (when testing on high firmware)

But what arguments? In sources I have, this structure is used to boot an EBOOT.
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Oct 25, 2009 5:11 am    Post subject: Reply with quote

The vshargs for Sony logo is just 0 I think. The args give information to the VSH such as error messages to display and position of music player etc.
Back to top
View user's profile Send private message
Davee



Joined: 22 Jun 2009
Posts: 59

PostPosted: Sun Oct 25, 2009 6:16 am    Post subject: Reply with quote

IIRC sceKernelExitVSHVSH is kernel mode only.
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Oct 25, 2009 4:14 pm    Post subject: Reply with quote

Davee wrote:
IIRC sceKernelExitVSHVSH is kernel mode only.


Do you have information about the syntax of vshargs?
Back to top
View user's profile Send private message
Davee



Joined: 22 Jun 2009
Posts: 59

PostPosted: Sun Oct 25, 2009 9:38 pm    Post subject: Reply with quote

Torch wrote:
Davee wrote:
IIRC sceKernelExitVSHVSH is kernel mode only.


Do you have information about the syntax of vshargs?


I don't believe any args are required to be passed. I use sceKernelExitVSHVSH to reboot the 5.03 HEN and I just pass NULL.
Back to top
View user's profile Send private message
Draan



Joined: 17 Oct 2009
Posts: 55

PostPosted: Mon Oct 26, 2009 12:45 am    Post subject: Reply with quote

So...Recovery can't be in kernel mode, but this function needs kernel mode...

I've included pspvshbridge and replace this by vshKernelExitVSHVSH.

Still not working! ;/

I have two questions:
What is the "flach0"? I've found this in DCv6 source. Moonlight has made a new driver for flash0 or something? But why?

I want to patch the Sony Updater like 5.00m33 updater. Something like this
Code:

SceUID sceIoOpenPatched(const char *file, int flags, SceMode mode)
{
   u32 k1 = pspSdkSetK1(0);   

   if (strstr(file, "display_02g.prx")) //Updater is creating a file in flash0, lets flash CFW files! (It's a Slim PSP!)
   {
          flashCfwFilesSlim();
   } else if (strstr(file, "display_01g.prx")) //Updater is creating a file in flash0, lets flash CFW files! (It's a Fat PSP!)
   {
          flashCfwFilesFat();
   }

   pspSdkSetK1(k1);

   return sceIoOpen(file, flags, mode);
}

will be enough or it's more complicated to do? And I must patch the IPL writting of course.
Back to top
View user's profile Send private message
Zer01ne



Joined: 08 Sep 2008
Posts: 29

PostPosted: Mon Oct 26, 2009 3:10 am    Post subject: Reply with quote

Look into SystemControl Lib for your first question !!!
Back to top
View user's profile Send private message
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Mon Oct 26, 2009 4:49 am    Post subject: Reply with quote

Davee wrote:
I don't believe any args are required to be passed. I use sceKernelExitVSHVSH to reboot the 5.03 HEN and I just pass NULL.


I mean the information passed back to VSH when you exit after launching an EBOOT. When you replace vshmain and launch the real one later if you don't pass the vshargs then it forgets the positions in the XMB such as last played song, video etc, and the seconds played in the song ( it resumes in the middle of the last song even after exiting a game). Ex. The arguments to exit to VSH and skip the Sony logo are given in the 1.50 POC.
Back to top
View user's profile Send private message
Draan



Joined: 17 Oct 2009
Posts: 55

PostPosted: Mon Oct 26, 2009 6:43 am    Post subject: Reply with quote

My recovery can now acces flash0! :)
Exitting still not working - I must experiment more with this.

Edit:
GENs are packing recovery (it's a vsh module!), m33 are packing recovery, but PSP-Packer can't... :( Not so funny...
Edit2:
I've figured it out by myself. I can pack them, too.

Edit3:
after some tests, sctrlKernelExitVSH worked for me.
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