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

Dynamically map kernel stack, boot info, physical memory and recursive table #71

Merged
merged 2 commits into from
Aug 1, 2019

Conversation

64
Copy link
Contributor

@64 64 commented Aug 1, 2019

Fixes #61. This provides a way for the user to set the kernel stack address through an environment variable, or calculate it dynamically, making sure that it does not interfere with any other mappings. We also calculate space for the recursive page table, boot info and physical memory offset, with the small optimisation that the boot info and kernel stack are placed adjacently if possible to save a few extra page table allocations.

Going to punt on a way to unmap these things for now. Reclaiming memory from unused page tables is a bit tricky and it would be nice to do it right.

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.

Thanks a lot for tackling this! I think I found a small bug (exclusive instead of inclusive range), otherwise the changes look very good to me.

src/page_table.rs Outdated Show resolved Hide resolved
src/level4_entries.rs Outdated Show resolved Hide resolved
@phil-opp
Copy link
Member

phil-opp commented Aug 1, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 1, 2019
71: Dynamically map kernel stack, boot info, physical memory and recursive table r=phil-opp a=64

Fixes #61. This provides a way for the user to set the kernel stack address through an environment variable, or calculate it dynamically, making sure that it does not interfere with any other mappings. We also calculate space for the recursive page table, boot info and physical memory offset, with the small optimisation that the boot info and kernel stack are placed adjacently if possible to save a few extra page table allocations.

Going to punt on a way to unmap these things for now. Reclaiming memory from unused page tables is a bit tricky and it would be nice to do it right.

Co-authored-by: Matt Taylor <mstaveleytaylor@gmail.com>
@bors
Copy link
Contributor

bors bot commented Aug 1, 2019

Build succeeded

  • rust-osdev.bootloader

@bors bors bot merged commit 9b34294 into rust-osdev:master Aug 1, 2019
phil-opp added a commit that referenced this pull request Aug 2, 2019
@64 64 deleted the dyn-stack branch September 9, 2019 18:15
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.

Make the kernel stack movable
2 participants