1
0
forked from Rativel/BurritOS

try to implement join

This commit is contained in:
Quentin Legot
2023-04-23 15:11:06 +02:00
parent 1055e6a0ac
commit a211e93905
8 changed files with 79 additions and 31 deletions

View File

@@ -278,7 +278,7 @@ fn sc_new_thread(machine: &mut Machine, system: &mut System) -> Result<MachineOk
};
let current_thread = current_thread.borrow_mut();
if let Some(process) = current_thread.get_process_owner() {
system.get_thread_manager().start_thread(n_thread, Rc::clone(&process), func as u64, current_thread.thread_context.int_registers[2] as u64, args);
system.get_thread_manager().start_thread(n_thread, Rc::clone(&process), func as u64, current_thread.thread_context.int_registers[2] as u64 + machine.page_size, args);
// TODO changé la valeur de sp quand on supportera les addresses virtuels
machine.write_int_register(10, tid as i64);
Ok(MachineOk::Ok)
@@ -316,10 +316,9 @@ fn get_length_param(addr: usize, machine: & Machine) -> usize {
let mut c = 1;
while c != 0 {
c = machine.read_memory(1, addr + i);
i +=1;
i += 1;
}
println!("addr: {:x}, i: {}", addr, i + 1);
i + 1
}
@@ -334,7 +333,6 @@ fn get_string_param(addr: usize, maxlen: usize, machine: &Machine) -> Vec<char>
dest.push(c as char);
i += 1;
}
dest.push('\0');
dest
}