| View previous topic :: View next topic |
| Author |
Message |
manatails007
Joined: 05 Mar 2008 Posts: 13
|
Posted: Wed Feb 04, 2009 11:42 am Post subject: Running on recovery mode |
|
|
What should I do if I want to run my app on recovery mode?
I put my app to ms0:/PSP/GAME/RECOVERY/ but it wont start....
I use PSP_MODULE_INFO("manatails007", 0x1000, 1, 0)
Last edited by manatails007 on Thu Feb 05, 2009 1:23 am; edited 1 time in total |
|
| Back to top |
|
 |
ctszy
Joined: 12 Apr 2008 Posts: 18
|
Posted: Wed Feb 04, 2009 12:33 pm Post subject: |
|
|
\PSP\GAME\RECOVERY\ is for
"Run program at /PSP/GAME/RECOVERY/EBOOT.PBP" in recovery mode.
well I think there is no "common" way to run a prx in recovery mode. maybe you can do some replacement to solve this (for example, replace the recovery.prx with yours and then load it in your prx?).
Also, why would you want to do so ? :) |
|
| Back to top |
|
 |
manatails007
Joined: 05 Mar 2008 Posts: 13
|
Posted: Thu Feb 05, 2009 1:21 am Post subject: |
|
|
| I'm coding pspbtcnf flasher. But after flashing bin files. PSP is bricked. :/ I checked flash0 with recovery mode but there was nothing wrong with bin files. So I'm trying to flash pspbtcnf bin files before firmware loads up and see what happens. So I'm using recovery mode to do that but my app doesn't load |
|
| Back to top |
|
 |
Bubbletune
Joined: 03 Jan 2009 Posts: 28
|
Posted: Thu Feb 05, 2009 1:36 am Post subject: |
|
|
| Your main application can't be kernel mode, only back in 1.50. Change it to usermode, and load iop.prx (included in most of Dax's releases, eg. LEDA) from the main application to be granted write access to the flash0 from user mode. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Thu Feb 05, 2009 1:40 am Post subject: |
|
|
| Or simple make it VSH mode 0x800 if you don't want iop.prx. |
|
| Back to top |
|
 |
Bubbletune
Joined: 03 Jan 2009 Posts: 28
|
Posted: Thu Feb 05, 2009 5:03 am Post subject: |
|
|
| Torch wrote: | | Or simple make it VSH mode 0x800 if you don't want iop.prx. |
Your PBP needs to be started in updater mode for this to work, which the recovery doesn't do (and neither does the VSH if it's not in the UPDATE folder).. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Thu Feb 05, 2009 5:06 am Post subject: |
|
|
But he doesn't need to use recovery. I'm guessing he just asked about launching from recovery because he couldn't get it to work normally launching from the VSH without the 0x800 flags.
Updater mode is not required. I have a PBP sitting right here that can write to flash0 from any folder under PSP/GAME, not UPDATE. The PRX in it is 0x800. In fact it DOESN'T launch from UPDATE.
Besides, he said his application bricked his PSP, which means it actually ran, so it must have been a kernel ELF in the PBP. I'm guessing that the pspbtcnf file he flashed was corrupted. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Thu Feb 05, 2009 5:16 am Post subject: |
|
|
You can get flash0 access by launching from XMB like this:
(I wonder if it will cause problems with non-DC installed firmware that don't have 0777 stats on files you want to overwrite. But in your case the btcnf files should be 0777 set by the M33 installer anyway.)
| Code: | #include <pspkernel.h>
#include <string.h>
#include <pspdebug.h>
#define printf pspDebugScreenPrintf
PSP_MODULE_INFO("flash0w", 0x800, 1, 0);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_VSH);
PSP_HEAP_SIZE_KB(2048);
int exit_callback()
{
sceKernelExitGame();
return 0;
}
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main(int argc, char* argv[])
{
SetupCallbacks();
pspDebugScreenInit();
char text[] = "this is a test file";
int result;
result = sceIoUnassign("flash0:");
if(result < 0)
{
printf("\nError in unassign flash0.");
}
else
{
result = sceIoAssign("flash0:", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
if(result < 0)
{
printf("\nError in assigning flash0 for write.");
}
else
{
SceUID fp;
fp = sceIoOpen("flash0:/test.txt", PSP_O_WRONLY|PSP_O_TRUNC|PSP_O_CREAT, 0777);
if(fp < 0)
{
printf("\nError writing flash0:/test.txt.");
}
else
{
sceIoWrite(fp, &text, strlen(text));
sceIoClose(fp);
printf("\ntest.txt written successfully.");
}
}
}
sceKernelSleepThread();
return 0;
}
|
| Code: | TARGET = flash0w
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
BUILD_PRX = 1
PRX_EXPORTS =
#USE_KERNEL_LIBC=1
#USE_KERNEL_LIBS=1
PSP_FW_VERSION = 380
PSP_LARGE_MEMORY = 0
LIBDIR =
LIBS =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = flash0
#PSP_EBOOT_ICON="icon0.png"
#PSP_EBOOT_PIC1="pic1.png"
#PSP_EBOOT_SND0="snd0.at3"
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
|
|
|
| Back to top |
|
 |
manatails007
Joined: 05 Mar 2008 Posts: 13
|
Posted: Wed Feb 11, 2009 4:42 pm Post subject: |
|
|
| I got no problems accessing flash0 but flashing pspbtcnf bin files bricks up the psp |
|
| Back to top |
|
 |
|