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 🔒PhysAddr, VirtAddr, PhysPageNum, VirtPageNum, raw address
- Physical page frame allocator
- The heap allocator.
- Address Space
MemorySetmanagement of Process - Implementation of
PageTableEntryandPageTable.
Structs§
- tracker for physical page frame allocation and deallocation
- The kernel’s initial memory mapping(kernel address space)
- map permission corresponding to that in pte:
R W X U - address space
- page table structure
- page table entry structure
- Physical Address
- Physical Page Number PPN
- An abstraction over a buffer passed from user space to kernel space
- An iterator over a UserBuffer
- Virtual Address
- Virtual Page Number VPN
Traits§
- iterator for phy/virt page number
Functions§
- Allocate a physical page frame in FrameTracker style
- Deallocate a physical page frame with a given ppn
- initiate heap allocator, frame allocator and kernel space
- the kernel token
- test map function in page table
- Create mutable
Vec<u8>slice in kernel space from ptr in other address space. NOTICE: the content pointed to by the pointerptrcan cross physical pages. - translate a pointer
ptrin other address space to a immutable u8 slice in kernel address space. NOTICE: the content pointed to by the pointerptrcannot cross physical pages, otherwise translated_byte_buffer should be used. - translate a pointer
ptrin other address space to a mutable u8 slice in kernel address space. NOTICE: the content pointed to by the pointerptrcannot cross physical pages, otherwise translated_byte_buffer should be used. - Create String in kernel address space from u8 Array(end with 0) in other address space