oscourse-tsinghua / rcore_plus

Rust version of THU uCore OS. Linux compatible.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simplify virtual memory management

wangrunji0408 opened this issue · comments

The current code structure is confusing!
The recursive mapping is really hard to understand and make the code more complicated.

BlogOS has replaced recursive mapping by linear mapping all physical memory.
See discussions here: phil-opp/blog_os#545.

Some ideas:

  • Deprecate InactivePageTable and only access ActivePageTable

    • Remove remap_the_kernel from kernel.
    • Build a fine page table for kernel in bootloader (as x86_64 did).
    • Let MemorySet owns &'static mut ActivePageTable
  • Move arch-specific page table implementation to memory crate

@miskcoo is doing similar work on mipsel platform. Maybe he will be interested.