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

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

left a comment

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

This comment has been minimized.

Copy link
Member

commented Aug 1, 2019

bors r+

bors bot added a commit that referenced this pull request Aug 1, 2019
Merge #71
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

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

Build succeeded

  • rust-osdev.bootloader
@bors bors bot merged commit 9b34294 into rust-osdev:master Aug 1, 2019
5 checks passed
5 checks passed
bors Build succeeded
Details
rust-osdev.bootloader Build #20190801.2 succeeded
Details
rust-osdev.bootloader (Job linux) Job linux succeeded
Details
rust-osdev.bootloader (Job mac) Job mac succeeded
Details
rust-osdev.bootloader (Job windows) Job windows succeeded
Details
phil-opp added a commit that referenced this pull request Aug 2, 2019
@64 64 deleted the 64:dyn-stack branch Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.