-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Moving page table mapping into page fault handler #593
Comments
|
That's a tricky issue that I didn't consider. My intuition would be to use I opened rust-lang/rust#60367 in the Rust repository for this. Let's see what they say. |
In the meantime, I think you would need to pack the Iterator as a trait object, e.g. putting it in a Box. pub struct BootInfoFrameAllocator<I> where I: Iterator<Item = PhysFrame> {
frames: Box<I>,
} |
@andre-richter That should work. The problem is that we don't have heap allocation on the blog yet. |
Ah, my bad 😅 |
Not at all. It is the best solution to this problem currently, independent of the state of the blog. |
This makes it very hard to put the BootInfoFrameAllocator in a static, e.g. for accessing it from a page fault handler. See #593 for more information.
This makes it very hard to put the BootInfoFrameAllocator in a static, e.g. for accessing it from a page fault handler. See #593 for more information.
I opened #595 to change the implementation of |
Investing further, it seems like we could solve the original problem with a named existential type in the future. However, the implementation of this feature is still in its early stages (some ICEs andlifetime problems, only placeholder syntax), so it's not a good fit for the blog right now. |
@redamith2 Could you try the updated instructions at https://os.phil-opp.com/paging-implementation/#allocating-frames and see if it works? |
Thank you I after making those changes it worked. |
Perfect, thanks for trying! |
I am trying to move the mapping into the page fault handler, but i would like to create a pub static variables for both mapper and frame_allocator where I can pass it along to the mapping in the page fault handler
On doing so I get the error
The text was updated successfully, but these errors were encountered: