How come you can only use sceKernelLoadExec() to boot a UMD in usermode and not in kernelmode? And why can you only boot eboots from the ms with sceKernelLoadExec() in kernelmode?
While we're already talking about it what can you boot with LoadStartModule() ?? Can you boot umds in kernelmode with LoadStartModule() ?? Does LoadStartModule() the same thing as sceKernelLoadModule() and sceKernelStartModule() combined??
Does anyone got any good examples of using LoadStartModule() on a eboot on the ms and/or boot the UMD??
If non of the things above works booting umds in kernelmode what code should you use too boot the boot.bin on a UMD (in kernelmode) ??
And how does multi-threading work?
Sorry for alle the (noob) questions.
Thanks in Advance!
About sceKernelLoadExec()...
If you want a function similar to sceKernelLoadExec that let you boot both boot.bin and eboot.bin in kernel mode, it exists: it's the undocumented sceKernelLoadExecVSHDisc:
Its definition and usage (the same than loadexec, it has more fields in the struct, but who knows what they are for...):
This function cannot be called in usermode (well, actually the firmware calls it in vsh mode, but not directly, it calls to a function of the sceVshBridge_driver that simply calls this function)
Its definition and usage (the same than loadexec, it has more fields in the struct, but who knows what they are for...):
Code: Select all
struct SceKernelLoadExecVSHParam {
/* Size of structure in bytes */
SceSize size;
/* Size of the arguments string */
SceSize args;
/* Pointer to the arguments strings */
void * argp;
/* "game", "updater" or "vsh" */
const char * key;
/* unknown, it seems to be some kind of flag. the firmware set it to
0x00000400. it looks like is related with the next fields of the
structure, it's better to set it to 0 if we don't know how to use
those fields */
u32 unk1;
/* unknown, the firmware always set it to 0x09CF344C, which seems to
be a pointer */
void *unk2;
/* unknown. the firmware sets it to 0 */
u32 unk3;
/* unknown. the firmware sets it to 0 */
u32 unk4;
/* unknown. the firmware sets it to 0 */
u32 unk5;
};
int sceKernelLoadExecVSHDisc(const char *file, struct SceKernelLoadExecVSHParam *param);
int main()
{
struct SceKernelLoadExecVSHParam param;
char *eboot = "disc0:/PSP_GAME/SYSDIR/EBOOT.BIN";
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.argp = eboot;
param.args = strlen(eboot)+1;
param.key = "game";
if (sceKernelLoadExecVSHDisc(eboot, ¶m) < 0)
{
pspDebugScreenInit();
printf("error");
}
return 0;
}
hmm, I have a problem. Booting via eboot.bin works fine but using boot.bin gives me the error: "The game could not be started (80020148)"
This is the code I used (it is exactly the same as yours except that I changed eboot.bin to boot.bin):
According to this page: http://forums.qj.net/showthread.php?t=4 ... t=80020148
that error means unsupported prx type. What is the problem??
btw. Thanks again!
This is the code I used (it is exactly the same as yours except that I changed eboot.bin to boot.bin):
Code: Select all
struct SceKernelLoadExecVSHParam param;
char *eboot = "disc0:/PSP_GAME/SYSDIR/BOOT.BIN";
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.argp = eboot;
param.args = strlen(eboot)+1;
param.key = "game";
if (sceKernelLoadExecVSHDisc(eboot, ¶m) < 0)
{
pspDebugScreenInit();
screenblit(0, 0, 480, 272, insert_umd);
flipScreen();
}
that error means unsupported prx type. What is the problem??
btw. Thanks again!
Maybe i was wrong, and it only works with eboots, i'll check it
The unsupported prx type is because the firmware doesn't recognize the file as an executable because it's not encrypted...
The unsupported prx type is because the firmware doesn't recognize the file as an executable because it's not encrypted...
Last edited by moonlight on Fri Apr 14, 2006 8:04 pm, edited 1 time in total.
It seems the function can only execute encrypted files. I just tryed this:moonlight wrote:Maybe i was wrong, and it only works with eboots, i'll check it
The unsupported prx type is because the firmware doesn't recognize the file as an executable because it's not encrypted...
But the strange thing is that it can execute elf's not encrypted from the memorystick, lol, sony is weird
Code: Select all
struct SceKernelLoadExecVSHParam param;
char *eboot = "ms0:/PSP/GAME/MPHGAMELOADER/EBOOT.PBP";
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.argp = eboot;
param.args = strlen(eboot)+1;
param.key = "game";
if (sceKernelLoadExecVSHDisc(eboot, ¶m) < 0)
{
pspDebugScreenInit();
printf("error");
flipScreen();
}
btw. is there a way to start mphgl at all since when you use sceKernelLoadExec() MPHGL freezes when it showing the text (You know, MPH Game Loader 1.1 etc.)