BurritOS now read configuration file
This commit is contained in:
@ -344,10 +344,11 @@ mod test {
|
||||
use crate::kernel::exception::{SC_SHUTDOWN, SC_WRITE};
|
||||
use crate::kernel::system::System;
|
||||
use crate::simulator::machine::Machine;
|
||||
use crate::utility::cfg::get_debug_configuration;
|
||||
|
||||
#[test]
|
||||
fn test_sc_shutdown() {
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
machine.write_int_register(17, SC_SHUTDOWN as i64); // Set type to shutdown
|
||||
// let ecall = Instruction::new(0b000000000000_00000_000_00000_1110011);
|
||||
|
||||
@ -363,7 +364,7 @@ mod test {
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn test_sc_print() {
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
|
||||
let _address = machine.read_int_register(10);
|
||||
// Write string 'HELLO' in memory
|
||||
|
@ -227,13 +227,13 @@ impl Condition {
|
||||
mod test {
|
||||
use std::{rc::Rc, cell::RefCell};
|
||||
|
||||
use crate::{kernel::{thread::Thread, synch::Lock, thread_manager::ThreadManager}, simulator::machine::Machine};
|
||||
use crate::{kernel::{thread::Thread, synch::Lock, thread_manager::ThreadManager}, simulator::machine::Machine, utility::cfg::get_debug_configuration};
|
||||
|
||||
|
||||
|
||||
#[test]
|
||||
fn test_lock_simple() {
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
let mut tm = ThreadManager::new(true);
|
||||
let thread = Rc::new(RefCell::new(Thread::new("test_lock")));
|
||||
tm.ready_to_run(Rc::clone(&thread));
|
||||
@ -255,7 +255,7 @@ mod test {
|
||||
let thread1 = Rc::new(RefCell::new(Thread::new("test_lock1")));
|
||||
let thread2 = Rc::new(RefCell::new(Thread::new("test_lock2")));
|
||||
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
let mut tm = ThreadManager::new(true);
|
||||
|
||||
tm.ready_to_run(Rc::clone(&thread1));
|
||||
|
@ -371,12 +371,12 @@ impl ThreadManager {
|
||||
mod test {
|
||||
use std::{rc::Rc, cell::RefCell};
|
||||
|
||||
use crate::{simulator::{machine::Machine, loader}, kernel::{system::System, thread::Thread, process::Process, thread_manager::ThreadManager, synch::Semaphore}};
|
||||
use crate::{simulator::{machine::Machine, loader}, kernel::{system::System, thread::Thread, process::Process, thread_manager::ThreadManager, synch::Semaphore}, utility::cfg::get_debug_configuration};
|
||||
use crate::kernel::synch::Lock;
|
||||
|
||||
#[test]
|
||||
fn test_thread_context() {
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
|
||||
let (loader, ptr) = loader::Loader::new("./target/guac/halt.guac", &mut machine, 0).expect("IO Error");
|
||||
let start_pc = loader.elf_header.entrypoint;
|
||||
@ -404,7 +404,7 @@ mod test {
|
||||
|
||||
#[test]
|
||||
fn test_lock(){
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
let mut thread_manager = ThreadManager::new(true);
|
||||
let lock = Lock::new();
|
||||
let lock_id = thread_manager.get_obj_addrs().add_lock(lock);
|
||||
@ -430,7 +430,7 @@ mod test {
|
||||
#[test]
|
||||
fn test_semaphore_single() {
|
||||
// Init
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
let mut thread_manager = ThreadManager::new(true);
|
||||
let semaphore = Semaphore::new(1);
|
||||
let sema_id = thread_manager.get_obj_addrs().add_semaphore(semaphore);
|
||||
@ -457,7 +457,7 @@ mod test {
|
||||
fn test_semaphore_multiple() {
|
||||
// Init
|
||||
let mut tm = ThreadManager::new(true);
|
||||
let mut machine = Machine::new(true);
|
||||
let mut machine = Machine::new(true, get_debug_configuration());
|
||||
let semaphore = Semaphore::new(2);
|
||||
let sema_id = tm.get_obj_addrs().add_semaphore(semaphore);
|
||||
let thread1 = Rc::new(RefCell::new(Thread::new("test_semaphore_1")));
|
||||
|
Reference in New Issue
Block a user