Operating Systems: Safe Mode, Scheduling, and Process Management
Operating System Safe Mode and Troubleshooting
- Safe mode is a specialized setting that users can navigate to when experiencing issues with their operating system.
- Symptoms requiring Safe Mode use:
- Applications failing to load correctly.
- The operating system being unable to turn on or start up normally.
- The operating system begins loading but reaching a point where it is unable to continue.
- Inability to access the desktop or interact with the computer interface. - Windows Visual Example: The operating system may display a loading icon that keeps "turning and turning and turning" without ever fully launching.
- Accessing Safe Mode: The process typically involves turning off the computer and pressing specific "key combinations" to enter the mode.
- Technical Definition of Safe Mode:
- It represents the kernel or the "core" of the operating system.
- In this mode, all user-level applications are intentionally not loaded. - Troubleshooting Function: Because only the core kernel is active, the safe mode allows a user to check which specific application is malfunctioning or preventing the system from starting.
Concepts of Scheduling and Multitasking
- The operating system manages performance by alternating between different tasks so rapidly that the user does not perceive the transition.
- Sequential Execution Example:
- Imagine a scenario where a computer is playing both a movie and music.
- The system plays the movie for a duration of 1s.
- It then switches to play the music for the next 1s.
- This pattern of "one one one" (alternating seconds) continues. - The "Music and Game" Scenario:
- The cycle follows a repetitive sequence: Music $\rightarrow$ Game $\rightarrow$ Music $\rightarrow$ Game $\rightarrow$ Music $\rightarrow$ Game.
- The speed of this transition is so great that the user will "not feel it," meaning they do not notice the CPU leaving the music process to handle the game process. - Terminology: This management of process timing is known as "scheduling."
Definitions and Examples of Processes
- A process is any active task the CPU is working on at a given point in time.
- Examples of vital processes:
- Screen Display: The act of displaying images/text on the screen is a process required to keep the computer "alive."
- Network Communication: If using the Internet or a network, the "communication of packets to and from your computer system" is categorized as a process. - Constant CPU Activity: At any given moment, the Central Processing Unit (CPU) is actively engaged in performing a task.
Process States and Transitions
- Ready to Running Transition:
- This occurs immediately when the CPU becomes available.
- The process gains access to the CPU and moves from the "ready state" to the "running state." - Running to Waiting Transition:
- A process moves from the running state to the "waiting state" when it requires Input/Output (IO) operations.
- Examples of IO triggers include using a keyboard or reading from handwriting.
- The process remains in the waiting state for the "interruption or the interrupt to finish" before it can transition back to the running state. - Completion: Once the process finishes all assigned activities, it is handled by the process manager to exit the running state.
Scheduling, Context Switching, and the Process Control Block (PCB)
- Context Switching: Defined as the act of scheduling a process, which involves changing the "active PCB" that the CPU is pointing to.
- Process Control Block (PCB):
- The PCB is the tool used by the operating system to record the state of a specific process. - Data Recorded in the PCB:
- It records that a user process is currently suspended.
- It records the intention that the process "will be resumed" later. - Efficiency of the PCB: The operating system is designed to save "only what is necessary" within the PCB to optimize system resources while ensuring the process can be successfully restarted.