Load PRX from Eboot
-
- Posts: 25
- Joined: Mon Mar 24, 2008 12:16 pm
Load PRX from Eboot
Hi all,
I am trying to include prx files into my eboot using bin/o and then load them into kernel memory when they are needed.
i use this function to store the prx file in the eboot.
syslib.o : syslib.prx
bin2o -i syslib.prx syslib.o syslib
But how do i load if from the memory?
Regards
Homemister
I am trying to include prx files into my eboot using bin/o and then load them into kernel memory when they are needed.
i use this function to store the prx file in the eboot.
syslib.o : syslib.prx
bin2o -i syslib.prx syslib.o syslib
But how do i load if from the memory?
Regards
Homemister
Hi! :)
I never used bin2o, but if it works like bin2c it should declare a variable named as the label parameter:
Ciaooo
Sakya
I never used bin2o, but if it works like bin2c it should declare a variable named as the label parameter:
Code: Select all
static unsigned char label[] __attribute__((aligned(16)))
Sakya
Hi! :)
And you get a header file with the declaration of
Ciaooo
Sakya
Almost the same way you used bin2o: :)homemister wrote:how do you do bin2c?
Code: Select all
bin2c syslib.prx syslib.h syslib
Code: Select all
static unsigned char syslib[] __attribute__((aligned(16))) = {
....
};
Sakya
-
- Posts: 25
- Joined: Mon Mar 24, 2008 12:16 pm
Hi! :)
If there's no way to do this I think you can at last save the data to a file and then load it. ;)
EDIT: Try to have a look to this function:
But if this function works only in kernel mode you'll need a kernel prx to use it...so the problem isn't solved. :)
Ciaooo
Sakya
Sorry, I don't know if it is possible to load a prx from memory and not from ms/flash.homemister wrote:how do i then load it into the kernal memory?
Sorry for all of the trouble, but i have never done this before.
If there's no way to do this I think you can at last save the data to a file and then load it. ;)
EDIT: Try to have a look to this function:
Code: Select all
/**
* Load a module from a buffer using the USB/WLAN API.
*
* Can only be called from kernel mode, or from a thread that has attributes of 0xa0000000.
*
* @param bufsize - Size (in bytes) of the buffer pointed to by buf.
* @param buf - Pointer to a buffer containing the module to load. The buffer must reside at an
* address that is a multiple to 64 bytes.
* @param flags - Unused, always 0.
* @param option - Pointer to an optional ::SceKernelLMOption structure.
*
* @returns The UID of the loaded module on success, otherwise one of ::PspKernelErrorCodes.
*/
SceUID sceKernelLoadModuleBufferUsbWlan(SceSize bufsize, void *buf, int flags, SceKernelLMOption *option);
Ciaooo
Sakya
-
- Posts: 25
- Joined: Mon Mar 24, 2008 12:16 pm
-
- Posts: 18
- Joined: Wed Nov 28, 2007 4:18 am
You also can use this :
In my SDK, the function vshKernelLoad... hasn't been defined, so you can use a paralel function found at pspmodulemgr_kernel.h , his name is sceKernelLoadModuleBuffer.
Personally, I didn't test it function, and I don't know if that function will work in vsh mode.
The usage of LoadStartModuleBuffer is easy, just write LoadStartModuleBuffer(buffer, sizeof(buffer), 0);
Code: Select all
int LoadStartModuleBuffer(void *buffer, int size, int a2)
{
SceUID v0 = vshKernelLoadModuleBufferVSH(size, buffer, 0, 0) < 0) return -1;
if(v0 < 0)
return -1;
if(a2 == 0)
return sceKernelStartModule(v0, 0, 0, 0, 0);
return 0;
}
Personally, I didn't test it function, and I don't know if that function will work in vsh mode.
The usage of LoadStartModuleBuffer is easy, just write LoadStartModuleBuffer(buffer, sizeof(buffer), 0);