Skip to content

Optimize page map to avoid wasting memory #2

@frolv

Description

@frolv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions