Well, this just isn't going to work, I downloaded the M33 SDK and copied it to the pspdev directory (it's found by the compiler if I include it), and coded this in my attempt to dump the sysconf:
Code: Select all
#include <pspkernel.h>
#include <pspctrl.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <systemctrl.h>
#include <systemctrl_se.h>
PSP_MODULE_INFO("dump", 0x1000, 0, 1);
PSP_MAIN_THREAD_ATTR(0);
STMOD_HANDLER previous = NULL;
int OnModuleStart(SceModule2 *mod);
int OnModuleStart(SceModule2 *mod){
if (strcmp(mod->modname, "sysconf_plugin_module") == 0)
{
u32 *start = (u32 *)sceKernelFindModuleByName("sysconf_plugin_module");
u32 module = *(start+27);
int fd = sceIoOpen("ms0:/dump.bin", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
sceKernelDcacheWritebackAll();
sceIoWrite(fd, (void*) module, 0x030000);
sceIoClose(fd);
}
if (!previous) return 0;
return previous(mod);
}
int main_thread(SceSize args, void* argp)
{
sceKernelDelayThread(2000000);
previous = sctrlHENSetStartModuleHandler(OnModuleStart);
// int fd = sceIoOpen("ms0:/sysconf_dump.bin", PSP_O_WRONLY | PSP_O_CREAT | PSP_O_TRUNC, 0777);
// sceIoWrite(fd, (void*) module, 0x030000);
// sceIoClose(fd);
return 0;
}
int module_start(SceSize args, void *argp)
{
SceUID thid;
thid = sceKernelCreateThread("ch_main", main_thread, 0x18, 0x1000, 0, NULL);
if (thid >= 0) sceKernelStartThread(thid, args, argp);
return 0;
}
int module_stop (void) {
return 0;
}
Added the flag that I should add according to the SDK function doc and also added this:
So, I attempted to compile, and it doesn't work.
Code: Select all
In file included from dump.c:6:
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/include/systemctrl.h:189: er
ror: expected ')' before '*' token
/usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/include/systemctrl.h:230: er
ror: expected '=', ',', ';', 'asm' or '__attribute__' before 'sctrlHENSetStartMo
duleHandler'
dump.c:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'previ
ous'
dump.c:11: error: expected ')' before '*' token
dump.c:12: error: expected ')' before '*' token
dump.c: In function 'main_thread':
dump.c:29: error: 'previous' undeclared (first use in this function)
dump.c:29: error: (Each undeclared identifier is reported only once
dump.c:29: error: for each function it appears in.)
dump.c:29: warning: implicit declaration of function 'sctrlHENSetStartModuleHand
ler'
dump.c:29: error: 'OnModuleStart' undeclared (first use in this function)
But I'm probably slowly moving into the newbie questions, so maybe I shouldn't ask them here, if so, tell me.