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

Module 2 OS

The document outlines the various states of a process in an operating system, including New, Ready, Running, Waiting, and Terminated, along with transitions between these states. It details the information stored in a Process Control Block (PCB), such as process state, program counter, CPU registers, and I/O status information. Additionally, it explains the role of the PCB in context switching, enabling multitasking by saving and loading process data.

Uploaded by

SAI SRIKAR G
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Module 2 OS

The document outlines the various states of a process in an operating system, including New, Ready, Running, Waiting, and Terminated, along with transitions between these states. It details the information stored in a Process Control Block (PCB), such as process state, program counter, CPU registers, and I/O status information. Additionally, it explains the role of the PCB in context switching, enabling multitasking by saving and loading process data.

Uploaded by

SAI SRIKAR G
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PROCESS STATES

1. New

Process is being created and loaded into memory.​


➡ Goes to Ready

2. Ready

Process is ready and waiting for CPU in the ready queue.​


➡ CPU assigned → Running

3. Running

Process instructions are being executed by CPU.​


May move to:

●​ Ready → Interrupt / time slice over​

●​ Waiting → I/O request​

●​ Terminated → Execution finished​

4. Waiting (Blocked)

Process is waiting for I/O or an event.​


➡ I/O complete → Ready

5. Terminated

Process has finished execution and is removed from memory.


Information Stored in PCB
1️⃣ Process State

●​ New, Ready, Running, Waiting, Terminated

2️⃣ Program Counter (PC)

●​ Address of the next instruction to execute

3️⃣ CPU Registers

●​ Accumulator, Index registers, Stack pointer, General-purpose registers​

●​ Needed to continue execution correctly

4️⃣ CPU Scheduling Information

●​ Process priority​

●​ Pointers to scheduling queues

5️⃣ Memory Management Information

●​ Base and limit registers​

●​ Page table or segment table details

6️⃣ Accounting Information

●​ CPU time used​

●​ Process ID, job number, time limits

7️⃣ I/O Status Information

●​ List of open files​

●​ I/O devices allocated

🔁 Role of PCB in Context Switching


During a context switch:

1.​ OS saves current process data into its PCB​

2.​ OS loads another process’s PCB​

3.​ That process resumes from where it stopped


➡ PCB makes multitasking possible​

You might also like