Subj : Re: where can I find a malloc for standalone programs ? To : comp.programming From : Scott Moore Date : Fri Aug 19 2005 04:44 pm DEMAINE Benoit-Pierre wrote: > I am writing a program for standalone use; the circuit in configured with some > bootstrap, then my code is called. > > There is no Linux, nor filesyem, nor libraries around. > > my code is statically compiled and linked with gcc. > > problem occurs about malloc: since there is no kernel, nor system, nor stdlib, there > is no malloc defined. I can not either link my application against a stdlib stolen > to any system, since I have no kernel, and that stdlib would not know the addresses > of memory pages available. > > Thus, I need a new malloc that is initialised by a special initialisation call, with > begin and end adresses of memory space, and implements malloc() and free(), and is > aware of endianness, bus width, alignment problems ... A Malloc is presented as an example in the whitebook ! Page 185, section 8.7 of the second edition. .