fox32os: Don't mark task 0 as unused when yielding for the first time

main
Ry 2022-05-21 17:04:39 -07:00
parent 1da623ce18
commit 3237db9aac
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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