0% found this document useful (0 votes)
11 views3 pages

OS Shortnotes Module1

Download as pdf or txt
0% found this document useful (0 votes)
11 views3 pages

OS Shortnotes Module1

Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

Difference between multiprogramming and Timesharing

Process:
A process is a program in execution. A process needs
certain resources- such as CPU time, memory, files and
I/O devices – to accomplish its task. These resources are
allocated to the process either when it is created or while
it is running.

Process states
As process executes, it changes state. The state of a
process is defined by current activity of that process.
Each process may in one of the following states.
1. New- The process is being created.
2. Running- Instructions are being executed.
3. Waiting- The process is waiting for some event to
occur(such as an I/O completion etc.)
4. Ready- The process is waiting to be assigned to the
processor
5. Terminated- The process has finished its execution.

Process state diagram


Process Control Block
Each process is represented in the operating system by a
process control block(PCB). A process control block
contains pieces of information associated with a specific
process.
It includes
1. process identifier- A unique identifier associated with
each process, to distinguish it from all other
processes.
2. priority-priority level relative to other processes.
3. Process state- The state may be new, ready, running,
waiting, and so on.
4. Program counter- The counter indicates the address
of the next instruction to be executed for this process.
5. CPU registers- The registers may include
accumulators, index registers, stack pointers,
condition-code information.
6. CPU scheduling information- This information
includes a process priority, pointers to scheduled
queues etc.
7. Memory management information- This information
include such as value of base and limit registers, page
and segment tables etc.
8. Accounting information- This information includes the
amounts of CPU time used, process numbers etc
9. I/O status information- The information includes the
list of I/O devices allocated to this process, list of open
files etc.

Trap or exception
A trap or exception is software-generated interrupt
caused either by error(for ex: division by zero or
invalid memory access) or by specific request from a
user program that an OS to be performed.

You might also like