Reply by CBFalconer December 5, 20062006-12-05
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>
Reply by karthikbg December 5, 20062006-12-05
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
Reply by Arlet November 16, 20062006-11-16
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.
Reply by Donald November 16, 20062006-11-16
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
Reply by Vladimir Vassilevsky November 15, 20062006-11-15

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
Reply by Donald November 15, 20062006-11-15
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 ??? If your using Windows and an Intel cpu and C#, NO. If your using Linux with an Intel cpu and gcc, NO. If you have an embedded application, NO. What else it there. If you would like help, please help us help you !! donald
Reply by karthikbg November 15, 20062006-11-15
karthikbg wrote:
> karthikbg wrote: > > Arlet 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 ? > > > > > > There are no easy tricks. With a 32 bit address register, you can only > > > access a theoretical maximum of 4GB. In practice you'll have to > > > subtract kernel memory space. > > > > > > Which CPU/OS are you using ? With IA-32, you may be able to use the PAE > > > (Physical Address Extension). If you use Windows, look for the Address > > > Windowing Extensions. On Linux, you can use mmap(). Through these > > > tricks you can access more than 4GB, but only in sections, not all at > > > the same time. > > > > I am using MCF5272 Coldfire processor and UCOS-II RTOS(Micrium's). > > > > Regards, > > Karthik Balaguru > > 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 ? Thx in advans, Karthik Balaguru
Reply by karthikbg November 15, 20062006-11-15
karthikbg wrote:
> Arlet 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 ? > > > > There are no easy tricks. With a 32 bit address register, you can only > > access a theoretical maximum of 4GB. In practice you'll have to > > subtract kernel memory space. > > > > Which CPU/OS are you using ? With IA-32, you may be able to use the PAE > > (Physical Address Extension). If you use Windows, look for the Address > > Windowing Extensions. On Linux, you can use mmap(). Through these > > tricks you can access more than 4GB, but only in sections, not all at > > the same time. > > I am using MCF5272 Coldfire processor and UCOS-II RTOS(Micrium's). > > Regards, > Karthik Balaguru
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
Reply by karthikbg November 15, 20062006-11-15
Arlet 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 ? > > There are no easy tricks. With a 32 bit address register, you can only > access a theoretical maximum of 4GB. In practice you'll have to > subtract kernel memory space. > > Which CPU/OS are you using ? With IA-32, you may be able to use the PAE > (Physical Address Extension). If you use Windows, look for the Address > Windowing Extensions. On Linux, you can use mmap(). Through these > tricks you can access more than 4GB, but only in sections, not all at > the same time.
I am using MCF5272 Coldfire processor and UCOS-II RTOS(Micrium's). Regards, Karthik Balaguru
Reply by karthikbg November 15, 20062006-11-15
Vladimir Vassilevsky 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 ? > > You can allocate as much memory as you like, but not in one piece. If > you want to make it look as one piece, you can implement a C++ class > which will handle the pointers. > > > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com
Unable to get your point. I understand that there is some method to allocate memory of any big size. But, not in one piece. How is this possible ? Could you pls explain the technique . Thx in advans, Karthik Balaguru