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
System Protection in Operating System
1. System Protection Kya Hota Hai?
System Protection ka matlab hai OS ka users, processes aur system resources ko unauthorized access aur malicious activities se bachana.
Example: Ek computer me agar ek user apne personal files protect karna chahta hai taaki doosra user bina permission ke unhe delete na kare, toh OS ki protection mechanisms ka use kiya jata hai.
2. System Protection Kyun Zaroori Hai?
Unauthorized Access Rokna – Users sirf apne files aur resources ko access kar sakein.
Process Isolation – Ek program doosre program ke kaam me interfere na kare.
Data Integrity Maintain Karna – Data safe aur unchanged rahe.
Resource Allocation Control – Har user ko fairly CPU, memory aur storage mile.
Security Badana – OS viruses, malware aur hackers se system ko safe rakhe.
3. System Protection Ke Important Mechanisms
1. Access Control Mechanisms
OS files aur system resources ko access karne ke rules define karta hai.
Example: Linux me file permissions ka use hota hai taaki sirf authorized users hi read, write ya execute kar sakein.
Linux File Permission Example:
ls -l myfile.txt
rw-
→ Owner ke paas read aur write ka access hai.r--
→ Group sirf read kar sakta hai.r--
→ Baaki sab sirf read kar sakte hain.
2. User Authentication
OS users ko verify karta hai taaki sirf valid users hi system use kar sakein.
Authentication methods:
Password Authentication
Biometric Authentication (fingerprint, face unlock)
Two-Factor Authentication (2FA)
Example: Windows ya macOS me login karne ke liye password ya fingerprint ka use hota hai.
3. Process Isolation
Ek process doosre process ke memory aur resources ko access na kare.
OS virtual memory aur paging techniques ka use karta hai.
Example: Agar Google Chrome ka ek tab crash ho jaye, toh baaki tabs aur system par asar nahi padta.
4. Hardware-Based Protection
Modern CPUs protection rings ka use karte hain taaki security ensure ki ja sake.
CPU Protection Rings Diagram:
+------------+
| Ring 3Â Â Â |Â User Applications (Least Privilege)
+------------+
| Ring 2Â Â Â | System Services & Drivers
+------------+
| Ring 1Â Â Â | More Privileged Drivers
+------------+
| Ring 0Â Â Â | Kernel Mode (Highest Privilege)
+------------+
Ring 0 (Kernel Mode) – Full control hota hai.
Ring 3 (User Mode) – Restricted mode jisme normal programs run karte hain.
Benefit: Agar ek user program crash hota hai, toh pura OS affect nahi hota.
5. File aur Data Protection
OS files aur data ko encryption aur access control se protect karta hai.
Backup rakha jata hai taaki data loss avoid ho sake.
Example: Windows BitLocker ka use karke hard disk ka encryption kiya jata hai.
6. Network Protection
OS ko network se aane wale malware aur hacking attacks se bachana zaroori hota hai.
Firewalls aur antivirus software system ki security badhate hain.
Example: Windows Defender Firewall suspicious internet connections block karta hai.
4. Example: File Protection Program in C
Niche ek simple C program diya gaya hai jo file permissions set karta hai taaki unauthorized users file modify na kar sakein:
#include <stdio.h>
#include <sys/stat.h>
int main() {
char filename[] = “protected_file.txt”;
// File permissions set karna: Owner read/write kare, others sirf read karein
chmod(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
printf("File permissions updated for %s\n", filename);
return 0;
}
Yeh program ensure karega ki file ko sirf owner modify kar sake, doosre log sirf read kar sakein.
5. Conclusion (Summary)
System Protection system aur users ke data ko secure banata hai.
OS multiple security techniques use karta hai jaise authentication, process isolation aur access control.
Hardware-based protection jaise CPU rings OS security badhate hain.
Firewalls aur encryption ka use unauthorized access aur hacking se bachne ke liye hota hai.