Module os1::process
[−]
[src]
A module for process management
Reexports
use core::prelude::v1::*; |
use alloc::boxed::Box; |
use core::fmt::{Debug, Formatter, Result}; |
use core::sync::atomic::{AtomicUsize, Ordering}; |
use fs::ROOT_FS; |
use interrupts::{esp0, on, off}; |
use io::NonBlockingBuffer; |
use machine::{self, context_switch}; |
use memory::AddressSpace; |
use static_linked_list::StaticLinkedList; |
use self::context::KContext; |
use self::idle::IDLE_PROCESS; |
use self::proc_table::PROCESS_TABLE; |
Modules
context |
A module for saving a process's context |
focus |
A module for process focus |
idle |
A module for the idle process, a process that runs when there is nothing else left to do. |
init |
A module for the init process |
proc_table |
A module for the process table, a table mapping each PID to a process struct |
ready_queue |
A module for the ready queue |
reaper |
A module for the reaper process, a process which frees the resources of dead processes. |
user |
A module for user processes |
Structs
Process |
Represents a single process, its identity, resources, etc. |
Enums
CF |
An enum representing change of directory |
State |
An enum representing the possible states of a process |
Constants
STACK_SIZE |
Size of a kernel stack (number of words) |
Statics
CURRENT_PROCESS |
The current running process if there is one |
NEXT_ID |
The next available PID |
Functions
_proc_yield |
The unsafe function that does the actual work of choosing the next process and switching to it. |
exit |
Called by the current process to exit with the given exit code |
init |
Initialize the process subsystem. This creates the init, idle, and reaper processes, but does not start any of them yet. |
proc_yield |
A safe wrapper around machine::proc_yield. |
start_proc |
The entry point of all processes |
Type Definitions
ProcessQueue |
Type alias for a queue of Processes |