need help for startup with my memmory manager

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
bsunisol
Member
Member
Posts: 40
Joined: Fri Apr 06, 2007 3:00 pm
Location: Germany, Berlin and near Hamburg

need help for startup with my memmory manager

Post by bsunisol »

hi there,
i have an idea of how to code my MM.
i will do it with a list of ram which is used and not.
but this list needs ram for it self.
i dont know how many of ram i should reserve for
this list or if there is a way to do that dynamicly....

some hints?


thanks.
Uni_Sol
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post by hailstorm »

You could start by finding out how many memory the system has. Based on that number and your smallest allocation block, you can decide how large your list should be. For example, you can decide yo use 4K as smallest allocation unit (page frame size on the i386). Calculating how large that list of yours is would be:

List_size = (sys_mem_in_bytes / 4096) * sizeof(list_unit)

or something like this...

succes!
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

I put my bitmap immediately after the end of the kernel in memory. My bitmap is sized based on how much memory there is present in the system. Just make sure that you mark the bitmap/stack/whatever you use to keep track of memory as used.
User avatar
jerryleecooper
Member
Member
Posts: 233
Joined: Mon Aug 06, 2007 6:32 pm
Location: Canada

Post by jerryleecooper »

im doing that myself. Im using an array defined in the stack as its first array. the last item point to the next array, which is allocated by one item in the array.
User avatar
Telgin
Member
Member
Posts: 72
Joined: Thu Dec 20, 2007 1:45 pm

Post by Telgin »

Yeah, from what I understand the best way to do it is to just put the memory management information (bitmap, or what have you) at a specific address in memory that you will make a conscious effort to not stamp on. If you know the size already, this isn't too hard (just do the math before hand, if you know how much RAM is in the machine you should be able to figure out how much book keeping information is necessary, such as the size of the bitmap).
User avatar
bsunisol
Member
Member
Posts: 40
Joined: Fri Apr 06, 2007 3:00 pm
Location: Germany, Berlin and near Hamburg

Post by bsunisol »

thanks guys
Post Reply