Documentation for mem_cmp.rs and mmu.rs modules
This commit is contained in:
parent
d35314bead
commit
692c3bfa03
@ -1,14 +1,31 @@
|
||||
///! FILE.TXT FORMAT Representing machine memory memory
|
||||
/// - PC
|
||||
/// - SP
|
||||
/// - Section_1
|
||||
/// - Section_2
|
||||
/// - ...
|
||||
/// - Section_n
|
||||
///
|
||||
/// Each section is divided in 3 parts, on two lines of text
|
||||
/// addr SPACE len
|
||||
/// content
|
||||
//! # mem_cmp
|
||||
//!
|
||||
//! This module contains a MemChecker.
|
||||
//!
|
||||
//! It's used to compare state memory obtained after a dump memory from NachOS and BurritOS.
|
||||
//!
|
||||
//! This module is used exclusively for testing the instruction simulator.
|
||||
//!
|
||||
//! Basic usage:
|
||||
//!
|
||||
//! ```
|
||||
//! let mut m = Machine::new(true, get_debug_configuration());
|
||||
//! let mut MemChecker = mem_cmp::MemChecker::from(get_full_path!("memory", expr));
|
||||
//! mem_cmp::MemChecker::fill_memory_from_mem_checker(&MemChecker, &mut m);
|
||||
//! ```
|
||||
//!
|
||||
//!
|
||||
//! ! FILE.TXT FORMAT Representing machine memory memory
|
||||
//! - PC
|
||||
//! - SP
|
||||
//! - Section_1
|
||||
//! - Section_2
|
||||
//! - ...
|
||||
//! - Section_n
|
||||
//!
|
||||
//! Each section is divided in 3 parts, on two lines of text
|
||||
//! addr SPACE len
|
||||
//! content
|
||||
|
||||
use std::{fs, io::{BufRead, BufReader, Lines, Error}};
|
||||
use crate::Machine;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user