diff options
author | Benji Dial <benji6283@gmail.com> | 2020-09-13 19:51:09 -0400 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2020-09-13 19:51:09 -0400 |
commit | 143156f63e2448733f1a35a74e629fe0ae9bb567 (patch) | |
tree | bcf70a6940038986da2cfb2d6ed380ed8ebb91de /src/kernel/idt.c | |
parent | 54101cf327b7def90636babbadbb66ce697298ee (diff) | |
download | portland-os-143156f63e2448733f1a35a74e629fe0ae9bb567.tar.gz |
have command shell block while commands are running
Diffstat (limited to 'src/kernel/idt.c')
-rw-r--r-- | src/kernel/idt.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/kernel/idt.c b/src/kernel/idt.c index b789d42..4ffa1e2 100644 --- a/src/kernel/idt.c +++ b/src/kernel/idt.c @@ -54,11 +54,11 @@ static uint32_t sc_file_read(uint32_t handle, uint32_t file_offset, uint32_t cou return count; } -static bool sc_start_task(uint32_t drive_number, char *path, const char *pass) { +static uint32_t sc_start_task(uint32_t drive_number, char *path, const char *pass) { switch_to_kernel_cr3(); - bool result = try_elf_run(drives + drive_number, vma_to_pma(active_task->page_directory, path), pass); + uint32_t process_id = try_elf_run(drives + drive_number, vma_to_pma(active_task->page_directory, path), pass); switch_to_task_cr3(); - return result; + return process_id; } static void *sc_allocate_ram(uint32_t pages) { @@ -91,6 +91,11 @@ static uint32_t sc_memory_info(enum mi_arg arg) { } } +static void sc_wait_for_task(uint32_t handle) { + active_task->wait_mode = PROCESS_END; + active_task->wait_arg = handle; +} + void const *syscall_table[] = { &sc_open_file, &sc_close_file, @@ -100,7 +105,8 @@ void const *syscall_table[] = { &logsz, &get_key_code, &sc_allocate_ram, - &sc_memory_info + &sc_memory_info, + &sc_wait_for_task }; //these aren't really void ()'s, but gcc complains if we take an address of a void, so we give it a type |