| View previous topic :: View next topic |
| Author |
Message |
hubevolution
Joined: 17 Mar 2004 Posts: 32
|
Posted: Tue Apr 11, 2006 4:54 pm Post subject: kernel prx and allocation |
|
|
in my project I am using a kernel bootloader to load a full kernel prx ... the whole stuff was working until I declared 2 static buffer sized 3.000.000 bytes each, that cause the loader to fail on sceKernelLoadModule() with memory allocation error.
I guess that the problem is that kernel code has 8Mb of memory to use.
I guess at this point that I have to allocate memory (maybe in user space) ... how can I do it in a full kernel prx, can I use malloc ?
I think no otherwise I would include no-kernel libs.
Anybody can give me a hint ?
Thanks. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Wed Apr 12, 2006 2:03 am Post subject: |
|
|
Well the total free memory for a kernel app on 1.5 is around 600KiB only, you cannot load more than that into kernel ram (you get maybe 150KiB more on 1.0 _but_ when loadexec starts up reboot that will fail instead if you are low on memory).
You should just be able to use normal malloc from newlib in your application, that will allocate a heap in user memory (assuming you have any left), alternatively use sceKernelAllocPartitionMemory and sceKernelGetBlockHeadAddr with partition 2 to allocate user memory directly, although you will have to probably segment it up manually. |
|
| Back to top |
|
 |
|