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

rework UsedLevel4Entries #219

Merged
merged 2 commits into from
Feb 3, 2022
Merged

Conversation

Freax13
Copy link
Member

@Freax13 Freax13 commented Jan 30, 2022

This pr reworks how UsedLevel4Entries is created and used. UsedLevel4Entries is used to keep track of address ranges that are already in use and dynamically get unused addresses for unconfigured addresses in the config at runtime.

Previously the only addresses that were marked as used where the addresses of the kernel segments. This pr changes the UsedLevel4Entries constructor to also mark all the statically configured addresses in the config as used.

This pr also moves the marking of kernel segment addresses into a separate method. This improves support for position independent executables: Previously we just loaded position independent executables with a fixed offset of 0x400000, but if we also want to get this offset dynamically at runtime, we have to initialize UsedLevel4Entries before we mark the kernel segments as used.

Copy link
Member

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left two minor comments, otherwise this looks good to me. Thanks a lot!

@phil-opp phil-opp merged commit 1ee7c35 into rust-osdev:main Feb 3, 2022
phil-opp added a commit that referenced this pull request Apr 9, 2022
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

Successfully merging this pull request may close these issues.

2 participants