diff --git a/kernel/main.asm b/kernel/main.asm index 6784670..863249b 100644 --- a/kernel/main.asm +++ b/kernel/main.asm @@ -84,8 +84,9 @@ draw_startup_text: ; when the startup file yields for the first time, we'll end up back here ; jump back to it without adding this "task" (not really a task) into the queue + ; end_current_task_no_mark is used specifically because it doesn't mark the current task (still set to 0) as unused ; this does not return - call end_current_task + call end_current_task_no_mark startup_error: mov r0, BACKGROUND_COLOR diff --git a/kernel/task.asm b/kernel/task.asm index 564ccb9..8f83e74 100644 --- a/kernel/task.asm +++ b/kernel/task.asm @@ -43,13 +43,14 @@ yield_task: ; outputs: ; none end_current_task: - cmp [task_queue_ptr], task_queue_bottom - ifz jmp task_empty - mov r0, current_task ; get the current task struct call task_load bcl [task_id_bitmap], r2 ; mark this task ID as unused +end_current_task_no_mark: pop r0 ; pop the return address off of the stack + + cmp [task_queue_ptr], task_queue_bottom + ifz jmp task_empty yield_task_0: mov r0, task_queue_bottom call task_load