forked from Rativel/BurritOS
Documentation for the simulator
This commit is contained in:
@@ -1,9 +1,25 @@
|
||||
//! # Loader
|
||||
//!
|
||||
//! This module contains a loader for file section.
|
||||
//! Following the common standard file format for executable files
|
||||
//! [ELF (Executable and Linkable Format)](https://en.wikipedia.org/wiki/Executable_and_Linkable_Forma)
|
||||
//!
|
||||
//! It's used to charge a programme into the machine from a binary file (.guac files)
|
||||
//!
|
||||
//! Basic usage:
|
||||
//!
|
||||
//! ```
|
||||
//! let args = Args::parse();
|
||||
//! let mut machine = Machine::new(args.debug & 1 != 0, read_settings().unwrap());
|
||||
//! let (loader, ptr) = loader::Loader::new(args.executable.as_str(), &mut machine, 0).expect("An error occured while parsing the program");
|
||||
//! ```
|
||||
|
||||
use crate::Machine;
|
||||
use std::fs;
|
||||
use std::io::Read;
|
||||
|
||||
/// The elf header defines principes aspects of the binary files, it's place at the start of the file
|
||||
/// see <https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header> for more informations
|
||||
/// see [ELF file Header](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header) for more informations
|
||||
pub struct ElfHeader {
|
||||
/// Defines whether the file is big or little endian
|
||||
/// true correspond to big endian, false otherwise
|
||||
|
||||
Reference in New Issue
Block a user