1
0
forked from Rativel/BurritOS

Documentation for mem_cmp.rs and mmu.rs modules

This commit is contained in:
Rémi Rativel
2023-05-09 19:15:56 +02:00
parent d35314bead
commit 692c3bfa03
2 changed files with 53 additions and 16 deletions

View File

@@ -1,18 +1,38 @@
//! # mmu
//!
//! This module contains a MMU implementation
//!
//! This part isn't tested and integrated to BurritOS because of the lack of pagination implementation
//!
//!
use crate::simulator::translationtable::*;
use crate::simulator::machine::*;
//! # Memory Management Unit
//! An MMU possesses a single reference to a translation table
//! This table is associated to the current process
pub struct MMU <'a>{
/* Un MMU possède une seule référence vers une table des pages à un instant donné
* Cette table est associée au processus courant
* Cette référence peut etre mise a jour par exemple lors d'un switchTo
*/
/// Reference to a page table
translationTable : Option<&'a mut TranslationTable>,
/// The number of physique pages
numPhyPages : u64,
/// Size of each page
pageSize : u64
}
impl <'a>MMU <'_>{
/// Create a MMU with a None reference for the translation table
///
/// ### Parameters
///
/// - **numPhyPages** the number of physique pages
/// - **pageSize** the size of a page
///
/// ### Return
///
/// MMU with None reference and the value for the number of physical pages and pae size associated
fn create(numPhyPages: u64, pageSize: u64) -> MMU <'a>{
MMU {
translationTable : None,