diff options
author | Marvin Borner | 2020-02-15 16:57:57 +0100 |
---|---|---|
committer | Marvin Borner | 2020-02-15 16:57:57 +0100 |
commit | f5b995586e28f7db426f4707a4348dc067df41c0 (patch) | |
tree | 37bfd54a3ecbe6dca0b2c4530dd28d3177c98362 /src/kernel/tasks | |
parent | 7ec74159de339baf3687bc59f1c18309b23ef36b (diff) |
Quite many improvements
ok.
Diffstat (limited to 'src/kernel/tasks')
-rw-r--r-- | src/kernel/tasks/task.c | 10 | ||||
-rw-r--r-- | src/kernel/tasks/task.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/kernel/tasks/task.c b/src/kernel/tasks/task.c index e6caf9a..5451288 100644 --- a/src/kernel/tasks/task.c +++ b/src/kernel/tasks/task.c @@ -4,6 +4,7 @@ #include <kernel/lib/lib.h> #include <kernel/gdt/gdt.h> #include <kernel/system.h> +#include <kernel/syscall.h> volatile task_t *current_task; volatile task_t *ready_queue; @@ -22,7 +23,8 @@ void tasking_install() current_task = ready_queue = (task_t *) kmalloc(sizeof(task_t)); current_task->id = (int) next_pid++; - current_task->esp = current_task->ebp = 0; + current_task->esp = 0; + current_task->ebp = 0; current_task->eip = 0; current_task->page_directory = current_directory; current_task->next = 0; @@ -98,7 +100,8 @@ void switch_task() set_kernel_stack(current_task->kernel_stack + KERNEL_STACK_SIZE); - perform_task_switch(eip, current_directory->physicalAddr, ebp, esp); + paging_switch_directory(current_directory); + perform_task_switch(eip, current_directory->physical_address, ebp, esp); } int fork() @@ -143,7 +146,7 @@ int getpid() return current_task->id; } -void switch_to_usermode(uint32_t binary) +void exec(uint32_t binary) { set_kernel_stack(current_task->kernel_stack + KERNEL_STACK_SIZE); @@ -163,6 +166,5 @@ void switch_to_usermode(uint32_t binary) pushl $0x1B; \ push %0; \ iret; \ - 1: \ " : : "r" (binary)); }
\ No newline at end of file diff --git a/src/kernel/tasks/task.h b/src/kernel/tasks/task.h index 97aeb15..60047eb 100644 --- a/src/kernel/tasks/task.h +++ b/src/kernel/tasks/task.h @@ -25,6 +25,6 @@ void move_stack(void *new_stack_start, uint32_t size); int getpid(); -void switch_to_usermode(uint32_t); +void exec(uint32_t binary); #endif |