शुभ दीपावली! NotesMedia की ओर से आपको और आपके परिवार को ढेरों शुभकामनाएं ✨ शुभ दीपावली! आपको और आपके परिवार को शुभकामनाएं ✨ शुभ दीपावली! ✨
BCA / B.Tech 13 min read

Paging in OS in Hindi – Paging और Segmentation

RK

लेखक Ratan Kumawat · संस्थापक, NotesMedia

प्रकाशित:

त्वरित सारांश और मुख्य बिंदु

  • • विषय फोकस: Operating System (OS) Notes in Hindi | ऑपरेटिंग सिस्टम नोट्स (BCA / B.Tech Syllabus)
  • • मुख्य विषय: Paging in OS in Hindi – Paging और Segmentation - General Topics
  • • अवलोकन: Quick Answer: OS में Paging एक memory management technique है। इसमें process की logical memory को बराबर size के टुकड़ों (pages) में और RAM को उसी size क...
  • • मुख्य अवधारणाएं: Paging, Page table frame allocation Hindi, TLB internal fragmentation,Paging, Page table frame allocation, TLB internal fragmentation
Quick Answer: OS में Paging एक memory management technique है। इसमें process की logical memory को बराबर size के टुकड़ों (pages) में और RAM को उसी size के टुकड़ों (frames) में बाँटा जाता है। कोई भी page RAM के किसी भी खाली frame में रखा जा सकता है, और page table बताती है कि कौन सा page किस frame में है। इससे process को लगातार (contiguous) memory की ज़रूरत नहीं पड़ती और external fragmentation खत्म हो जाता है।

Paging क्या है? (Paging in OS)

"Page" का सीधा मतलब है किताब का पन्ना। जैसे किताब के पन्ने अलग-अलग करके कहीं भी रखे जा सकते हैं और page number से फिर सही order में पढ़े जा सकते हैं, वैसे ही paging में program को pages में काटकर RAM में जहाँ जगह मिले वहाँ रख दिया जाता है।

Segmentation को विस्तार से समझने के लिए पढ़ें: Segmentation in OS in Hindi।

Paging के बिना (contiguous allocation में) process को RAM में एक लगातार block चाहिए होता है। अगर RAM में कुल जगह काफी है पर टुकड़ों में बिखरी है, तो process load नहीं होता। इसे external fragmentation कहते हैं। Paging यही problem हल करती है। Contiguous तरीका detail में Contiguous Allocation in Hindi में पढ़ें।

Advertisement

Paging के Basic Terms

Termमतलब
PageProcess की logical memory का fixed size का टुकड़ा। आम size 4 KB होता है, पर यह system design पर depend करता है।
FramePhysical memory (RAM) का टुकड़ा। Frame size = Page size हमेशा।
Page Tableहर process की एक table, जिसमें लिखा होता है कि कौन सा page किस frame में है।
Logical AddressCPU जो address बनाता है। इसके दो हिस्से: page number (p) और offset (d)।
Physical AddressRAM का असली address: frame number (f) और वही offset (d)।
Offset (d)Page के अंदर byte की position। Page से frame में जाने पर offset नहीं बदलता।
MMUMemory Management Unit, hardware जो logical address को physical address में बदलता है।

Paging कैसे काम करती है (Address Translation)

  1. CPU एक logical address बनाता है।
  2. Address को दो हिस्सों में तोड़ा जाता है: page number p = address ÷ page size (भागफल) और offset d = address mod page size (शेषफल)।
  3. Page table में p वाली entry देखकर frame number f मिलता है।
  4. Physical address = f × page size + d

Paging Diagram

  CPU
   |  logical address
   v
+------+--------+         Page Table          Physical Memory (RAM)
|  p   |   d    |        +------+------+     +-----------+
+------+--------+        | page | frame|     | Frame 0   |
   |        |            |  0   |  5   |     | ...       |
   +------> | --------> |  1   |  2   |     | Frame f   | <-- (f, d)
            |            |  2   |  7   |     | ...       |
            |            |  3   |  4   |     +-----------+
            v            +------+------+
      +------+--------+
      |  f   |   d    |  physical address
      +------+--------+

Paging का Example: Page Table

Page size 4 KB है और process को 16 KB memory चाहिए। तो pages = 16 KB ÷ 4 KB = 4 pages (page 0 से page 3)। ये RAM में कहीं भी रखे जा सकते हैं:

Page NumberFrame Number
05
12
27
34

ध्यान दें: frames लगातार नहीं हैं (5, 2, 7, 4), फिर भी process ठीक चलेगा। यही paging की ताकत है।

Paging Numericals (Solved Examples)

Numerical 1: Logical address से Physical address

Question: ऊपर वाली page table लीजिए (page size 4 KB = 4096 bytes)। Logical address 10000 का physical address निकालिए।

  • Page number p = 10000 ÷ 4096 = 2 (क्योंकि 2 × 4096 = 8192)
  • Offset d = 10000 − 8192 = 1808
  • Page table से page 2 → frame 7
  • Physical address = 7 × 4096 + 1808 = 28672 + 1808 = 30480

Numerical 2: Bits में page number और offset

Question: Logical address 16 bit का है और page size 1 KB है। Logical address 0x0C2A का page number और offset बताइए। अगर page 3, frame 9 में है तो physical address क्या होगा?

  • Page size 1 KB = 1024 = 2^10, इसलिए offset = 10 bits।
  • Page number = 16 − 10 = 6 bits, यानी कुल 2^6 = 64 pages।
  • 0x0C2A = decimal 3114 = binary 000011 0000101010
  • पहले 6 bits 000011 = page 3, बाकी 10 bits 0000101010 = offset 42। (Check: 3 × 1024 + 42 = 3114 ✔)
  • Physical address = 9 × 1024 + 42 = 9216 + 42 = 9258

Numerical 3: Page table का size

Question: 32-bit logical address, page size 4 KB और हर page table entry 4 bytes की है। Page table कितनी बड़ी होगी?

  • 4 KB = 2^12, तो offset = 12 bits, page number = 32 − 12 = 20 bits।
  • Pages = 2^20 = 1,048,576
  • Page table size = 2^20 × 4 bytes = 4 MB (हर process के लिए!)

इतनी बड़ी table की वजह से ही multi-level paging और inverted page table बनाए गए।

Numerical 4: Internal Fragmentation

Question: Page size 2048 bytes है और process 72,766 bytes का है। कितने pages लगेंगे और internal fragmentation कितना होगा?

  • 72766 ÷ 2048 = 35 pages पूरे, और 1086 bytes बचे।
  • बचे 1086 bytes के लिए एक और page चाहिए, तो कुल 36 pages।
  • आखिरी page में खाली जगह = 2048 − 1086 = 962 bytes। यही internal fragmentation है।

Numerical 5: TLB के साथ Effective Access Time

Page table RAM में होती है, तो हर data access के लिए दो बार memory जाना पड़ता है (एक बार page table, एक बार data)। इसे तेज़ करने के लिए एक छोटी fast cache TLB (Translation Lookaside Buffer) रखी जाती है।

Question: TLB search = 20 ns, memory access = 100 ns, TLB hit ratio = 80%। EAT निकालिए।

  • TLB hit पर: 20 + 100 = 120 ns
  • TLB miss पर: 20 + 100 (page table) + 100 (data) = 220 ns
  • EAT = 0.80 × 120 + 0.20 × 220 = 96 + 44 = 140 ns

Types of Paging (पेजिंग के प्रकार)

1. Single-Level Paging

हर process की एक ही page table, जो सीधे page को frame से map करती है। Simple और तेज़, पर बड़े address space में table बहुत बड़ी हो जाती है (Numerical 3 देखें)।

2. Multi-Level Paging

बड़ी page table को भी pages में बाँट दिया जाता है, और एक outer page table उन्हें point करती है। फायदा: पूरी table RAM में रखने की ज़रूरत नहीं। नुकसान: translation में ज़्यादा memory access लगते हैं, इसलिए थोड़ा धीमा।

Advertisement

3. Inverted Page Table

हर process की अलग table की जगह पूरे system की एक table होती है, जिसमें हर frame की एक entry होती है (कि उस frame में किस process का कौन सा page है)। फायदा: table का size RAM के size पर depend करता है, process के address space पर नहीं, इसलिए memory बचती है। नुकसान: किसी page को ढूँढने के लिए table में search करना पड़ता है, इसलिए translation complex होता है।

4. Demand Paging (Demand Paging in OS)

Process के सारे pages शुरू में RAM में load नहीं होते। जो page ज़रूरत पड़ने पर माँगा जाता है, वही disk से लाया जाता है। अगर माँगा गया page RAM में नहीं है, तो page fault होता है:

  1. CPU किसी page को access करता है, page table में वह invalid है।
  2. OS को trap (page fault) मिलता है।
  3. OS disk पर वह page ढूँढता है और RAM में एक खाली frame लेता है। खाली frame न हो तो page replacement algorithm (FIFO, LRU, Optimal) किसी page को बाहर करता है।
  4. Page load होता है, page table update होती है, और instruction दोबारा चलता है।

5. Virtual Memory के साथ Paging

Demand paging की मदद से process को लगता है कि उसकी पूरी memory RAM में है, जबकि असल में सिर्फ ज़रूरी pages RAM में होते हैं और बाकी disk पर। इसी को virtual memory कहते हैं। फायदा: RAM से बड़ा program भी चल सकता है। नुकसान: page faults ज़्यादा हों तो disk I/O से speed गिरती है। हर process को कितने frames दिए जाएँ, यह Allocation of Frames in Hindi में पढ़ें।

Paging और Segmentation में अंतर (Paging and Segmentation in OS)

PointPagingSegmentation
टुकड़ों का sizeFixed (सब pages बराबर)Variable (हर segment अलग size का)
किसके हिसाब से बँटवाराOS/hardware करता है, program के logic से कोई मतलब नहींProgram के logical हिस्सों के हिसाब से: code, data, stack, function
FragmentationInternal fragmentation (आखिरी page में)External fragmentation
AddressPage number + offsetSegment number + offset
TablePage table (frame number)Segment table (base + limit)
Programmer को दिखता है?नहींहाँ

Paging के फायदे और नुकसान

फायदे (Advantages)

  • External fragmentation खत्म: कोई भी खाली frame किसी भी page के काम आ सकता है।
  • Flexible allocation: Process के pages RAM में कहीं भी रखे जा सकते हैं।
  • Virtual memory का support: Demand paging से RAM से बड़ा program भी चल सकता है।
  • Swapping आसान: पूरा process नहीं, सिर्फ pages disk पर आते-जाते हैं।

नुकसान (Disadvantages)

  • Internal fragmentation: आखिरी page पूरा नहीं भरता (Numerical 4)।
  • Page table overhead: हर process की table memory लेती है।
  • Translation delay: हर access पर page table देखनी पड़ती है; TLB न हो तो access time दोगुना।
  • Page faults: Demand paging में page disk से लाने में समय लगता है।

Common Mistakes

  • "Paging internal fragmentation खत्म करती है": गलत। Paging external fragmentation खत्म करती है। Internal fragmentation आखिरी page में रह सकता है।
  • Offset बदल देना: Page से frame में जाने पर offset वही रहता है, सिर्फ page number की जगह frame number आता है।
  • Page size और frame size अलग मानना: दोनों हमेशा बराबर होते हैं।

Exam के लिए Important Questions

Short Questions (2–3 marks)

  1. Paging क्या है? (memory को fixed size pages/frames में बाँटने की technique)
  2. Page और frame में क्या अंतर है? (page logical memory में, frame physical memory में; size बराबर)
  3. Page fault क्या है? (माँगा गया page RAM में न होना)
  4. TLB क्या है? (page table entries की fast cache)
  5. Page size 4 KB हो तो offset कितने bits का होगा? (12 bits)

Long Questions (5–10 marks)

  1. Paging को diagram के साथ समझाइए। Logical address physical address में कैसे बदलता है?
  2. Demand paging क्या है? Page fault handle करने के steps लिखिए।
  3. Paging और segmentation में अंतर बताइए।
  4. Multi-level paging और inverted page table समझाइए।

FAQs

Paging meaning in Hindi क्या है?

Paging का मतलब है memory को बराबर size के "पन्नों" (pages) में बाँटकर manage करना, ताकि program RAM में कहीं भी, टुकड़ों में रखा जा सके।

"Pagging" और "Paging" एक ही हैं?

हाँ, "pagging" बस गलत spelling है। सही शब्द paging है।

Page size हमेशा 2 की power क्यों होता है?

क्योंकि तब address को बिना भाग किए, सिर्फ bits काटकर page number और offset में बाँटा जा सकता है (Numerical 2 देखें)। यह hardware के लिए बहुत तेज़ है।

Paging से कौन सा fragmentation होता है?

Internal fragmentation, सिर्फ process के आखिरी page में। External fragmentation paging में नहीं होता।

अक्सर पूछे जाने वाले प्रश्न (FAQs)

Quick Answer: OS में Paging एक memory management technique है।
Operating System (OS) Notes in Hindi | ऑपरेटिंग सिस्टम नोट्स के पाठ्यक्रम में Paging in OS in Hindi – Paging और Segmentation एक महत्वपूर्ण अध्याय है। यह मुख्य सिद्धांतों, परीक्षा प्रश्नों और सूत्रों को समझने के लिए अत्यधिक आवश्यक है।
हाँ, NotesMedia पर आपको Paging in OS in Hindi – Paging और Segmentation के महत्वपूर्ण प्रश्नोत्तर, हल किए गए उदाहरण और नोट्स बिल्कुल मुफ्त मिलेंगे। अधिक अभ्यास के लिए आप हमारा ऐप भी डाउनलोड कर सकते हैं।
Advertisement

In this Chapter

Paging in OS in Hindi – Paging और Segmentation
Distributed System in Hindi
Real Time System in Hindi
System Calls in Hindi
System Program in Hindi
Structure of Operating System in Hindi
Layers Design of Structure in Hindi
Unix in Hindi
Virtual Machine in Hindi
Kernel-Based Operating System in Hindi
Process in Hindi – OS में Process क्या है
Interacting Processes in Hindi
Threads in Hindi
Fundamental of Schedulling in Hindi
Scheduling Criteria in Hindi
Long Medium Short Term Scheduling in Hindi
Scheduling Algorithms in Hindi
Structure of Concurrent System in Hindi
Critical Region in Hindi
Critical Section in Hindi
Inter process Communication in Hindi
Monitor in Hindi
Semaphore in OS in Hindi – Counting और Binary Semaphore
Semaphores Implementation & Uses in Hindi
Logical and Physical Address in Hindi
Swapping in Hindi
Contiguous Allocation in Hindi
Segmentation in Hindi
Paging with Segmentation in Hindi
kernel Memory Allocation in Hindi
Page Replacement Algorithms in Hindi
Virtual Memory in Hindi
Virtual Memory with demand Paging in Hindi
Deadlock & Characterization in Hindi
Methods for Handling Deadlocks in Hindi
Deadlock Thrashing in Hindi
Allocation of Frames in Hindi
Virtual Memory using Segmentation in Hindi
Interprocess Communication protocol in Hindi
Network Operating System in Hindi
Design Issues in Distributed File System in Hindi
Network Structure in Hindi
Structure Distributed System in Hindi
File System and Coordination in Hindi
Linux in Hindi
Commands of Linux in Hindi | लिनक्स के कमांड्स हिंदी में
Programmer Interface & File manipulation in Hindi
Process control in Linux in Hindi
Linux Kernel & Signals in Hindi
File System in Linux in Hindi
block & inodes in Hindi
System Editor in Hindi
Character Transliteration in Hindi
ED in Hindi
Vi Editor & There Commands in Hindi
Shell Script in Hindi
Looping & Decision Making in Hindi
Variables & File name Expansion in Hindi
Array in Hindi OS
Sub Program in Hindi
C interface with Linux in Hindi
Simpel Shell Programs in Hindi
BCA Part-1 | Operating Systems | Semester-I | MDSU Exam Paper 2023 (Held in 2024)
What is Operating System (OS) in Hindi
Operating System (OS) All Important Questions and Answers in Hindi (MDSU)
BCA || Operating System 2025 Paper || MDSU Exam Paper
BCA | OS(Operating System) 2023 Paper | MDSU Exam Paper
Type of Operating System in Hindi
Goals of Operating System in Hindi
Operation of Operating system in Hindi
Resource Allocation & Functions in Hindi
class of Operating system in Hindi
Batch Processing in Hindi
Multi Processing in Hindi
Time Sharing in Hindi