| View previous topic :: View next topic |
| Author |
Message |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Tue Aug 19, 2008 1:01 am Post subject: compiler error or freeze on pspSdkLoadStartModule |
|
|
While writing a VSH module dealing with other PRXs (PSP_MODULE_INFO("piKeyOpenKeyboard", 0x1000, 1, 1);), i found the error
| Code: | C:/pspsdk/psp/sdk/lib\libpspsdk.a(loadmodule.o): In function `pspSdkLoadStartMod
uleWithArgs':
: undefined reference to `snprintf'
collect2: ld returned 1 exit status
make: *** [piKeyChatPad.elf] Error 1
|
After a little digging, i found a post where J.F. was saying not to use USE_KERNEL_LIB* unless strictly necessary, so i tried setting
| Code: | USE_KERNEL_LIBS = 0
USE_KERNEL_LIBC = 0 |
in my makefile: compiled fine, freezed on pspSdkLoadStartModule 's line (found by logfile, log calls removed for sake of readability)
| Code: | int main_thread(SceSize args, void *argp)
{
int ch;
sceKernelDelayThread(1000000);
// get current directory
char modName[256];
getcwd(modName,240);
strcat(modName,"/sioDriver.prx");
// load siodriver
SceUID mod = pspSdkLoadStartModule(modName, PSP_MEMORY_PARTITION_KERNEL); // here execution stops, PSP freezes
if (mod < 0)
{
sceKernelDelayThread(3000000);
sceKernelExitGame();
}
.
.
.
} |
Issue is present in two different sourcecodes of mine, involving both kernel and user mode PRXs.
Some hints? Someone who already faced the problem? Seems like that pointed here http://forums.ps2dev.org/viewtopic.php?t=10467 |
|
| Back to top |
|
 |
jube
Joined: 23 Oct 2007 Posts: 115
|
Posted: Tue Aug 19, 2008 1:25 am Post subject: |
|
|
"USE_KERNEL_LIBS = 0
USE_KERNEL_LIBC = 0"
not a good idea, from trial and error with pikey as soon as you do that everything starts to go wrong !!! I am having to code my own graphics handling routine that will work with
USE_KERNEL_LIBS = 1
USE_KERNEL_LIBC = 1
for exactly that same reason, and i know nothing about graphics handling on the psp!! Simply because with
USE_KERNEL_LIBS = 1
USE_KERNEL_LIBC = 1
no pre-made graphics routines will link.
Have no idea why, and no time to learn why properly, when have time will go back to books for a reason. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Tue Aug 19, 2008 1:31 am Post subject: |
|
|
Ok, i had the suspect, too...then let me focus on the first part of the post:
how to solve the "undefined reference to `snprintf'"? I already checked and library containing that function IS linked properly.. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Tue Aug 19, 2008 3:52 am Post subject: |
|
|
back to
| Code: | USE_KERNEL_LIBS = 1
USE_KERNEL_LIBC = 1 |
i replaced
| Code: | | SceUID mod = pspSdkLoadStartModule("ms0:/.../mymodule.prx", PSP_MEMORY_PARTITION_USER); |
with
| Code: | SceKernelLMOption option;
SceUID mpid = PSP_MEMORY_PARTITION_USER;
memset(&option, 0, sizeof(option));
option.size = sizeof(option);
option.mpidtext = mpid;
option.mpiddata = mpid;
option.position = 0;
option.access = 1;
SceUID mod = sceKernelLoadModule("ms0:/.../mymodule.prx", 0, &option);
mod = sceKernelStartModule(mod, 0, NULL, 0, &option);
|
as adviced here (http://forums.ps2dev.org/viewtopic.php?p=71184&sid=394e629f808c6dd468c19ec85cacbc6e)... now i get a blurry
| Code: | | SCE_KERNEL_ERROR_ERROR = 0x80020001 |
from sceKernelStartModule: WHY??.
What does really sceKernelStartModule do? Does it simply call "module_start" of supplied module or it is needed to run even if i only want my functions loaded (to hook api ones) and nothing more??
Very confused... |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Aug 19, 2008 8:46 pm Post subject: |
|
|
Try this:
For kernel plugins leave the
USE_KERNEL_LIBS = 1
USE_KERNEL_LIBC = 1
Install the M33SDK and include kubridge.h
Then use kuKernelLoadModule for loading.
Start it with the sceKKernelStartModule.
Don't load into user memory but load into kernel memory. Just give NULL for *options it will load into kernel memory automatically. |
|
| Back to top |
|
 |
jean

Joined: 05 Jan 2008 Posts: 489
|
Posted: Wed Aug 20, 2008 4:53 am Post subject: |
|
|
Oh, very thanks, torch...i will surely try your solution. Only thing to hilight is i sometime need user mode to patch user mode functions...oh, and setting null into options appear resulting in "illegal" error from the load module function...anyway i will invesigate in the direction you pointed....thanks again!
jean |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Aug 20, 2008 9:16 pm Post subject: |
|
|
| jean wrote: | Oh, very thanks, torch...i will surely try your solution. Only thing to hilight is i sometime need user mode to patch user mode functions...oh, and setting null into options appear resulting in "illegal" error from the load module function...anyway i will invesigate in the direction you pointed....thanks again!
jean |
If you want to load into user memory then you shouldn't pass NULL. You'll have to create an Option structure specifying user memory.
mod = kuKernelLoadModule("flash0:/module.prx", 0, NULL); |
|
| Back to top |
|
 |
|