What is the Process in Operating SystemsIn this tutorial, we are going to learn about the Process in Operating Systems. This is the most important concept of the Operating Systems. This is very important because we would be always busy listening the word named Process everywhere in the subject named Operating System. The main duty or the work of the Operating System is to complete the given process in less than the given stipulated time. So, the term process is very important for the subject named Operating Systems. Now, let us learn everything about the term process in a very deep manner. Definition of ProcessBasically, a process is a simple program. An active program which running now on the Operating System is known as the process. The Process is the base of all computing things. Although process is relatively similar to the computer code but, the method is not the same as computer code. A process is a "active" entity, in contrast to the program, which is sometimes thought of as some sort of "passive" entity. The properties that the process holds include the state of the hardware, the RAM, the CPU, and other attributes. Process in an Operating SystemA process is actively running software or a computer code. Any procedure must be carried out in a precise order. An entity that helps in describing the fundamental work unit that must be implemented in any system is referred to as a process. In other words, we create computer programs as text files that, when executed, create processes that carry out all of the tasks listed in the program. When a program is loaded into memory, it may be divided into the four components stack, heap, text, and data to form a process. The simplified depiction of a process in the main memory is shown in the diagram below. ![]() StackThe process stack stores temporary information such as method or function arguments, the return address, and local variables. Heap This is the memory where a process is dynamically allotted while it is running. Text This consists of the information stored in the processor's registers as well as the most recent activity indicated by the program counter's value. Data In this section, both global and static variables are discussed. ProgramProgram is a set of instructions which are executed when the certain task is allowed to complete that certain task. The programs are usually written in a Programming Language like C, C ++, Python, Java, R, C # (C sharp), etc. A computer program is a set of instructions that, when carried out by a computer, accomplish a certain task Difference between process and the program
Process Control BlockAn Operating System helps in process creation, scheduling, and termination with the help of Process Control Block. The Process Control Block (PCB), which is part of the Operating System, aids in managing how processes operate. Every OS process has a Process Control Block related to it. By keeping data on different things including their state, I/O status, and CPU Scheduling, a PCB maintains track of processes. Now, let us understand the Process Control Block with the help of the components present in the Process Control Block. A Process Control Block consists of :
Now, let us understand about each and every component in detail now. 1) Process ID It is a Identification mark which is present for the Process. This is very useful for finding the process. It is also very useful for identifying the process also. 2) Process State ![]() Now, let us know about each and every process states in detail. Let me explain about each and every state i) New State A Program which is going to be taken up by the Operating System directly into the Main Memory is known as a New Process State ii) Ready State The ready state, when a process waits for the CPU to be assigned, is the first state it enters after being formed. The operating system pulls new processes from secondary memory and places them all in main memory. The term "ready state processes" refers to processes that are in the main memory and are prepared for execution. Numerous processes could be active at the moment. iii) Running State The Operating System will select one of the processes from the ready state based on the scheduling mechanism. As a result, if our system only has one CPU, there will only ever be one process operating at any given moment. We can execute n processes concurrently in the system if there are n processors. iv) Waiting or Blocking State Depending on the scheduling mechanism or the inherent behavior of the process, a process can go from the Running state to the Block or Wait states. The OS switches a process to the block or wait state and allots the CPU to the other processes while it waits for a specific resource to be allocated or for user input. v) Terminated State A process enters the termination state once it has completed its execution. The operating system will end the process and erase the whole context of the process (Process Control Block). 3) Program Counter The address of the following instruction to be executed from memory is stored in a CPU register called a program counter (PC) in the computer processor. It is a digital counter required for both task execution speed and for monitoring the present stage of execution. An instruction counter, instruction pointer, instruction addresses register, or sequence control register are other names for a program counter. 4) CPU Registers When the process is in a running state, here is where the contents of the processor registers are kept. Accumulators, index and general-purpose registers, instruction registers, and condition code registers are the many categories of CPU registers. 5) CPU Scheduling Information It is necessary to arrange a procedure for execution. This schedule determines when it transitions from ready to running. Process priority, scheduling queue pointers (to indicate the order of execution), and several other scheduling parameters are all included in CPU scheduling information. 6) Accounting and Business Information The State of Business Addressing and Information includes information such as CPU use, the amount of time a process uses in real time, the number of jobs or processes, etc. 7) Memory Management Information The Memory Management Information section contains information on the page, segment tables, and the value of the base and limit registers. It relies on the operating system's memory system. 8) Input Output Status Information This Input Output Status Information section consists of Input and Output related information which includes about the process statuses, etc.
Next TopicKernel Memory Allocation
|