Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize page map to avoid wasting memory #2

Open
frolv opened this issue Feb 28, 2018 · 0 comments
Open

Optimize page map to avoid wasting memory #2

frolv opened this issue Feb 28, 2018 · 0 comments

Comments

@frolv
Copy link
Owner

frolv commented Feb 28, 2018

Currently, the page map contains an entry for each page from address 0 to the end of RAM as reported by multiboot. This can potentially waste large amounts of space in the event of a memory gap.

e.g. A system with 1G of memory could have 1M-768M as usable RAM, reserve addresses 768M-1024M, and continue usable RAM from 1024M to 1280M. The gap in between 768M-1024M is not valid memory, but the page map will still contain entries for all pages in this range, marked as reserved. These entries serve no purpose, only wasting memory which could be used elsewhere.

The page map should be modified to not create entries for unusable memory addresses. However, this needs to be done in such a way that address to page struct lookups still run in constant time as the efficiency of this operation is essential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant