Page 1 of 1

Where to place the BMP for PMM

Posted: Fri May 14, 2010 2:00 pm
by HitmanYesman
I'm still creating a PMM after I realized I had no clue what I was doing. So I have gathered some information from various places and brought it all together. I'm ready to begin, but I have no idea where to place my BMP. My OS will only be designed for 32 bit CPUs. So I found out that (without PAE which I'm not worried about at the moment) the max size of RAM a 32 bit CPU can handle is around 4 GB. I did the math of getting the amount of frames, then simplifying that down into KB. 128 KB is what I got. I just don't know where to put the 128 KB. I've read some articles and informational text and they just place it in random spots not explaining why they chose that address. Any ideas on where I should put the BMP? And (for now) I'm going to be using the BMP just for 16 MB for contiguous memory and use a stack for the rest of the memory.

Thanks for helping

Re: Where to place the BMP for PMM

Posted: Fri May 14, 2010 3:15 pm
by montrom
Place it somewhere after your kernel in memory and before the portion of free memory you have to manage. Reserve that whole area.

Code: Select all

[R E S E R V E D]
[kernel]-[bitmap]-[free memory]

Re: Where to place the BMP for PMM

Posted: Fri May 14, 2010 3:26 pm
by HitmanYesman
Thanks

Re: Where to place the BMP for PMM

Posted: Fri May 14, 2010 9:20 pm
by TylerH
Thanks, I was wondering the same thing. I was going to use some complex method involving using the memory map to find a free place big enough, but that idea's better, I'll let grub do the finding for me.

Re: Where to place the BMP for PMM

Posted: Sat May 15, 2010 1:37 am
by xenos
In general, you don't even need the whole 128k that would be needed for managing 4 GB of physical RAM. The bitmap is needed only for RAM that is actually present.