Implement the sleep syscall for tasks. Most of the work is done. We only need a data structure in the scheduler that keep track of the remaining time of each sleep task. Once a task has sleep for long enough, it can be put back into its run queue (maybe using task->wake()).
Implement the
sleep
syscall for tasks. Most of the work is done. We only need a data structure in the scheduler that keep track of the remaining time of each sleep task. Once a task has sleep for long enough, it can be put back into its run queue (maybe usingtask->wake()
).To keep track of remaining time, one could use delta queues. See https://learn.osdev.org/Blocking_Process, section Sleeping.