How do you load BOOT/EBOOT.BINs

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

Moderators: cheriff, TyRaNiD

Locked
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

How do you load BOOT/EBOOT.BINs

Post by Gary13579 »

Before you all rush and try to close this topic first, this is NOT to run games off the memory stick.

What I want to do is load a UMD inside of a program.
I've copied some from WAB Launcher 2.5b, but it doesn't work for UMDs.

Code: Select all

	pspDebugScreenPrintf("Loading UMD \n");	
	int exec_p = sceKernelLoadModule(GAME_PATH_DEST, 0, 0);
	sceKernelStartModule(exec_p, 0, 0, 0, 0);
Sits on the screen with Loading UMD and does nothing.
GAME_PATH_DEST = disc0:/PSP_GAME/SYSDIR/EBOOT.BIN (also tried EBOOT.BIN)

I've also tried

Code: Select all

	pspDebugScreenPrintf("Loading UMD \n");	
	sceKernelLoadExec("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN", 0);
I've also tried BOOT.BIN...

This one returns to the homescreen with the error "This game cannot be started (80020321)".

Any help is appreciated :)
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

I guess I needed to add this code, but it still isn't working.

Code: Select all

	// Wait for disc and mount to filesystem
	int i;
	i = sceUmdCheckMedium(1);
	if(i == 0)
	{
		sceUmdWaitDriveStat(UMD_WAITFORDISC);
	}
	sceUmdActivate(1, "disc0:"); // Mount UMD to disc0: file system
	sceUmdWaitDriveStat(UMD_WAITFORINIT);
It does the same thing as before when using sceKernelStartModule
CyberBill
Posts: 86
Joined: Tue Jul 26, 2005 3:53 pm
Location: Redmond, WA

Post by CyberBill »

EBOOT.BIN is not the executable, BOOT.BIN is... That'll narrow down your tests some. :)
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

actually you can use either...eboot.bin is the encrypted version of boot.bin :)
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

Yes, but someone on IRC to try the EBOOT.BIN file, so may as well try :)

No ideas though?
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Gary13579 wrote:Yes, but someone on IRC to try the EBOOT.BIN file, so may as well try :)

No ideas though?
You are probably having memory issues.
i also did some tests with that and the loadmodule returned 0x800200d9 (SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED)

With adding PSP_HEAP_SIZE_KB(0) in the code, i was able to launch the wipeout umd, but i still had the memory errors with others umd's.
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

moonlight wrote:
Gary13579 wrote:Yes, but someone on IRC to try the EBOOT.BIN file, so may as well try :)

No ideas though?
You are probably having memory issues.
i also did some tests with that and the loadmodule returned 0x800200d9 (SCE_KERNEL_ERROR_MEMBLOCK_ALLOC_FAILED)

With adding PSP_HEAP_SIZE_KB(0) in the code, i was able to launch the wipeout umd, but i still had the memory errors with others umd's.
It sounds like you are saying it takes more memory to load a game from a UMD then from the memory stick, which doesn't make much sense :/
My program is very simple, all it does is boot up, wait for the person to press X, then tries to load the UMD.

I'll post the source when I get home.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Gary13579 wrote: It sounds like you are saying it takes more memory to load a game from a UMD then from the memory stick, which doesn't make much sense :/
My program is very simple, all it does is boot up, wait for the person to press X, then tries to load the UMD.

I'll post the source when I get home.
maybe current versions of the pspsdk have memory partitions problem that they didn't have in the past when that program was released.

Add this to the code to see a description of what is happening, i am sure that they are memory partitions issues.

pspKernelSetKernelPC();
pspDebugInstallKprintfHandler(NULL);
Gary13579
Posts: 93
Joined: Mon Aug 15, 2005 7:43 am

Post by Gary13579 »

I put those lines in the main function, it did nothing. Was I supposed to put them somewhere else?

BTW, here is the source

Code: Select all

/*
 *Wab launcher V2.5 the original :=)
 */

#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <pspumd.h>
#include <stdlib.h>
#include <string.h>
#define printf	pspDebugScreenPrintf


#define GAME_PATH_DEST  "disc0&#58;/PSP_GAME/SYSDIR/BOOT.BIN"


PSP_MODULE_INFO&#40;"LauncherV2_5", 0x1000, 1, 1&#41;;   // 0x1000 = Kernel MODE
PSP_MAIN_THREAD_ATTR&#40;0&#41;; // 0 for kernel mode too

int exit_callback&#40;int arg1, int arg2, void *common&#41;
&#123;
	return 0;
&#125;

/* Callback thread */
int CallbackThread&#40;SceSize args, void *argp&#41;
&#123;
	int cbid;

	cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
	sceKernelRegisterExitCallback&#40;cbid&#41;;
	sceKernelSleepThreadCB&#40;&#41;;

	return 0;
&#125;

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks&#40;void&#41;
&#123;
	int thid = 0;

	thid = sceKernelCreateThread&#40;"update_thread", CallbackThread,
				     0x11, 0xFA0, 0, 0&#41;;
	if&#40;thid >= 0&#41;
	&#123;
		sceKernelStartThread&#40;thid, 0, 0&#41;;
	&#125;

	return thid;
&#125;



void loadUMD&#40;void&#41; &#123;
	pspDebugScreenPrintf&#40;"Loading UMD \n"&#41;;	
	int exec_p = sceKernelLoadModule&#40;GAME_PATH_DEST, 0, 0&#41;;
	sceKernelStartModule&#40;exec_p, 0, 0, 0, 0&#41;;
	//sceKernelLoadExec&#40;"disc0&#58;/PSP_GAME/SYSDIR/EBOOT.BIN", 0&#41;;
&#125;


int main&#40;void&#41;
&#123;
	SceCtrlData pad;
	sceCtrlSetSamplingCycle&#40;0&#41;;
	sceCtrlSetSamplingMode&#40;PSP_CTRL_MODE_ANALOG&#41;;
	pspDebugScreenInit&#40;&#41;;
	SetupCallbacks&#40;&#41;;

	// Wait for disc and mount to filesystem
	int i;
	i = sceUmdCheckMedium&#40;1&#41;;
	if&#40;i == 0&#41;
	&#123;
		sceUmdWaitDriveStat&#40;UMD_WAITFORDISC&#41;;
	&#125;
	sceUmdActivate&#40;1, "disc0&#58;"&#41;; // Mount UMD to disc0&#58; file system
	sceUmdWaitDriveStat&#40;UMD_WAITFORINIT&#41;;

	while&#40;1&#41;
	&#123;
		sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
		if&#40;pad.Buttons & PSP_CTRL_CROSS&#41;
		&#123;
			loadUMD&#40;&#41;; 
			return 0;
		&#125;
	&#125;
	sceKernelExitGame&#40;&#41;;
	return 0;
&#125;
Really simple stuff...
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Sorry, we don't have any topics that have to do with loading files on the UMD. Locked.
Locked