sceKernelExitVSHVSH()?

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

Moderators: cheriff, TyRaNiD

Post Reply
Draan
Posts: 48
Joined: Sat Oct 17, 2009 3:39 am

sceKernelExitVSHVSH()?

Post by Draan »

Code: Select all

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

PSP_MODULE_INFO&#40;"recovery", 0x0800, 1, 0&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;

SceCtrlData pad;
     	
int app_main&#40;SceSize args, void *argp&#41;
&#123;
    pspDebugScreenInit&#40;&#41;;
    pspDebugScreenPrintf&#40;"RECOVERYYYYYYYYYYYYYYYYYYYY"&#41;;
    sceKernelDelayThread&#40;1000&#41;;
    sceKernelExitVSHVSH&#40;NULL&#41;;
    pspDebugScreenClear&#40;&#41;;
    return 0;
&#125;

int module_start&#40;SceSize args, void *argp&#41;
&#123;
	SceUID thid1 = sceKernelCreateThread&#40;"recovery_thread", app_main, 0x18, 0x4000, PSP_THREAD_ATTR_VSH, NULL&#41;;
	if&#40;thid1 >= 0&#41;
	&#123;
		sceKernelStartThread&#40;thid1, 0, 0&#41;;
	&#125;
	return 0;
&#125;

int module_stop&#40;SceSize args, void *argp&#41;
&#123;
	return 0;
&#125;
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)
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

You need to give the VSH parameters structure with arguments to restart from Sony logo.
Draan
Posts: 48
Joined: Sat Oct 17, 2009 3:39 am

Post by Draan »

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.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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.
Davee
Posts: 43
Joined: Mon Jun 22, 2009 3:58 am

Post by Davee »

IIRC sceKernelExitVSHVSH is kernel mode only.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Davee wrote:IIRC sceKernelExitVSHVSH is kernel mode only.
Do you have information about the syntax of vshargs?
Davee
Posts: 43
Joined: Mon Jun 22, 2009 3:58 am

Post by Davee »

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.
Draan
Posts: 48
Joined: Sat Oct 17, 2009 3:39 am

Post by Draan »

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: Select all

SceUID sceIoOpenPatched&#40;const char *file, int flags, SceMode mode&#41;
&#123;
	u32 k1 = pspSdkSetK1&#40;0&#41;;	

	if &#40;strstr&#40;file, "display_02g.prx"&#41;&#41; //Updater is creating a file in flash0, lets flash CFW files! &#40;It's a Slim PSP!&#41;
	&#123;
          flashCfwFilesSlim&#40;&#41;;
	&#125; else if &#40;strstr&#40;file, "display_01g.prx"&#41;&#41; //Updater is creating a file in flash0, lets flash CFW files! &#40;It's a Fat PSP!&#41;
	&#123;
          flashCfwFilesFat&#40;&#41;;
	&#125;

	pspSdkSetK1&#40;k1&#41;;

	return sceIoOpen&#40;file, flags, mode&#41;;
&#125;
will be enough or it's more complicated to do? And I must patch the IPL writting of course.
Zer01ne
Posts: 28
Joined: Mon Sep 08, 2008 7:15 am

Post by Zer01ne »

Look into SystemControl Lib for your first question !!!
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

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.
Draan
Posts: 48
Joined: Sat Oct 17, 2009 3:39 am

Post by Draan »

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.
Post Reply