forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

kernel prx and allocation

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
hubevolution



Joined: 17 Mar 2004
Posts: 32

PostPosted: Tue Apr 11, 2006 4:54 pm    Post subject: kernel prx and allocation Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Apr 12, 2006 2:03 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group