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 in Operating System
Introduction to Paging
Paging ek memory management technique hai jo non-contiguous memory allocation ko support karti hai. Is technique me processes ko fixed-size blocks (pages) me todh diya jata hai aur phir unhe RAM me kisi bhi jagah store kiya jata hai.
Why Paging?
Contiguous memory allocation me fragmentation problem hoti hai (external fragmentation).
Paging external fragmentation ko solve karta hai aur memory utilization improve karta hai.
Process ka pura address space ek saath available na bhi ho to bhi execution ho sakti hai.
How Paging Works?
Paging me logical address space ko fixed-size blocks (Pages) me divide kiya jata hai, aur physical memory (RAM) ko same size ke blocks (Frames) me divide kiya jata hai.
Process ka ek page kisi bhi frame me store ho sakta hai, aur Page Table mapping maintain karti hai.
Diagram (Paging Process)
Logical Address Space (Pages) Physical Memory (Frames)
+----+----+----+ +----+----+----+
| P1 | P2 | P3 | | F3 | F1 | F2 |
+----+----+----+ +----+----+----+
P = Page, F = Frame
Process ke pages kisi bhi available frames me store kiye ja sakte hain.
Steps in Paging:
Process ka Logical Address Space multiple Pages me divide hota hai.
Physical Memory ko Frames me divide kiya jata hai.
Page Table mapping maintain karti hai, jo batati hai ki kaunsa Page kaunsa Frame use kar raha hai.
CPU jab bhi kisi memory address ko access karta hai, Page Table se Physical Address fetch kiya jata hai.
Address Translation in Paging
Paging me Logical Address ko Physical Address me convert karna padta hai, jo Page Table ke through hota hai.
Address Calculation Formula:
Physical Address=Frame Number+Offset
Example:
Agar Page Size = 4 KB ho aur CPU Logical Address = (Page Number = 2, Offset = 1024 bytes) ho, aur Page Table ke mutaabik Page 2, Frame 5 me hai, toh:
Physical Address = (Frame5×4KB)+1024 Bytes
= (5×4096)+1024=20480+1024=21504
Final Physical Address = 21504 bytes.
Advantages of Paging
No External Fragmentation: Kyunki pages aur frames fixed-size ke hote hain, toh chhoti-chhoti gaps nahi banti.
Better Memory Utilization: Memory efficiently use hoti hai, kyunki pages alag-alag frames me store ho sakte hain.
Support for Virtual Memory: Paging virtual memory ka bhi base provide karti hai.
Disadvantages of Paging
Extra Memory Overhead: Page Table ke liye additional memory chahiye hoti hai.
Translation Time Increase Hota Hai: CPU ko Logical Address → Physical Address convert karne ke liye Page Table check karna padta hai, jo slow ho sakta hai.
Conclusion
Paging ek powerful memory management technique hai jo external fragmentation problem solve karti hai.
Page Table mapping ke through Logical Addresses ko Physical Addresses me translate kiya jata hai.
Modern operating systems (like Windows, Linux) paging ka use karte hain, aur Virtual Memory me bhi iska role hota hai.