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
Paging Combined with Segmentation in Operating System
Introduction
Paging aur Segmentation memory management techniques hain, jo processes ko efficiently memory allocate karne ke liye use hoti hain. Dono techniques ka combination ek hybrid approach provide karta hai, jise Segmented Paging kaha jata hai.
Why Combine Paging & Segmentation?
-
Segmentation se logical division hoti hai, jo programming structure ko follow karti hai.
-
Paging se fixed-size blocks (pages) create hote hain, jo internal fragmentation ko reduce karta hai.
-
Dono ko combine karne se better memory utilization aur efficient address translation possible hoti hai.
How Segmented Paging Works?
Segmented Paging me process ko pehle multiple segments me divide kiya jata hai, aur fir har segment ko chhoti-chhoti pages me todh diya jata hai.
Logical Address Structure:
Logical Address=(Segment Number, Page Number, Page Offset)
Diagram: Segmented Paging Process
Logical Address Space (Segments)
+----------+----------+-------+
| Segment 1| Segment 2| Stack |
+----------+----------+-------+
Segment 1 → Divided into Pages
+————+————+————-+
| Page 1 | Page 2 | Page 3 |
+————+————+————-+
Segment 2 → Divided into Pages
+————+————+————-+
| Page 1 | Page 2 | Page 3 |
+————+————+————-+
Physical Memory
+—————–+—————–+——————+——————+
| Page 1(S1)| Page 1(S2)| Page 2(S1)| Page 3(S2)|
+—————–+——————+—————–+——————+
(S1 = Segment 1, S2 = Segment 2)
Address Translation in Segmented Paging
Segmented Paging me Logical Address ko Physical Address me convert karne ke liye 2 tables use hoti hain:
-
1. Segment Table → Har segment ke liye ek Base Address store karti hai.
-
2. Page Table → Segment ke andar pages ke physical locations store karti hai.
Steps of Address Translation:
CPU Logical Address generate karta hai → (Segment Number, Page Number, Offset).
Segment Table check hoti hai, jisme Segment Base Address milta hai.
Segment ke andar Page Table access hoti hai, jo Page Number ka Physical Address deti hai.
Page Base Address aur Offset ko combine karke Final Physical Address generate hota hai.
Formula for Physical Address Calculation:
Physical Address=(Base Address of Segment)+(Page Table Entry)+Offset
Example of Segmented Paging
Agar CPU ek Logical Address (Segment 1, Page 2, Offset 500) generate karta hai: Segment Table me Segment 1 ka Base Address = 4000 hai.
Segment 1 ke Page Table me Page 2 ka Base Address = 8000 hai.
Final Address Calculation:
Physical Address=4000+8000+500=12500
Final Physical Address = 12500 bytes.
Advantages of Segmented Paging
Efficient Memory Utilization: Paging se internal fragmentation control hoti hai, aur segmentation logical grouping provide karta hai.
Flexible Memory Management: Segments different size ke ho sakte hain, aur unke andar pages equal size ke hote hain.
Logical View + Fixed Allocation: Program logically structured rehta hai, aur memory allocation fixed-size blocks me hoti hai.
Disadvantages of Segmented Paging
More Complex Address Translation: CPU ko dono tables (Segment + Page) access karni padti hai, jo paging aur segmentation ke comparison me slow ho sakti hai.
Extra Overhead: Har segment ke liye ek Page Table maintain karni padti hai, jo additional memory consume karti hai.
Comparison: Paging, Segmentation & Segmented Paging
Feature | Paging | Segmentation | Segmented Paging |
---|---|---|---|
Division Type | Fixed-size pages | Logical segments | Segments + Pages |
Fragmentation | Internal Fragmentation | External Fragmentation | Minimal Fragmentation |
Memory Utilization | Efficient, but fixed allocation | Flexible, but fragmentation risk | Best of both |
Mapping Complexity | Simple Page Table | Segment Table | Both Segment & Page Tables |
Conclusion
Segmented Paging ek hybrid approach hai jo segmentation aur paging ki best features ko combine karta hai.
Address translation do tables (Segment Table + Page Table) ka use karti hai.
Memory utilization aur fragmentation ke issues ko reduce karne ke liye yeh technique useful hai.