Day 01Part 08- Operating system lecture for gate for computer science – Attributes of Processes.

Day 01Part 08- Operating system lecture for gate for computer science – Attributes of Processes.



play-rounded-fill play-rounded-outline play-sharp-fill play-sharp-outline
pause-sharp-outline pause-sharp-fill pause-rounded-outline pause-rounded-fill
00:00

 Attributes of Processes – Operating System (GATE CS Lecture)

A process in an Operating System (OS) is an instance of a program in execution. Every process has certain attributes that help the OS manage and schedule it efficiently.

 What is a Process?

A process is a program in execution, consisting of:
Program Code (Text Section) – The instructions to be executed.
Program Counter (PC) – Stores the next instruction to execute.
Stack – Contains function calls, return addresses, and local variables.
Heap – Dynamic memory allocation (e.g., malloc in C).
Data Section – Global variables and static data.

 Attributes of a Process

Each process has a unique set of attributes stored in the Process Control Block (PCB).

1. Process ID (PID)

  • A unique identifier assigned to each process.
  • Used by the OS to track and manage processes.

2. Process State

A process can be in one of the following states:
New – Process is being created.
Ready – Waiting for CPU time.
Running – Currently executing on the CPU.
Waiting (Blocked) – Waiting for I/O or other resources.
Terminated – Process has finished execution.

Example: If a process is waiting for input from the keyboard, it moves to the Waiting state.

3. Program Counter (PC)

  • Holds the memory address of the next instruction to execute.
  • OS uses it to resume a process after an interruption.

4. CPU Registers

  • Includes: General-purpose registers, stack pointers, and flags.
  • These store temporary data needed for execution.
  • OS saves and restores registers during context switching.

5. Memory Management Information

  • Defines how the process interacts with RAM.
  • Includes:
    Base and Limit Registers – Define memory boundaries.
    Page Tables – Used in virtual memory systems.
    Segment Tables – Used in segmentation memory management.

Example: If a process tries to access memory outside its boundary, the OS generates a segmentation fault.

6. Accounting Information

  • Stores process statistics like:
     CPU usage 
     Execution time 
    Process priority 
     Number of I/O operations performed

Example: The OS uses this data for scheduling and billing in time-sharing systems.

7. I/O Status Information

  • Tracks the files and devices used by the process.
  • Includes:
     List of open files 
     I/O device usage
  •  Network connections

Example: If a process is reading a file, it stays in the Waiting state until I/O is complete.

 Process Control Block (PCB)

All process attributes are stored in a data structure called the Process Control Block (PCB).

Attribute Description
Process ID (PID) Unique identifier for the process
Process State New, Ready, Running, Waiting, Terminated
Program Counter Address of the next instruction
CPU Registers Store temporary process data
Memory Management Info Page tables, base & limit registers
Accounting Info CPU time, priority, execution history
I/O Info Files and devices used by the process

The PCB is crucial for context switching between processes!

 Summary

 Every process has attributes stored in the Process Control Block (PCB).
 Key attributes include PID, Process State, Program Counter, CPU Registers, and Memory Information.
 The OS uses these attributes for scheduling, execution, and memory management.

Would you like GATE-level MCQs or more detailed notes on this?

Day 01Part 08- Operating system lecture for gate for computer science – Attributes of Processes.

OPERATING SYSTEMS LECTURE NOTES …

OPERATING SYSTEM

Operating System

Certainly! Let’s delve into the Attributes of Processes in Operating Systems, a fundamental topic for GATE Computer Science aspirants.


🧠 What is a Process?

A process is an active instance of a program in execution. It encompasses the program code, its current activity, and the resources allocated to it. Processes are managed by the operating system, which keeps track of their states and resources through a data structure known as the Process Control Block (PCB).(Testbook, GeeksforGeeks, Testbook)


📋 Key Attributes of a Process (Stored in PCB)

The PCB contains essential information that allows the operating system to manage and control processes effectively. Here are the primary attributes:(GeeksforGeeks)

  1. Process ID (PID): A unique identifier assigned to each process.(GeeksforGeeks)
  2. Process State: Indicates the current status of the process, such as:
    • New
    • Ready
    • Running
    • Waiting
    • Terminated(Wikipedia, GeeksforGeeks, Scribd, YouTube)
  3. Program Counter (PC): Holds the address of the next instruction to be executed for the process.(Wikipedia)
  4. CPU Registers: Stores the contents of all process-specific registers during execution.(BYJU’S)
  5. Memory Management Information: Details about memory allocation for the process, including pointers to segment or page tables.
  6. Accounting Information: Includes data like the amount of CPU used, time limits, and job or process numbers.(Wikipedia)
  7. I/O Status Information: Lists of I/O devices allocated to the process, open files, and other I/O-related information.(Wikipedia)
  8. Priority: Determines the scheduling priority of the process.(Naukri)
  9. List of Open Files: Tracks files that the process has opened during its execution.
  10. List of Open Devices: Monitors devices that the process is currently using.(Gate Vidyalay)

These attributes are crucial for context switching, allowing the operating system to save the state of a process and resume it later.(GeeksforGeeks)


🔄 Process States and Transitions

A process undergoes various states during its lifecycle:(GeeksforGeeks)

  • New: The process is being created.
  • Ready: The process is ready to run and waiting for CPU allocation.
  • Running: The process is currently being executed.
  • Waiting: The process is waiting for some event to occur (e.g., I/O completion).
  • Terminated: The process has finished execution.(BYJU’S)

The operating system manages transitions between these states based on scheduling algorithms and resource availability.


📚 Further Reading

For a more in-depth understanding, you can refer to the following resources:

  • Process in Operating System – BYJU’S
  • Process Control Block | Process Attributes – Gate Vidyalay
  • Process in Operating System | GeeksforGeeks

If you have any more questions or need further clarification on any topic, feel free to ask!

Day 01Part 08- Operating system lecture for gate for computer science – Attributes of Processes.

Operating System Concepts, 8th Edition

lecture notes on – operating systems



Leave a Reply

Your email address will not be published. Required fields are marked *

error: