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

Improve Paging Implementation Post #666

merged 5 commits into from Sep 14, 2019


Copy link

commented Sep 14, 2019

This pull request cleans up and improves the Paging Implementation post in a number of places:

  • New Content: Create a new Choosing a Virtual Page subsection that explains in detail when additional page table frames are required from the frame allocator and when not. This also includes a new figure.
  • Code Fix: Use page 0 instead of 0x1000 for the example mapping because the new bootloader version now maps 0x1000 itself, so that a 'page already mapped' error would occur.
  • Code Simplification: Use the new OffsetPageTable type instead of MappedPageTable. This avoids the use of impl Trait as a return type, which can lead to problems when trying to store the returned type in a static variable (since you can't name the type).
  • Code Change: Update the functions of the memory module to take the physical_memory_offset as a VirtAddr instead of a plain u64. This makes it clearer that the address is virtual and also simpler to calculate the virtual address for a physical address (no more Virt::new).
  • Code Change: Simplify the signature of the create_example_mapping function by taking an OffsetPageTable type as an argument instead of an impl Trait argument. (It is unlikely that the function is called with different mapper types.)
  • Clean-Up: Remove the "Another Paging Post?" aside at the beginning that mentioned the old "Advanced Paging" post and the reasons for writing a new version of the post. The new version is now already more than seven months old, so there's is no need to mention the previous version anymore.
  • Other: Update the screenshots and stack addresses for the new bootloader version to avoid confusion (the new bootloader version changed stack placement).

The required updates to the post-09 branch are implemented in #667. See the diff for an overview of the code changes induced by this PR.

phil-opp added 5 commits Sep 11, 2019
It's been a while since we removed the old Advanced Paging post.
Bootloader 0.8.0 maps the page at 0x1000 itself.
@phil-opp phil-opp added the relnotes label Sep 14, 2019
@phil-opp phil-opp merged commit d4d853c into master Sep 14, 2019
5 checks passed
5 checks passed
Zola Build
Zola Build
Check Spelling
Check Spelling
phil-opp.blog_os Build #20190914.4 succeeded
@phil-opp phil-opp deleted the offset_page_table branch Sep 14, 2019
@phil-opp phil-opp added this to Done in Roadmap Sep 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.