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
Free Space Management & File Allocation Methods in Operating System
1. Free Space Management
Jab files delete hoti hain ya naye files store kiye jaane hote hain, toh Operating System ko ye track karna hota hai ki kaunsa disk space free hai. Isi process ko Free Space Management kaha jata hai.
Free Space Management Kyu Zaroori Hai?
-
Storage space ko efficiently use karne ke liye.
-
File allocation ko fast banane ke liye.
-
File deletion ke baad space reuse karne ke liye.
Free Space Management Ke Methods
1. Bit Vector (Bitmap)
-
Ek array of bits (0s & 1s) use kiya jata hai free aur occupied blocks ko track karne ke liye.
-
0 → Block free hai.
-
1 → Block occupied hai.
Example:
| 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
Yahan block 3, 4, 6, aur 7 free hain.
Advantages:
Simple aur memory-efficient.
Disadvantages:
Free block find karna slow ho sakta hai.
2. Linked List
-
Free blocks ko ek linked list ke form me store kiya jata hai.
-
Har free block me next free block ka address hota hai.
Example:
[Free Block 1] → [Free Block 2] → [Free Block 3] → NULL
Advantages:
No memory wastage.
Disadvantages:
Searching time-consuming hota hai.
3. Grouping
-
Ek free block ka address pehle block me store hota hai, jo naye free blocks ko point karta hai.
Example:
[Block 1] → (Blocks 2, 3, 4 ke addresses store hain)
[Block 2] → (Blocks 5, 6, 7 ke addresses store hain)
Advantages:
Linked list se faster hai.
Disadvantages:
Extra memory chahiye addresses store karne ke liye.
4. Counting
-
Ek saath free blocks ko ek entry ke form me store kiya jata hai
(start block, count)
.
Example:
(100, 5) → Blocks 100 se 104 tak free hain.
(200, 3) → Blocks 200 se 202 tak free hain.
Advantages:
Storage space bachta hai.
Disadvantages:
Sirf contiguous (ek saath wale) blocks ke liye best hai.
2. File Allocation Methods
File allocation ka matlab hai disk space ka allocation kis tarike se kiya jaye taaki files efficiently store ho sakein.
1. Contiguous Allocation
-
File continuous disk blocks me store hoti hai.
Example:
File A: | Block 10 | Block 11 | Block 12 | Block 13 |
File B: | Block 20 | Block 21 | Block 22 |
Advantages:
Fast access kyunki data ek saath hota hai.
Disadvantages:
External fragmentation ho sakti hai.
File size increase karna mushkil hota hai.
2. Linked Allocation
-
File scattered disk blocks me store hoti hai, aur har block me next block ka pointer hota hai.
Example:
File A: Block 5 → Block 19 → Block 25 → Block 40 → NULL
Advantages:
Flexible size, file badh sakti hai.
Disadvantages:
Slow access, kyunki har block pe jump karna padta hai.
3. Indexed Allocation
-
Ek index block maintain kiya jata hai jo file ke blocks ke addresses store karta hai.
Example:
Index Block → [Block 5, Block 19, Block 25, Block 40]
Advantages:
Fast access, direct indexing ke wajah se.
Disadvantages:
Extra memory chahiye index block ke liye.
Comparison of File Allocation Methods
Method | Kaise Kaam Karta Hai | Advantages | Disadvantages |
---|---|---|---|
Contiguous Allocation | Files ek saath blocks me store hoti hain | Fast access, Simple | External fragmentation |
Linked Allocation | Files ko scattered blocks me store karte hain | Flexible size | Slow access |
Indexed Allocation | Separate index block use hota hai | Fast access | Extra memory required |
Conclusion
Free Space Management aur File Allocation Methods Operating System ke disk management ka important part hain. Har method ka use case aur efficiency alag hoti hai, jo system requirement aur file storage ke size pe depend karta hai.