Lecture 1.2
CO2101 Operating Systems and Networking
Overview of Operating Systems
Fundamental Role of an OS:
Provides abstraction for user processes.
Manages system resources efficiently.
Key Concepts Defining Processes
Definition of Process:
A process is a running instance of a program.
OS responsibilities include:
Creation, execution, suspension, and termination of processes.
Allocation of resources (e.g., CPU, memory).
Virtualization Concepts
Purpose of Virtualization:
Ensures each process is secured and has exclusive access to resources.
Efficiently manages system resources to boost performance.
Importance of CPU and memory virtualization.
Process Creation and Management
Process Lifecycle:
Creation:
Programs are stored in executable form on disk.
Loaded into memory when execution is needed.
Stack and heap allocated for data storage.
Execution:
CPU must execute the program from memory, not directly from the disk.
Managing Multiple Processes
Concurrency and Resource Management:
OS allows multiple processes to run seemingly simultaneously through:
Context switching between processes.
Prioritizing resources to minimize idle CPU time.
CPU Virtualization
Efficient CPU Sharing:
The OS uses CPU time slicing to give the illusion of simultaneous execution.
Processes may be suspended and resumed rapidly.
Process States
Running:
The process is actively using the CPU.
Ready:
The process awaits CPU allocation.
Blocked:
The process is waiting for an I/O operation or resource.
Context Switching
Definition:
Transitioning a process between states (scheduled / de-scheduled).
Rapid performance required by the OS for efficiency.
Saving Process State:
Key components of the process state:
Instruction counter
CPU registers
Memory contents
Importance of not saving entire memory to avoid inefficiencies.
Other Process States
Initial State:
Process is in the loading phase.
Final State (Zombie State):
Process has completed execution but is not yet removed from the system.
Spawning Processes:
Child processes created for specific tasks (e.g. handling input while rendering).
Summary of Key Topics
Resources in a system.
Definition of a process.
Functions of an OS in process management.
Lifecycle stages of a process.
Dynamics of context switching.