1. the module must be a kernel module, so use 0x1000 instead of 0 for the modattribute:
PSP_MODULE_INFO("APPNAME", 0x1000, 1, 1);
2. add a constructor function, which is automaticly called before starting the main function:
Code: Select all
__attribute__((constructor)) void stdoutInit()
{
pspKernelSetKernelPC();
pspDebugInstallStdoutHandler(pspDebugScreenPrintData);
}
The technical details: mrbrown moved the _init call from the _main function in ctr0.c to the _start entry point, so when your program is in kernel mode, you can call kernel mode functions from contructor functions, like registering the tty-kernel-driver for the stdout file routing like explained. After this, the user thread is started, which needs not to be in kernel mode, so your application can run in user mode like a normal application.
This change should be backward compatible, so you don't need to change your existing programs, if you don't need this feature.