2. Process Management
• Program
Program is a set of instruction that a computer can execute to perform specific
task.
• Process
A process is a program that is currently being executed. A process is made up of
the program code, the program counter, and the resources allocated by the OS.
• Process Management
Process management is the process of administering processes in a computer
system. It includes activities like creating, scheduling, terminating, and
synchronizing processes.
3. Different between program and process
program
• The program contains a set of
instructions designed to
complete a specific task.
• A program is a passive entity as
it resides in the secondary
memory.
• A program is a static entity.
process
• The process is an instance of an
executing program.
• The process is an active entity
as it is created during execution
and loaded into the main
memory.
• The process is a dynamic entity.
4. Memory lay out process
In computer systems, memory is divided into different segments
or sections, each serving a specific purpose. This division is crucial
for efficient program execution and resource management.
• Stack: Used for dynamic memory allocation during program
execution. Grows downwards in memory. Stores function call
frames, local variables, and return addresses.
• Heap :Used for dynamic memory allocation during program
execution. Grows upwards in memory. Provides more flexible
memory allocation than the stack. Requires manual memory
management
5. Data Segment: Divided into two sub-segments:
Initialized Data Segment (Data Segment): Stores global and static
variables that have been assigned initial values in the program.
Text Segment (Code Segment): Stores the
executable code of the program, including instructions and
constants. Read-only to prevent accidental modification of the
program code during execution.
6. Process life cycle
The process life cycle in an operating system refers to the stages a process goes
through during its execution. The key states in a process life cycle include:
7. New: The process is created
Ready: The process is waiting to be assigned a processor
Running: The process's instructions are being executed by
the processor
Waiting: The process is waiting for an event to occur, such
as a signal or I/O completion
Terminated: The process has finished execution or been
terminated by the OS
8. PCB
A Process Control Block is a data structure
maintained by the operating system for every
process. It contains all the information about a
process that is needed to manage it effectively.
A Process Control Block (PCB) stores
information about a process in an operating
system.
9. Attributes of pcb
• Process ID: A unique identifier for each process
• Process state: The current state of the process
• Program counter: The program counter for the process
• Priority: The priority of the process
• General purpose registers: The general purpose registers for the
process
10. conclusion
• The Process Table and PCB are important for managing processes in
an operating system. The Process Table keeps a list of all active
processes, and the PCB holds details about each process. The PCB
enables smooth process switching, effective multitasking, and
efficient resource allocation.