Module os::task

source · []
Expand description

Implementation of process management mechanism

Here is the entry for process scheduling required by other modules (such as syscall or clock interrupt). By suspending or exiting the current process, you can modify the process state, manage the process queue through TASK_MANAGER, and switch the control flow through PROCESSOR.

Be careful when you see __switch. Control flow around this function might not be what you expect.

Re-exports

pub use crate::syscall::process::TaskInfo;
pub use task::TaskControlBlock;
pub use task::TaskStatus;
pub use context::TaskContext;
pub use manager::add_task;
pub use pid::pid_alloc;
pub use pid::KernelStack;
pub use pid::PidHandle;
pub use processor::current_task;
pub use processor::current_trap_cx;
pub use processor::current_user_token;
pub use processor::run_tasks;
pub use processor::schedule;
pub use processor::take_current_task;

Modules

Implementation of TaskContext

Implementation of TaskManager

Task pid implementation.

Implementation of Processor and Intersection of control flow

Rust wrapper around __switch.

Types related to task management & Functions for completely changing TCB

Structs

Creation of initial process

Functions

Exit current task, recycle process resources and switch to the next task

Make current task suspended and switch to the next task