Operating System
OS Part-1
OS Part-2
- File Concepts and Access methods
- Free Space Management and Allocation methods
- Directory Systems and Protection
- File Organization, Sharing and Implementation issues
- Disk and Drum Scheduling
- I/O Devices Organisation & I/O Buffering
- I/O Hardware, Kernel I/O subsystem and Transforming I/O Requests to Hardware Operations
- Device Drivers and Path Management
- Device Driver Sub Modules and Procedure
- Device Scheduler and Handler
- Interrupt Service Routine (ISR)
- File System in Linux and Windows
OS Part-3
- Process and Process Control Block(PCB)
- Process Scheduling( Preemptive and Non Preemptive)
- Scheduling Algorithms
- Algorithm Evaluation
- Multiple Processor Scheduling
- Real Time Scheduling
- Operations on Processes
- Threads
- Inter-Process Communication
- Precedence Graphs
- Critical Section Problem
- Semaphores
- Classical Problems of Synchronization
- DeadLock
- Deadlock Prevention and Avoidance
- Deadlock Detection and Recovery
- Process Management in Linux
OS Part-4
- Memory Hierarchy in OS
- Concepts of Memory Management
- MFT and MVT
- Logical and Physical Address Space
- Swapping
- Contiguous and Non Contiguous Memory Allocation
- Paging
- Segmentation
- Paging Combined with Segmentation
- Structure and Implementation of Page Table
- Virtual Memory in OS
- Cache Memory Organization
- Demand Paging
- Page Replacement Algorithms
- Allocation of Frames and Thrashing
- Demand Segmentation
OS Part-5
- Distributed Operating System: Introduction and Types
- Distributed OS: Design Issues
- Distributed OS: File System
- Distributed OS: Remote File Access
- Remote Procedure Call(RPC)
- Remote Method Invocation(RMI)
- Distributed Shared Memory
- Parallel Processing and Concurrent Programming
- Security and Threats Protection in Distributed OS
- Security Design Principles and Authentication in Distributed OS
- Sensor Network and Parallel OS
Process Management in Linux – Operating System
Process Management ek important feature hai jo Linux Operating System me processes ko create, schedule aur manage karne ka kaam karta hai. Har process ko PID (Process ID) milta hai jo usko uniquely identify karta hai.
Process in Linux
Linux me process ek running program hota hai jo system resources use karta hai. Process ki dono types hoti hain:
-
1. Foreground Process: Jo directly user ke interaction me hoti hai. (e.g.,
nano filename.txt
) -
2. Background Process: Jo bina user ke direct interaction ke chalta hai. (e.g.,
./script.sh &
)
Process States in Linux
Linux me ek process multiple states me ho sakta hai:
State | Meaning |
---|---|
Running (R) | Process CPU use kar raha hai ya ready hai |
Sleeping (S) | Process wait kar raha hai kisi event ya resource ka |
Stopped (T) | Process suspend ya debug mode me hai |
Zombie (Z) | Process terminate ho chuka hai par uska entry process table me hai |
Diagram:
---> Running <---
| |
New ---> Ready ---> Terminated
| |
---> Waiting
Process Control in Linux
Linux me processes ko control karne ke liye alag-alag commands aur system calls ka use kiya jata hai.
1. Process Creation (fork()
, exec()
)
-
fork(): Ek new child process create karta hai.
-
exec(): Ek naye program ko load aur execute karta hai.
-
Example:
#include <stdio.h>
#include <unistd.h>
int main() {
fork(); // New process create hoga
printf("Hello from process %d\n", getpid());
return 0;
}
fork()
ka use karke ek naye process ki copy banayi jati hai!
2. Process Identification (ps
, top
)
Har process ko PID (Process ID) milta hai jo usko uniquely identify karta hai.
-
ps command: Running processes dikhane ke liye.
-
top command: Real-time me process usage check karne ke liye.
Example:
ps aux | grep firefox (Firefox process ID dhundhne ke liye)
top (Live process monitoring ke liye)
3. Process Termination (kill
, exit()
)
Agar kisi process ko terminate karna ho, toh kill
aur exit()
ka use hota hai.
Example:
kill -9 1234 (Process ID 1234 ko forcefully terminate karega)
4. Process Scheduling in Linux
Linux me process scheduling ke liye scheduler algorithms ka use hota hai:
-
First Come First Serve (FCFS)
-
Round Robin (RR)
-
Completely Fair Scheduler (CFS) (Linux ka default scheduler)
Process priority change karne ke liye:
nice -n 10 ./a.out (Low priority (Nice Value: 10))
renice -5 -p 1234 (Change priority of process 1234)
Conclusion
Linux me processes ko manage karna ek important feature hai jo CPU scheduling, resource allocation aur memory management ka dhyan rakhta hai.
fork() aur exec() ka use process creation ke liye hota hai.
kill, ps, top, nice jaise commands process management me madad karte hain.