Investigation on System

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

Moderators: cheriff, TyRaNiD

Post Reply
mypspdev
Posts: 178
Joined: Wed Jul 11, 2007 10:30 pm

Investigation on System

Post by mypspdev »

I'm running some procedure to investigate behind the PSP System:

Thread list and info: it works fine.

Code: Select all

void Thread_List()
{
	SceUID thid[100];
	int thcount;
	sceKernelGetThreadmanIdList(SCE_KERNEL_TMID_Thread, thid, 100, &thcount);
	char s[64];
	sprintf(s, "(%d)", thcount);
	SceKernelThreadInfo thinfo;
	int i;
	for&#40;i = 0; i < thcount; i++&#41;
	&#123;
		memset&#40;&thinfo, 0, sizeof&#40;SceKernelThreadInfo&#41;&#41;;
		thinfo.size = sizeof&#40;SceKernelThreadInfo&#41;;
		sceKernelReferThreadStatus&#40;thid&#91;i&#93;, &thinfo&#41;;
		printf&#40;"Thread &#58; %s ",thinfo.name&#41;;
		printf&#40;"\n"&#41;;
	&#125;
&#125;
Module List: it works as expected:

Code: Select all

void module_List&#40;&#41;
&#123;
	SceUID modid&#91;100&#93;;
	int modcount;
	sceKernelGetModuleIdList&#40;modid, 100, &modcount&#41;;
	char s&#91;64&#93;;
	sprintf&#40;s, "&#40;%d&#41;", modcount&#41;;
	SceKernelModuleInfo minfo;
	int i;
	for&#40;i = 0; i < modcount; i++&#41;
	&#123;
		memset&#40;&minfo, 0, sizeof&#40;SceKernelModuleInfo&#41;&#41;;
		minfo.size = sizeof&#40;SceKernelModuleInfo&#41;;
		sceKernelQueryModuleInfo&#40;modid&#91;i&#93;, &minfo&#41;;
		printf&#40;"Module &#58; %s ", minfo.name&#41;;
		printf&#40;"\n"&#41;;
	&#125;
&#125;
Checking RAM: ERROR on start of homebrew if un-commented sceKernelQuerymemoryPartitionInfo...

Any help please? Thanks in advance

Code: Select all

void check_RAM&#40;&#41;
&#123;
	int i;
	PspSysmemPartitionInfo pinfo;
	for&#40;i = 0; i < 6; i++&#41;
	&#123;
		memset&#40;&pinfo, 0, sizeof&#40;pinfo&#41;&#41;;
		pinfo.size = sizeof&#40;pinfo&#41;;
		sceKernelQueryMemoryPartitionInfo&#40;i + 1, &pinfo&#41;;
//		sprintf&#40; "%u  0x%08x  0x%08x  0x%08x 0x%08x 0x%x", i + 1, pinfo.memsize, pinfo.startaddr, sceKernelPartitionTotalFreeMemSize &#40;i + 1&#41;, sceKernelPartitionMaxFreeMemSize &#40;i + 1&#41;, pinfo.attr&#41;;
//		printf&#40; "%u  0x%08x  0x%08x  0x%08x 0x%08x 0x%x", i + 1, pinfo.memsize, pinfo.startaddr, sceKernelPartitionTotalFreeMemSize &#40;i + 1&#41;, sceKernelPartitionMaxFreeMemSize &#40;i + 1&#41;, pinfo.attr&#41;;
	&#125;
&#125;
[/code]
Post Reply