Using PML4 to keep track of free memory

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
IanSeyler
Member
Member
Posts: 326
Joined: Mon Jul 28, 2008 9:46 am
Location: Ontario, Canada
Contact:

Using PML4 to keep track of free memory

Post by IanSeyler »

The title says it all.. Is it possible (or rather, a good idea) to use the existing PML4 to keep track of free pages of memory?
BareMetal OS - http://www.returninfinity.com/
Mono-tasking 64-bit OS for x86-64 based computers, written entirely in Assembly
User avatar
sortie
Member
Member
Posts: 931
Joined: Wed Mar 21, 2012 3:01 pm
Libera.chat IRC: sortie

Re: Using PML4 to keep track of free memory

Post by sortie »

I'm not sure I follow. You mean mapping all the free physical pages in some address space?
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Using PML4 to keep track of free memory

Post by AJ »

Hi,

I think you are asking if you can keep track of whether a physical page is free or not by checking whether it appears in the paging structures themselves? If so, that's a Bad Idea as it involves walking the entire contents of all paging structures for all processes, before you can even begin to determine whether a given page is free.

Cheers,
Adam
Post Reply