feature/nikocs/smaller_init_system #6
1 changed files with 9 additions and 7 deletions
|
|
@ -187,14 +187,16 @@ fn attempt_run_file(env: &Environment<'_>, name: &str) {
|
|||
current_directory_path: CURRENT_DIR_PATH.load(Ordering::Relaxed) as usize,
|
||||
current_directory_path_len: CURRENT_DIR_PATH_LEN.load(Ordering::Relaxed),
|
||||
};
|
||||
// fixme: turntable task needs to exit, but it owns the environment memory.
|
||||
// fixme: we need to somehow pass the environment to the task, and have it free the memory
|
||||
|
||||
let mut task_setup = liblbos::TaskSetup {
|
||||
epc: 0,
|
||||
stack_block_count: 8,
|
||||
ddi_first_addr: 0,
|
||||
ddi_size: 0,
|
||||
environment: &e as *const _ as usize,
|
||||
wait_for_task_exit: true,
|
||||
environment: 0,
|
||||
wait_for_task_exit: false,
|
||||
};
|
||||
|
||||
if liblbos::ktask::ktask_loadddifile(buf, size, &mut task_setup as *mut _ as usize) != 0 {
|
||||
|
|
@ -207,11 +209,11 @@ fn attempt_run_file(env: &Environment<'_>, name: &str) {
|
|||
|
||||
liblbos::syscalls::create_task(task_setup);
|
||||
|
||||
// yeah we're extending its lifetime
|
||||
#[allow(clippy::drop_non_drop)]
|
||||
drop(e);
|
||||
|
||||
println("\ntask exited\n");
|
||||
if CURRENT_DIR_PATH.load(Ordering::Relaxed) as usize != 0 {
|
||||
// free
|
||||
liblbos::syscalls::free_blocks(CURRENT_DIR_PATH.load(Ordering::Relaxed) as usize, CURRENT_DIR_PATH_LEN.load(Ordering::Relaxed).div_ceil(512));
|
||||
}
|
||||
liblbos::syscalls::exit();
|
||||
}
|
||||
|
||||
fn execute(cmd: &str, environment: &mut Environment<'_>) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue