Add section flag support, loader now ready to run binary files

This commit is contained in:
Quentin Legot
2023-04-01 00:14:09 +02:00
parent 0a744f0f94
commit 8239079130
3 changed files with 51 additions and 10 deletions

View File

@ -206,8 +206,8 @@ mod test {
#[ignore = "Pas encore terminé, contient des bugs"]
fn test_thread_context() {
let mut machine = Machine::init_machine();
loader::load("./test/riscv_instructions/simple_arithmetics/unsigned_addition", &mut machine, 0).expect("IO Error");
let start_pc = 0x1000;
let loader = loader::Loader::new("./test/riscv_instructions/simple_arithmetics/unsigned_addition", &mut machine, 0).expect("IO Error");
let start_pc = loader.elf_header.entrypoint;
let system = &mut System::default();
let thread1 = Thread::new("th1");