Problem loading firmware files...

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

Moderators: cheriff, TyRaNiD

Post Reply
Slash
Posts: 26
Joined: Sun Jan 07, 2007 9:04 pm

Problem loading firmware files...

Post by Slash »

I'm loading firmware files. Some files are loaded successfully but some makes the PSP crash. I'm using kernel mode and SetupCallbacks(); Am I missing something?

Code: Select all

	pspSdkInstallNoDeviceCheckPatch();
	pspSdkInstallNoPlainModuleCheckPatch();
	
	loadStartModule("ms0:/F0/kd/sysmem.prx"); 
	loadStartModule("ms0:/F0/kd/loadcore.prx"); 
	loadStartModule("ms0:/F0/kd/exceptionman.prx"); 
	loadStartModule("ms0:/F0/kd/interruptman.prx"); 
	loadStartModule("ms0:/F0/kd/threadman.prx"); 
	loadStartModule("ms0:/F0/kd/dmacman.prx"); 
	loadStartModule("ms0:/F0/kd/systimer.prx"); 
	loadStartModule("ms0:/F0/kd/iofilemgr.prx"); 
	loadStartModule("ms0:/F0/kd/stdio.prx"); 
	loadStartModule("ms0:/F0/kd/memlmd.prx"); 
	loadStartModule("ms0:/F0/kd/modulemgr.prx"); 
	loadStartModule("ms0:/F0/kd/init.prx"); 
	loadStartModule("ms0:/F0/kd/sysreg.prx"); 
	loadStartModule("ms0:/F0/kd/gpio.prx"); 
	loadStartModule("ms0:/F0/kd/pwm.prx"); 
	loadStartModule("ms0:/F0/kd/i2c.prx"); 
	loadStartModule("ms0:/F0/kd/dmacplus.prx"); 
	loadStartModule("ms0:/F0/kd/lcdc.prx"); 
	loadStartModule("ms0:/F0/kd/emc_sm.prx"); 
	loadStartModule("ms0:/F0/kd/emc_ddr.prx"); 
	loadStartModule("ms0:/F0/kd/ge.prx"); 
	loadStartModule("ms0:/F0/kd/idstorage.prx"); 
	loadStartModule("ms0:/F0/kd/syscon.prx"); 
	loadStartModule("ms0:/F0/kd/rtc.prx"); 
	loadStartModule("ms0:/F0/kd/lfatfs.prx"); 
	loadStartModule("ms0:/F0/kd/clockgen.prx"); 
	loadStartModule("ms0:/F0/kd/codec.prx"); 
	loadStartModule("ms0:/F0/kd/audio.prx"); 
	loadStartModule("ms0:/F0/kd/display.prx"); 
	loadStartModule("ms0:/F0/kd/ctrl.prx"); 
	loadStartModule("ms0:/F0/kd/loadexec.prx"); 
	loadStartModule("ms0:/F0/kd/mesg_led.prx"); 
	loadStartModule("ms0:/F0/kd/led.prx"); 
	loadStartModule("ms0:/F0/kd/hpremote.prx"); 
	loadStartModule("ms0:/F0/kd/power.prx"); 
	loadStartModule("ms0:/F0/kd/openpsid.prx"); 
	loadStartModule("ms0:/F0/kd/npdrm.prx"); 
	loadStartModule("ms0:/F0/kd/usb.prx"); 
	loadStartModule("ms0:/F0/kd/mediaman.prx"); 
	loadStartModule("ms0:/F0/kd/ata.prx"); 
	loadStartModule("ms0:/F0/kd/umdman.prx"); 
	loadStartModule("ms0:/F0/kd/umd9660.prx"); 
	loadStartModule("ms0:/F0/kd/isofs.prx"); 
	loadStartModule("ms0:/F0/kd/mscm.prx"); 
	loadStartModule("ms0:/F0/kd/msstor.prx"); 
	loadStartModule("ms0:/F0/kd/fatmsmod.prx"); 
	loadStartModule("ms0:/F0/kd/wlan.prx"); 
	loadStartModule("ms0:/F0/kd/wlanfirm_magpie.prx"); 
	loadStartModule("ms0:/F0/kd/registry.prx"); 
	loadStartModule("ms0:/F0/kd/mgr.prx"); 
	loadStartModule("ms0:/F0/kd/msaudio.prx");
	loadStartModule("ms0:/F0/kd/mgvideo.prx"); 
	loadStartModule("ms0:/F0/kd/semawm.prx"); 
	loadStartModule("ms0:/F0/kd/mediasync.prx"); 
	loadStartModule("ms0:/F0/kd/me_wrapper.prx"); 
	loadStartModule("ms0:/F0/kd/vaudio.prx"); 
	loadStartModule("ms0:/F0/kd/utility.prx"); 
	loadStartModule("ms0:/F0/kd/chkreg.prx"); 
	loadStartModule("ms0:/F0/kd/impose.prx"); 
	loadStartModule("ms0:/F0/kd/avcodec.prx"); 
	loadStartModule("ms0:/F0/kd/vshbridge.prx"); 
	loadStartModule("ms0:/F0/vsh/module/chnnlsv.prx"); 
	loadStartModule("ms0:/F0/kd/usersystemlib.prx"); 
	loadStartModule("ms0:/F0/vsh/module/heaparea1.prx"); 
	loadStartModule("ms0:/F0/kd/libatrac3plus.prx"); 
	loadStartModule("ms0:/F0/vsh/module/paf.prx"); 
	loadStartModule("ms0:/F0/vsh/module/common_gui.prx"); 
	loadStartModule("ms0:/F0/vsh/module/common_util.prx"); 
	loadStartModule("ms0:/F0/vsh/module/vshmain.prx"); 

Code: Select all

int loadStartModule(const char *path)
{
	dprintf("Loading module [%s]: ", path);
	int mid = sceKernelLoadModule(path, 0, 0);
	if(mid == 0x80020139)
	{
		// module is already loaded
		dprintfl("already loaded.");
		return 0;
	}
	
	if&#40;mid < 0&#41;
	&#123;
		// unable to load module
		dprintfl&#40;"unable to load."&#41;;
		return mid;
	&#125;
	else
	&#123;
		dprintfl&#40;"Done."&#41;;
	&#125;
	
	dprintf&#40;"Starting module &#91;%s&#93;&#58;"&#41;;
	int result = sceKernelStartModule&#40;mid, 0, 0, 0, 0&#41;;
	if&#40;result < 0&#41;
	&#123;
		// Unable to start
		dprintfl&#40;"unable to start."&#41;;
		return result;
	&#125;
	else
	&#123;
		dprintfl&#40;"Done."&#41;;
	&#125;
	
	return mid;
&#125;
jas0nuk
Posts: 137
Joined: Thu Apr 27, 2006 8:00 am

Post by jas0nuk »

Loading a firmware on top of a firmware = bad.
Undoubtedly it will crash on files such as sysmem.prx...

You need to unload a lot of modules first, but you can't unload some... like sysmem.prx, loadexec.prx, etc.
The only solution is to patch sceIo so it reads from memory stick whilst accessing the flash, and then soft-reboot using reboot.bin whilst keeping all your patches intact. This is basically what Devhook does.
Post Reply