forked from Rativel/BurritOS
Documentation for the simulator
This commit is contained in:
@@ -1,23 +1,35 @@
|
||||
//Nombre maximum de correspondances dans une table des pages
|
||||
//Cette donnée devra a terme etre recupérée depuis un fichier de configuration
|
||||
//! # Translation Table
|
||||
//!
|
||||
//! This module implement a trnslation table used for fot the MMU Emulator
|
||||
//!
|
||||
//! This part isn't tested nor integrated to BurritOS,
|
||||
//! but will be useful in the futur when the pagination will be implemented.
|
||||
//!
|
||||
//! It contains:
|
||||
//! - all the setters and getters for translation table
|
||||
//! - modificaters of table values
|
||||
|
||||
|
||||
/// Maximum number in a Page Table
|
||||
/// For a futur evolution of program, this value should be load from a configuration file
|
||||
const MaxVirtPages : u64 = 200000;
|
||||
|
||||
|
||||
/* Une table de correspondance propre à un processus
|
||||
* Une variable de type TranslationTable devra etre possédée par un objet de type Process
|
||||
*/
|
||||
/// Translation Table corresponding to a process
|
||||
/// An iteration of type TranslationTable should be possesses by an oject of type Process
|
||||
pub struct TranslationTable{
|
||||
//capacité de cette table <=> nombre de correspondances possibles
|
||||
//A voir si cette donnée doit etre immuable
|
||||
/// Table size <=> nb of possible translation
|
||||
pub maxNumPages : u64,
|
||||
|
||||
//la table en question
|
||||
//Vec implemente le trait Index, donc un bon choix
|
||||
///The table *Vec impemente Index Trait*
|
||||
pub pageTable : Vec<PageTableEntry>
|
||||
}
|
||||
|
||||
impl TranslationTable {
|
||||
|
||||
/// TranslationTable constructor
|
||||
///
|
||||
/// ### Return
|
||||
/// TranslationTable with an empty Vector
|
||||
pub fn create() -> TranslationTable {
|
||||
|
||||
let mut tmp_vec : Vec<PageTableEntry> = Vec::new();
|
||||
|
||||
Reference in New Issue
Block a user