Expand description
Memory management implementation
SV39 page-based virtual-memory architecture for RV64 systems, and everything about memory management, like frame allocator, page table, map area and memory set, is implemented here.
Every task or process has a memory_set to control its virtual memory.
Re-exports
pub use memory_set::KERNEL_SPACE;
pub use memory_set::KERNEL_SPACE;
Modules
- address 🔒Implementation of physical and virtual address and page number.
- Implementation of
FrameAllocator
which controls all the frames in the operating system. - The global allocator
- Implementation of
PageTableEntry
andPageTable
.
Structs
- manage a frame which has the same lifecycle as the tracker
- a memory set instance through lazy_static! managing kernel space
- map permission corresponding to that in pte:
R W X U
- memory set structure, controls virtual-memory space
- Record root ppn and has the same lifetime as 1 and 2 level
PageTableEntry
- page table entry structure
- Definitions
- phiscal page number
- Array of u8 slice that user communicate with os
- Iterator of
UserBuffer
- virtual address
- virtual page number
Traits
- Add value by one
Functions
- allocate a frame
- deallocate a frame
- initiate heap allocator, frame allocator and kernel space
- Get kernelspace root ppn
- Check PageTable running correctly
- Translate a pointer to a mutable u8 Vec through page table
- Translate a generic through page table and return a reference
- Translate a generic through page table and return a mutable reference
- Translate a pointer to a mutable u8 Vec end with
\0
through page table to aString