more questions about the buddy system
Posted on 2009-05-12
Hey, I need to implement the buddy system in C, I understand that we allocate one big chunk of memory, and then take the address from that, and add to that, to allocate space to an application...
My question is... how do we get the starting address of the memory chunk?
I've written a small program that would allocate 8 MB and give me the starting address of the block, but I'm getting some weird error with the malloc call.
And, suppose I want to allocate 2 MB to an application... how would I go about doing that? take the starting address and add 2 million bytes to it?