Presentation is loading. Please wait.

Presentation is loading. Please wait.

Process.

Similar presentations


Presentation on theme: "Process."— Presentation transcript:

1 Process

2 Program A program by itself is not a process. It is a static entity made up of program statement. Program contains the instructions to be executed by processor. A program takes a space at single place in memory and continues to stay there. A program does not perform any action by itself.

3 Process A process is a program in execution. The execution of a process must progress in a sequential fashion. A process is a dynamic entity. Definition of process is following: A process is defined as an entity which represents the basic unit of work to be implemented in the system.

4 Components of process are following.
1 Object Program Code to be executed. 2 Data Data to be used for executing the program. 3 Resources While executing the program, it may require some resources. 4 Status Verifies the status of the process execution. A process can run to completion only when all requested resources have been allocated to the process.

5 Process Control Block, PCB
Each process is represented in the operating system by a process control block PCB also called a task control block. PCB is the data structure used by the operating system. Operating system groups all information that needs about particular process. PCB contains many pieces of information associated with a specific process which are described below. 1 Pointer Pointer points to another process control block. Pointer is used for maintaining the scheduling list. 2 Process State Process state may be new, ready, running, waiting and so on. 3 Program Counter Program Counter indicates the address of the next instruction to be executed for this process.

6 4 CPU registers CPU registers include general purpose register, stack pointers and accumulators etc. number of register and type of register totally depends upon the computer architecture. 5 Memory management information This information may include the value of base and limit registers, the page tables, or the segment tables depending on the memory system used by the operating system.This information is useful for deallocating the memory when the process terminates. 6 Accounting information This information includes the amount of CPU and real time used, time limits, job or process numbers, etc. General Purpose Registers. ... For example, when a program is interrupted its state, ie: the value of the registers such as the program counter, instruction register or memory address register - may be saved into the general purpose registers, ready for recall when the program is ready to start again. A stack pointer is a small register that stores the address of the last program request in a stack. A stack is a specialized buffer which stores data from the top down. As new requests come in, they "push down" the older ones.

7 Process control block includes CPU scheduling, I/O resource management, file management information etc.. The PCB serves as the repository for any information which can vary from process to process. Loader/linker sets flags and registers when a process is created. If that process get suspended, the contents of the registers are saved on a stack and the pointer to the particular stack frame is stored in the PCB. By this technique, the hardware state can be restored so that the process can be scheduled to run again.

8

9 Two State Process Model Two state process model refers to running and non-running states which are described below. 1 Running When new process is created by Operating System that process enters into the system as in the running state. 2 Not Running Processes that are not running are kept in queue, waiting for their turn to execute. Each entry in the queue is a pointer to a particular process. Queue is implemented by using linked list. Use of dispatcher is as follows. When a process is interrupted, that process is transferred in the waiting queue. If the process has completed or aborted, the process is discarded. In either case, the dispatcher then selects a process from the queue to execute.

10

11 Five States Process Model
As a process executes, it changes state. The state of a process is defined as the current activity of the process. Process can have one of the following five states at a time. 1 New The process is being created. 2 Ready The process is waiting to be assigned to a processor. Ready processes are waiting to have the processor allocated to them by the operating system so that they can run. 3 Running Process instructions are being executed i. e. The process that is currently being executed. 4 Waiting The process is waiting for some event to occur such as the completion of an I/O operation. 5 Terminated The process has finished execution.

12

13 Thanks

14 General purpose registers in 8086 microprocessor

15 1. AX – This is the accumulator
1.AX – This is the accumulator. It is of 16 bits and is divided into two 8-bit registers AH and AL to also perform 8-bit instructions. It is generally used for arithmetical and logical instructions but in 8086 microprocessor it is not mandatory to have accumulator as the destination operand. Example: ADD AX, AX (AX = AX + AX) BX – This is the base register. It is of 16 bits and is divided into two 8-bit registers BH and BL to also perform 8-bit instructions. It is used to store the value of the offset. MOV BL, [500] (BL = 500H)

16 3. CX – This is the counter register
3. CX – This is the counter register. It is of 16 bits and is divided into two 8-bit registers CH and CL to also perform 8-bit instructions. It is used in looping and rotation. Example: MOV CX, 0005 LOOP 4. DX – This is the data register. It is of 16 bits and is divided into two 8-bit registers DH and DL to also perform 8-bit instructions. It is used in multiplication an input/output port addressing. Example: MUL BX (DX, AX = AX * BX) 5. SP – This is the stack pointer. It is of 16 bits. It points to the topmost item of the stack. If the stack is empty the stack pointer will be (FFFE)H. It’s offset address relative to stack segment. 6. BP – This is the base pointer. It is of 16 bits. It is primary used in accessing parameters passed by the stack. It’s offset address relative to stack segment. 7. SI – This is the source index register. It is of 16 bits. It is used in the pointer addressing of data and as a source in some string related operations. It’s offset is relative to data segment. 8. DI – This is the destination index register. It is of 16 bits. It is used in the pointer addressing of data and as a destination in some string related operations. It’s offset is relative to extra segment.


Download ppt "Process."

Similar presentations


Ads by Google