-
-
Notifications
You must be signed in to change notification settings - Fork 846
Confusion about virtual memory mapping #231
-
I am trying to implement a 4kib Translation Granule Size instead of 64Kib, I am a little confused as to how translation works despite having gone through the armv8a documentation. Could someone please help me understand the difference between page,block,table descriptors, their permissions and how to create a translation table?
const NUM_LVL2_TABLES: usize = bsp::memory::mmu::KernelAddrSpace::SIZE >> Granule512MiB::SHIFT;
//--------------------------------------------------------------------------------------------------
// Public Definitions
//--------------------------------------------------------------------------------------------------
/// Big monolithic struct for storing the translation tables. Individual levels must be 64 KiB
/// aligned, so the lvl3 is put first.
#[repr(C)]
#[repr(align(65536))]
pub struct FixedSizeTranslationTable {
/// Page descriptors, covering 64 KiB windows per entry.
lvl3: [[PageDescriptor; 8192]; NUM_TABLES],
/// Table descriptors, covering 512 MiB windows.
lvl2: [TableDescriptor; NUM_TABLES],
}
/// A translation table type for the kernel space.
pub type KernelTranslationTable = FixedSizeTranslationTable<NUM_LVL2_TABLES>;
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
I'm not quite sure how to answer your questions. I will try to take a look at this sometime soon.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1