Skip to content

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

Merged
bors[bot] merged 2 commits intorust-osdev:masterfrom
64:dyn-stack
Aug 1, 2019
Merged

Dynamically map kernel stack, boot info, physical memory and recursive table#71
bors[bot] merged 2 commits intorust-osdev:masterfrom
64:dyn-stack

Conversation

@64
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/page_table.rs Outdated
Comment thread src/level4_entries.rs Outdated
@phil-opp
Copy link
Copy Markdown
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
Copy Markdown
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