Expand description
Task management implementation
Everything about task management, like starting and switching tasks is implemented here.
A single global instance of TaskManager called TASK_MANAGER controls
all the tasks in the operating system.
Be careful when you see __switch ASM function in switch.S. Control flow around this function
might not be what you expect.
Modules§
- context 🔒Implementation of
TaskContext - switch 🔒Rust wrapper around
__switch. - task 🔒Types related to task management
Structs§
- Global variable: TASK_MANAGER
- task context structure containing some registers
- The task control block (TCB) of a task.
- The task manager, where all the tasks are managed.
- Inner of Task Manager
Enums§
- The status of a task
Functions§
- Exit the current ‘Running’ task and run the next task in task list.
- Change the status of current
Runningtask intoExited. - Change the status of current
Runningtask intoReady. - Run the first task in task list.
- Switch current
Runningtask to the task we have found, or there is noReadytask and we can exit with all applications completed - Suspend the current ‘Running’ task and run the next task in task list.