EmbeddedRelated.com
Forums

allocate 10 GB of memory dynamically

Started by karthikbg November 15, 2006

Donald wrote:
> karthikbg wrote: > >> Hi, >> How to do that Heap allocation for a Board baed on 32-Bit CPU and OS ? >> ( CPU cannot be changed at this stage :( .... !! ) >> >> Any tricks ? >> >> Thx in advans, >> Karthik Balaguru >> > Why is the cpu and OS a secret ???
Doesn't matter. It can be done with any CPU and any OS or without OS.
> If your using Windows and an Intel cpu and C#, NO.
Yes.
> If your using Linux with an Intel cpu and gcc, NO.
Yes.
> > If you have an embedded application, NO.
Yes. It's even simpler.
> > What else it there. > > > If you would like help, please help us help you !!
To allocate as much as you want, make an allocator of your own. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
Vladimir Vassilevsky wrote:

> > > Donald wrote: > >> karthikbg wrote: >> >>> Hi, >>> How to do that Heap allocation for a Board baed on 32-Bit CPU and OS ? >>> ( CPU cannot be changed at this stage :( .... !! ) >>> >>> Any tricks ? >>> >>> Thx in advans, >>> Karthik Balaguru >>> >> Why is the cpu and OS a secret ??? > > > Doesn't matter. > It can be done with any CPU and any OS or without OS. > >> If your using Windows and an Intel cpu and C#, NO. > > > Yes. > >> If your using Linux with an Intel cpu and gcc, NO. > > > Yes. > >> >> If you have an embedded application, NO. > > > Yes. It's even simpler. > >> >> What else it there. >> >> >> If you would like help, please help us help you !! > > > To allocate as much as you want, make an allocator of your own.
Wasn't the OP asking for an existing OS that can allocate 10G of memory ??
> Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com
karthikbg wrote:

> > Got the point now. My understanding is > > I need to have something similar to malloc and allocate until 1 GB > > (loops) and > > have it connected by somemeans and use it . I will try implementing the > > similar logic . > > > > Thx, > > Karthik Balaguru > > I may need to do have something similar to mmap() in UCOS-II. > So, mostly something similar thing (mmap) in UCOS-II RTOS has to be > written ?? > what do you think ? > Any ideas / docs for starting with this mmap creation ?
As far as I know uCOS-II does not support an MMU for paging, and neither does the MCF5272 CPU you are using. Without demand paging, an mmap() system call is pretty much useless, as it would just have to write/read portions of a file in your memory, and you can do that just as well in user mode. On this OS/CPU there is no way to get a real heap bigger than your physical RAM. Depending on your intended use, you may be able to create some sort of class/datatype that uses a file to store the data, but implements some smart caching in memory to speed up typical operations, somewhat like a database.
Arlet wrote:
> karthikbg wrote: > > > > Got the point now. My understanding is > > > I need to have something similar to malloc and allocate until 1 GB > > > (loops) and > > > have it connected by somemeans and use it . I will try implementing the > > > similar logic . > > > > > > Thx, > > > Karthik Balaguru > > > > I may need to do have something similar to mmap() in UCOS-II. > > So, mostly something similar thing (mmap) in UCOS-II RTOS has to be > > written ?? > > what do you think ? > > Any ideas / docs for starting with this mmap creation ? > > As far as I know uCOS-II does not support an MMU for paging, and > neither does the MCF5272 CPU you are using. > > Without demand paging, an mmap() system call is pretty much useless, as > it would just have to write/read portions of a file in your memory, and > you can do that just as well in user mode. > > On this OS/CPU there is no way to get a real heap bigger than your > physical RAM. > > Depending on your intended use, you may be able to create some sort of > class/datatype that uses a file to store the data, but implements some > smart caching in memory to speed up typical operations, somewhat like a > database.
Thx for your replies. It clarified and helped me alot. Regards, Karthik Balaguru
karthikbg wrote:
> Arlet wrote: >
... snip ...
>> >> Depending on your intended use, you may be able to create some >> sort of class/datatype that uses a file to store the data, but >> implements some smart caching in memory to speed up typical >> operations, somewhat like a database. > > Thx for your replies. It clarified and helped me alot.
You might consider using my hashlib as an in memory database. The package, compiled for an x86, involves less than 700 (hex) bytes of code, and is fully re-entrant. I.E. no further code is needed to maintain multiple databases. It is written in purely standard C, so should port anywhere. It is available under GPL, and can be further licenced by contacting me directly. I have had no bug reports since May 2003. Access is always O(1). <http://cbfalconer.home.att.net/download/> -- Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net>