The OS decides the best way to swap between running, runnable and waiting processes. It controls which process is being executed by the CPU at any point in time, and shares access to the CPU between processes. The job of working out when to swap processes is known as scheduling.
Why does the OS need to manage the processor?
The operating system’s most important job is managing the CPU: If there are multiple programs that must execute, then it is a disaster if one program uses the processor and “loops. ” The OS must ensure that all programs have fair use of the processor’s time so that all programs make progress at execution.
How does an operating system manage devices?
The OS uses programs called device drivers to manage connections with peripherals. A device driver: handles the translation of requests between a device and the computer. defines where a process must put outgoing data before it can be sent, and where incoming messages will be stored when they are received.