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;
Modulesยง
- address ๐
- Implementation of physical and virtual address and page number.
- frame_
allocator ๐ - Implementation of
FrameAllocatorwhich controls all the frames in the operating system. - heap_
allocator ๐ - The global allocator
- memory_
set ๐ - Implementation of
MapAreaandMemorySet. - page_
table ๐ - Implementation of
PageTableEntryandPageTable.
Structsยง
- Frame
Tracker - manage a frame which has the same lifecycle as the tracker
- KERNEL_
SPACE - a memory set instance through lazy_static! managing kernel space
- MapPermission
- map permission corresponding to that in pte:
R W X U - Memory
Set - memory set structure, controls virtual-memory space
- Page
Table - Record root ppn and has the same lifetime as 1 and 2 level
PageTableEntry - Page
Table Entry - page table entry structure
- Phys
Addr - Definitions
- Phys
Page Num - phiscal page number
- User
Buffer - Array of u8 slice that user communicate with os
- User
Buffer Iterator - Iterator of
UserBuffer - Virt
Addr - virtual address
- Virt
Page Num - virtual page number
Traitsยง
- Step
ByOne - Add value by one
Functionsยง
- frame_
alloc - allocate a frame
- frame_
dealloc - deallocate a frame
- init
- initiate heap allocator, frame allocator and kernel space
- kernel_
token - Get kernelspace root ppn
- remap_
test - Check PageTable running correctly
- translated_
byte_ buffer - Translate a pointer to a mutable u8 Vec through page table
- translated_
ref - Translate a generic through page table and return a reference
- translated_
refmut - Translate a generic through page table and return a mutable reference
- translated_
str - Translate a pointer to a mutable u8 Vec end with
\0through page table to aString