Open
Description
We previously had some discussion of using some sort of Visitor
pattern to visit and update page tables. I got some time to play around with it a bit today. I think it is promising, but there are some unresolved API questions and some issues that I don't know how to deal with.
Unresolved Problem:
- The visitor doesn't know where in virtual memory a page table is. We need some generic and ergonomic way to figure out this information for
Visitors
to really work. For now, I have left it abstracted as theVisit::get_page
method, which is implemented by eachVisitor
as needed.
Unresolved questions:
- Should we have
visit_huge_page<S: Size>(...)
? Is this too fine-grained?
Here is a rough prototype. It doesn't work or compile, but it should give a rough idea: https://github.com/rust-osdev/x86_64/compare/master...mark-i-m:visitor?expand=1