I've tried to recompile the current version of Blind Assistant.
A trouble that I cannot understand happens.
sceKernelCreateThread returns an error code 80020190.
nd memory manager allocates the heap at startup in the
following way: it asks to sceKernelMaxFreeMemSize() the
amount of the memory that is available and it allocates
it - 1024*1024 bytes.
Code: Select all
static inline int FixedKernelMaxFreeMemSize (void)
{
char string [256];
ndINFO_GetValue (NDGET_OPERATINGSYSTEM, &string, 0, 0);
// Determina il tipo di sistema operativo presente
if (!strcmp (string, "Sony Playstation Portable CFW")) // Siamo su custom firmware
{
return sceKernelMaxFreeMemSize() - 1*1024*1024;
// Un 1 Mb di Heap viene riservato allo stack dei vari thread
}
else // Normale applicazione per firmware 1.5
{
return sceKernelMaxFreeMemSize();
}
}
static inline void * _sbrk(ptrdiff_t incr)
{
static void * heap_bottom = NULL;
static void * heap_top = NULL;
static void * heap_ptr = NULL;
/* Has our heap been initialized? */
if (heap_bottom == NULL)
{
/* No, initialize the heap. */
SceSize heap_size;
if (&sce_newlib_heap_kb_size != NULL)
{
heap_size = sce_newlib_heap_kb_size * 1024;
}
else
{
if (&__pspsdk_is_prx != NULL)
{
heap_size = DEFAULT_PRX_HEAP_SIZE_KB * 1024;
}
else
{
heap_size = FixedKernelMaxFreeMemSize();
}
}
__psp_heap_blockid = sceKernelAllocPartitionMemory(2, "block", PSP_SMEM_Low, heap_size, NULL);
spaces of the single threads. The strange thing is that the system
refuses to create other threads with the error 80020190 (no
memory). (sceKernelCreateThread is used to create user threads)
The situation doesn't change if I try to increase the memory that
is reserved to the system outside the heap.
There is another strange thing: if I reserved only 512 kb of ram
outside the heap, the routines of network initialization fail but the
trouble with sceKernelCreateThread disappears. This suggests to
me that network consumes part of the kernel memory.
Please, can anyone help me ?
It is possible to see the situation of kernel memory using any
particular function ? And is it possible to increase the kernel
memory ?
[/code]