Please enable JavaScript.
Coggle requires JavaScript to display documents.
Process Description and Control (OS Control Tables (Memory Tables …
Process Description and Control
Definition
Execution
Running program
Development
Multiprogramming
Time sharing
Real time transaction systems
Errors
Improper synchronization
Failed mutual exclution
Nondeterminate program
Deadlocks
Components
Executable program
Associated data
Execution context
Elements
Program Code
Set of data associated with code
Characteristic
Identidier
State
Priority
Program counter
Memory pointers
Context data
I/O status
Accounting information
States
Trace
Dispatcher
Two-State Process
Running
Not-running
Creation
Process Spawning
Parent Process
Child Process
Termination
-Two-State Process
-Five-State Process
To indicate its completion
A batch job should include HALT instruction
Reasons
Normal completion
Time limit exceesed
Memory unavailable
Bounds violation
Protection error
Arithmetic error
Time overrun
I/O failure
Invalid instruction
Privileged instruction
Data misuse
OS intervention
Parent termination
Parent request
Queues
Single blocked queue
Multiple blocked queue
Suspended
One Suspended Stare
Two Suspended State
Swapping
Moving part or all process from main memory to disk
Commonly in systems that had no virtual memory
Characteristics
Not immediately available for execution
May or may not be waiting
Placed by an agent
May not be removed
Reasons
Swapping
OS reason
Interactive user request
Timing
Parent process request
OS Control Tables
Memory Tables
Allocation of main and secondary memory to processes
Protection attributes
Information needed
I/O Tables
OS use to manage the I/O devices and channels
Assigned to a particular process
File Tables
Information maintained and used by a file management system
Process Tables
Maintained to manage processes
Reference to memory, I/O and file tables
Represented by a process image
Process Control Structure
Process Components
Include a program or many program to be executed
Consist at least sufficient memory to hold program and data
Execution of a program typically involves
Process Attributes
Associated with a number of attributes used by OS
Collection of program, data, stack and attributes as the process image
Process image location will depend on the memory management
Identification
Each process assigned a unique numeric identifier
Many of the tables controlled by OS may use identifier
Memory tables may be organized
Process identifier informs OS of the destination
identifiers indicate the parent and descendents of each process
State Information
Consists of the contents of processor registers
User-visible register
Control and status register
Stack pointers
Program Status Word
Condition codes plus other status infomation
EFLAGS register used by OS running on x86 processor
Control Information
Most important data structure in an OS
Difficulty is not access, but protection
Execution
Modes of execution
User Mode
System Mode
User Mode
Less-privileged mode
System Mode
More-privileged mode
Kernel Mode
Kernel of the operating system
System Interrupts
Interrupt
Clock interrupt
I/O interrupt
Memory fault
Time slice
Trap
Error or exception condition generated currently running process
OS determines if the condition is fatal
Mode Switching
No interrupts
Proceeds to the fetch stage and fetch the next instruction
Interrupts
Set the program to counter
switches from user mode to kernel mode
Mode switch can take place without changing the state of executing process
OS may decide a mode switch is needed or not
Unix SVR4
Process States
User Running
Kernel Running
Ready to Run in Memory
Asleep in Memory
Ready to Run Swapped
Preempted
Created
-Zombie
UNIX Process
Process status
Pointers
Process size
User identifiers
Process identifiers
Event descriptor
Priority
Signal
Timers
P_link
Memory status
Process Creation
Using kernel mode
After Creation
Kernel can do one of the following :-
Stay in the parent process
Transfer control to the child process
Transfer control to another process