Pre-Allocating Space (At compiling time)
Posted: Sat Apr 10, 2004 11:23 pm
My memory manger (though ineffiecent (sp?)) Uses a two part system.
A Memory Bit Map - A Char array that holds a value of wether or not a page is allocated (And its type 0 - free 1 - kernel 255 - rsvd)
A Ledger - A array of structures that hold information about each type of allocation, including owner, lenght, address, and type.
Originaly I had a
But then realized That After allocating alot of pages, I was over writting memory in my kernel!
So I changed it to
Thats all well in good, however,
Might also start overwriting parts of ram, I know space isn't decalred for it because I can change 256 to anything and the kernel size stays the same
So my question is, how can I specify the base address for the MMLedger array, or How can I have the space pre-allocated in the kernel as I had already done, with the MemBitMap.
[Update]
MemBitMap is now aligned on a 4k pages sitting at the bottom of my memory manager free pool and isn't required to be filled up w/ zeros anymore. But what about the struct??
Thanks for the help.
Rich P.
A Memory Bit Map - A Char array that holds a value of wether or not a page is allocated (And its type 0 - free 1 - kernel 255 - rsvd)
A Ledger - A array of structures that hold information about each type of allocation, including owner, lenght, address, and type.
Originaly I had a
Code: Select all
char MemBitMap[4096];
So I changed it to
Code: Select all
char MemBitMap[4096] = ""; (inside the "" is 4096 0's)
Code: Select all
struct mledger
{
blah
blah
} MMLedger[256];
So my question is, how can I specify the base address for the MMLedger array, or How can I have the space pre-allocated in the kernel as I had already done, with the MemBitMap.
[Update]
MemBitMap is now aligned on a 4k pages sitting at the bottom of my memory manager free pool and isn't required to be filled up w/ zeros anymore. But what about the struct??
Thanks for the help.
Rich P.