sceKernelCreateThread 80020190

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

Moderators: cheriff, TyRaNiD

Post Reply
pegasus2000
Posts: 160
Joined: Wed Jul 12, 2006 7:09 am

sceKernelCreateThread 80020190

Post by pegasus2000 »

I need help from you.

I am investigating about the malfunction of nd under some versions
of custom firmwares in PSP-FAT.

I have discovered this: when nd tries to execute sceKernelCreateThread,
it receives a code 80020190 (no memory) from kernel (I have tried in PSP-FAT custom firmware vers. 3.71 M33-4)

It seems that the trouble is that the kernel memory area is saturated (nd loads a lot of prx drivers at startup). In fact, if I disable the network support, the error doesn't occur again.

The error appears under some firmware, but in other version it doesn't. For example, there is no error in PSP-SLIM custom firmware 3.71 M33-4).

I have a question: is it possible to disable some PRX that are loaded automatically by kernel at startup and that aren't useful for my application?

Or is it possible to increase the area of the memory that is reserved for kernel ?

Thanks a lot for someone that wants to help me.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Are these user threads, or kernel-mode? If user, you're setting the heap size too big. To make one executable for both the Phat and the Slim, use

PSP_HEAP_SIZE_KB(-X_KB);

to reserve all but X KB of memory for the user heap. You need to leave space apart from the heap for the stacks of the threads being created. The most common cause of thread creation failure is the use of PSP_HEAP_SIZE_MAX();.

Using a negative heap size is much easier than trying to guess heap sizes for both the Phat and Slim.
pegasus2000
Posts: 160
Joined: Wed Jul 12, 2006 7:09 am

Post by pegasus2000 »

J.F. wrote:Are these user threads, or kernel-mode? If user, you're setting the heap size too big. To make one executable for both the Phat and the Slim, use

PSP_HEAP_SIZE_KB(-X_KB);

to reserve all but X KB of memory for the user heap. You need to leave space apart from the heap for the stacks of the threads being created. The most common cause of thread creation failure is the use of PSP_HEAP_SIZE_MAX();.

Using a negative heap size is much easier than trying to guess heap sizes for both the Phat and Slim.

Ok, Joseph, but there is a thing that it doesn't explain itself.

Nd reserves 1 Mb for the stack of the user thread, and this quantity
is the same under FAT and under SLIM.

Why the system works under SLIM and it doesn't under FAT ?
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

I've ever used something like PSP_HEAP_SIZE_KB(-2*1024); and it works great under Fat and Slims!
Post Reply