• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

GKPAD.COM

ONLINE HINDI EDUCATION PORTAL

  • Home
  • Blog
  • Sarkari Result
  • University Books
  • University Papers
  • University Syllabus
  • About Us

IGNOU MCS-041 Solved Question Paper PDF Download

The IGNOU MCS-041 Solved Question Paper PDF Download page is designed to help students access high-quality exam resources in one place. Here, you can find ignou solved question paper IGNOU Previous Year Question paper solved PDF that covers all important questions with detailed answers. This page provides IGNOU all Previous year Question Papers in one PDF format, making it easier for students to prepare effectively.

  • IGNOU MCS-041 Solved Question Paper in Hindi
  • IGNOU MCS-041 Solved Question Paper in English
  • IGNOU Previous Year Solved Question Papers (All Courses)

Whether you are looking for IGNOU Previous Year Question paper solved in English or ignou previous year question paper solved in hindi, this page offers both options to suit your learning needs. These solved papers help you understand exam patterns, improve answer writing skills, and boost confidence for upcoming exams.

IGNOU MCS-041 Solved Question Paper PDF

IGNOU Previous Year Solved Question Papers

This section provides IGNOU MCS-041 Solved Question Paper PDF in both Hindi and English. These ignou solved question paper IGNOU Previous Year Question paper solved PDF include detailed answers to help you understand exam patterns and improve your preparation. You can also access IGNOU all Previous year Question Papers in one PDF for quick and effective revision before exams.


IGNOU MCS-041 Previous Year Solved Question Paper in Hindi

Q1. (a) कंप्यूटर सिस्टम में ऑपरेटिंग सिस्टम की आवश्यकता क्यों है? ऑपरेटिंग सिस्टम की पीढ़ियों की व्याख्या करें। (7) (b) पेजिंग क्या है? बेसिक पेजिंग तकनीक पर विस्तार से चर्चा करें। (8) (c) सिस्टम कॉल और उनका उपयोग क्या है? निम्नलिखित सिस्टम कॉल की व्याख्या करें: (i) Fork/Join (ii) Suspend (iii) Resume (iv) Exit (10) (d) मल्टीप्रोसेसर ऑपरेटिंग सिस्टम के प्रकारों को सूचीबद्ध करें और उनमें से किसी दो प्रकारों की व्याख्या करें। (5) (e) बैंकर का एल्गोरिथ्म क्या है? निम्नलिखित उदाहरण में सुरक्षित या असुरक्षित स्थिति की जांच के लिए बैंकर के एल्गोरिथ्म को लागू करें: (10) प्रक्रियाओं की संख्या 5 : (P₀, P₁, P₂, P₃, P₄) संसाधनों की संख्या 3 : A (10 इंस्टेंस), B (5 इंस्टेंस), C (7 इंस्टेंस) समय T₀ पर Allocation Max. Available Process A B C A B C A B C P₀ 0 1 0 7 5 3 3 3 2 P₁ 2 0 0 3 2 2 P₂ 3 0 2 9 0 2 P₃ 2 1 1 2 2 2 P₄ 0 0 2 4 3 3

Ans.

(a) ऑपरेटिंग सिस्टम (OS) की आवश्यकता और पीढ़ियाँ

एक ऑपरेटिंग सिस्टम एक सिस्टम सॉफ्टवेयर है जो कंप्यूटर हार्डवेयर और सॉफ्टवेयर संसाधनों का प्रबंधन करता है और कंप्यूटर प्रोग्राम के लिए सामान्य सेवाएं प्रदान करता है। यह उपयोगकर्ता और कंप्यूटर हार्डवेयर के बीच एक इंटरफ़ेस के रूप में कार्य करता है।

ऑपरेटिंग सिस्टम की आवश्यकता:

  • संसाधन प्रबंधन (Resource Management): OS सीपीयू समय, मेमोरी स्पेस, फ़ाइल स्टोरेज स्पेस, I/O डिवाइस जैसे सभी संसाधनों का प्रबंधन और आवंटन करता है।
  • अमूर्तता (Abstraction): यह हार्डवेयर की जटिलताओं को उपयोगकर्ताओं और अनुप्रयोगों से छुपाता है, जिससे कंप्यूटर का उपयोग करना आसान हो जाता है।
  • सुरक्षा और संरक्षण (Security and Protection): यह विभिन्न प्रक्रियाओं और उपयोगकर्ताओं के बीच हस्तक्षेप को रोककर सिस्टम की सुरक्षा सुनिश्चित करता है। यह अनधिकृत पहुंच को भी रोकता है।
  • प्रोसेस मैनेजमेंट (Process Management): यह प्रक्रियाओं के निर्माण, समाप्ति और उनके बीच सिंक्रनाइज़ेशन और संचार का प्रबंधन करता है।
  • उपयोगकर्ता इंटरफ़ेस (User Interface): यह कमांड-लाइन इंटरफेस (CLI) या ग्राफिकल यूजर इंटरफेस (GUI) प्रदान करता है, जिससे उपयोगकर्ता कंप्यूटर के साथ इंटरैक्ट कर सकते हैं।

ऑपरेटिंग सिस्टम की पीढ़ियाँ:

  1. पहली पीढ़ी (1940s-1950s): इस पीढ़ी में कोई ऑपरेटिंग सिस्टम नहीं था। प्रोग्रामर सीधे मशीन भाषा का उपयोग करके हार्डवेयर के साथ इंटरैक्ट करते थे।
  2. दूसरी पीढ़ी (1950s-1960s): इस युग में बैच प्रोसेसिंग सिस्टम का उदय हुआ। नौकरियों (jobs) को एक साथ बैचों में इकट्ठा किया जाता था और कंप्यूटर द्वारा एक-एक करके निष्पादित किया जाता था, जिससे सेटअप समय कम हो जाता था।
  3. तीसरी पीढ़ी (1960s-1970s): इस पीढ़ी ने मल्टीप्रोग्रामिंग और टाइम-शेयरिंग सिस्टम की शुरुआत की। मल्टीप्रोग्रामिंग ने कई नौकरियों को मेमोरी में एक साथ रखने की अनुमति दी, जिससे सीपीयू का उपयोग बढ़ा। टाइम-शेयरिंग (मल्टीटास्किंग) ने कई उपयोगकर्ताओं को एक साथ कंप्यूटर सिस्टम साझा करने की अनुमति दी।
  4. चौथी पीढ़ी (1980s-वर्तमान): इस पीढ़ी में पर्सनल कंप्यूटर (PC) का विकास हुआ। इसने ग्राफिकल यूजर इंटरफेस (GUI), नेटवर्किंग और डिस्ट्रिब्यूटेड ऑपरेटिंग सिस्टम को जन्म दिया। आज, हम मोबाइल ऑपरेटिंग सिस्टम (जैसे एंड्रॉइड, आईओएस) और क्लाउड-आधारित ऑपरेटिंग सिस्टम का उपयोग करते हैं।

(b) पेजिंग तकनीक

पेजिंग एक मेमोरी मैनेजमेंट तकनीक है जो एक प्रक्रिया के एड्रेस स्पेस को गैर-सन्निहित (non-contiguous) तरीके से फिजिकल मेमोरी में संग्रहीत करने की अनुमति देती है। यह एक्सटर्नल फ्रेगमेंटेशन की समस्या को हल करती है।

बेसिक पेजिंग तकनीक:

  1. मेमोरी का विभाजन:
    • फिजिकल मेमोरी को निश्चित आकार के ब्लॉक में विभाजित किया जाता है जिन्हें फ्रेम्स (Frames) कहा जाता है।
    • लॉजिकल मेमोरी (एक प्रक्रिया का एड्रेस स्पेस) को समान आकार के ब्लॉक में विभाजित किया जाता है जिन्हें पेजेज (Pages) कहा जाता है। पेज का आकार फ्रेम के आकार के बराबर होता है।
  2. एड्रेस ट्रांसलेशन:
    • सीपीयू द्वारा उत्पन्न प्रत्येक एड्रेस (लॉजिकल एड्रेस) को दो भागों में विभाजित किया जाता है: एक पेज नंबर (p) और एक ऑफसेट (d) ।
    • पेज नंबर का उपयोग पेज टेबल में एक इंडेक्स के रूप में किया जाता है। पेज टेबल में प्रत्येक पेज के लिए फिजिकल मेमोरी में संबंधित फ्रेम नंबर होता है।
    • पेज टेबल से प्राप्त फ्रेम नंबर (f) को ऑफसेट (d) के साथ जोड़कर फिजिकल एड्रेस बनाया जाता है।
  3. पेज टेबल: यह एक डेटा संरचना है जिसका उपयोग ऑपरेटिंग सिस्टम द्वारा प्रत्येक प्रक्रिया के लिए लॉजिकल एड्रेस को फिजिकल एड्रेस में मैप करने के लिए किया जाता है। प्रत्येक प्रक्रिया का अपना पेज टेबल होता है। पेज टेबल बेस रजिस्टर (PTBR) पेज टेबल की शुरुआत का पता संग्रहीत करता है।
  4. कार्यान्वयन: जब कोई प्रक्रिया निष्पादित होती है, तो उसके पेज मेमोरी में उपलब्ध किसी भी खाली फ्रेम में लोड किए जा सकते हैं। ये फ्रेम सन्निहित होने की आवश्यकता नहीं है। OS एक फ्री-फ्रेम सूची रखता है।

पेजिंग का एक मुख्य लाभ यह है कि यह एक्सटर्नल फ्रेगमेंटेशन को पूरी तरह से समाप्त कर देता है। हालांकि, इसमें इंटरनल फ्रेगमेंटेशन हो सकता है, क्योंकि आवंटित अंतिम पेज पूरी तरह से भरा नहीं हो सकता है।

(c) सिस्टम कॉल और उनका उपयोग

सिस्टम कॉल एक प्रोग्रामेटिक तरीका है जिससे एक कंप्यूटर प्रोग्राम ऑपरेटिंग सिस्टम से किसी सेवा का अनुरोध कर सकता है। यह प्रक्रियाओं और ऑपरेटिंग सिस्टम के बीच एक इंटरफ़ेस प्रदान करता है। जब कोई प्रोग्राम फ़ाइल पढ़ने, डिवाइस एक्सेस करने या एक नई प्रक्रिया बनाने जैसे कार्य करना चाहता है, तो वह सीधे हार्डवेयर को कमांड नहीं दे सकता। इसके बजाय, यह OS से कार्य करने के लिए अनुरोध करने हेतु एक सिस्टम कॉल करता है।

निम्नलिखित सिस्टम कॉल की व्याख्या:

  • (i) Fork/Join:
    • Fork: यह एक नई प्रक्रिया बनाने के लिए उपयोग किया जाने वाला एक सिस्टम कॉल है। नई प्रक्रिया, जिसे चाइल्ड प्रोसेस कहा जाता है, उस प्रक्रिया की एक डुप्लिकेट कॉपी होती है जिसने इसे बनाया है, जिसे पेरेंट प्रोसेस कहा जाता है। Fork कॉल के बाद, पेरेंट और चाइल्ड दोनों प्रक्रियाएं अगले इंस्ट्रक्शन से अपना निष्पादन जारी रखती हैं।
    • Join: यह एक सिस्टम कॉल है जो पेरेंट प्रोसेस को तब तक इंतजार करने के लिए मजबूर करता है जब तक कि उसकी एक या अधिक चाइल्ड प्रक्रियाएं समाप्त नहीं हो जातीं। यह प्रक्रियाओं के बीच सिंक्रनाइज़ेशन सुनिश्चित करने के लिए उपयोगी है।
  • (ii) Suspend: यह सिस्टम कॉल एक चल रही प्रक्रिया के निष्पादन को अस्थायी रूप से रोक देता है। प्रक्रिया को “सस्पेंडेड” स्थिति में ले जाया जाता है और जब तक इसे फिर से शुरू करने का सिग्नल नहीं मिलता, तब तक यह सीपीयू समय के लिए पात्र नहीं होती है। इसका उपयोग अक्सर डिबगिंग के लिए या सिस्टम लोड को प्रबंधित करने के लिए किया जाता है।
  • (iii) Resume: यह सिस्टम कॉल एक सस्पेंडेड प्रक्रिया के निष्पादन को फिर से शुरू करता है। यह प्रक्रिया को सस्पेंडेड स्थिति से रेडी स्थिति में वापस ले जाता है, जिससे यह सीपीयू के लिए फिर से प्रतिस्पर्धा कर सकती है।
  • (iv) Exit: यह सिस्टम कॉल एक प्रक्रिया को अपना निष्पादन समाप्त करने की अनुमति देता है। जब कोई प्रक्रिया Exit कॉल करती है, तो ऑपरेटिंग सिस्टम उसके द्वारा उपयोग किए गए सभी संसाधनों (जैसे मेमोरी, खुली फाइलें) को पुनः प्राप्त कर लेता है और प्रक्रिया को सिस्टम से हटा देता है।

(d) मल्टीप्रोसेसर ऑपरेटिंग सिस्टम के प्रकार

एक मल्टीप्रोसेसर ऑपरेटिंग सिस्टम एक ऐसे कंप्यूटर सिस्टम का प्रबंधन करता है जिसमें दो या दो से अधिक सीपीयू होते हैं। ये सिस्टम प्रदर्शन और विश्वसनीयता बढ़ाते हैं। मल्टीप्रोसेसर ऑपरेटिंग सिस्टम मुख्य रूप से दो प्रकार के होते हैं:

  1. असममित मल्टीप्रोसेसिंग (Asymmetric Multiprocessing):
    • इस मॉडल को मास्टर-स्लेव आर्किटेक्चर के रूप में भी जाना जाता है।
    • एक प्रोसेसर मास्टर के रूप में कार्य करता है और ऑपरेटिंग सिस्टम चलाता है। यह सिस्टम गतिविधियों को नियंत्रित करता है और अन्य प्रोसेसरों, जिन्हें स्लेव कहा जाता है, को कार्य सौंपता है।
    • स्लेव प्रोसेसर केवल उपयोगकर्ता-स्तरीय कोड निष्पादित करते हैं या मास्टर द्वारा सौंपे गए विशिष्ट कार्यों को करते हैं।
    • लाभ: डिजाइन में सरल।
    • हानि: मास्टर प्रोसेसर एक बाधा (bottleneck) बन सकता है, और यदि मास्टर विफल हो जाता है, तो पूरा सिस्टम रुक जाता है।
  2. सममित मल्टीप्रोसेसिंग (Symmetric Multiprocessing – SMP):
    • इस मॉडल में, सभी प्रोसेसर बराबर होते हैं। प्रत्येक प्रोसेसर ऑपरेटिंग सिस्टम की एक समान प्रति चला सकता है और सिस्टम कॉल को संभाल सकता है।
    • प्रोसेसर मेमोरी और I/O उपकरणों जैसे संसाधनों को साझा करते हैं और एक दूसरे के साथ संवाद करते हैं।
    • कार्यभार सभी प्रोसेसरों में संतुलित होता है, जिससे बेहतर प्रदर्शन होता है।
    • लाभ: यह अधिक विश्वसनीय है क्योंकि एक प्रोसेसर की विफलता पूरे सिस्टम को नहीं रोकती है। यह बेहतर लोड बैलेंसिंग प्रदान करता है।
    • हानि: डिजाइन और प्रबंधन में अधिक जटिल है, क्योंकि प्रोसेसर के बीच सिंक्रनाइज़ेशन एक महत्वपूर्ण मुद्दा है।

(e) बैंकर का एल्गोरिथ्म

बैंकर का एल्गोरिथ्म एक डेडलॉक अवॉइडेंस एल्गोरिथ्म है। यह सुनिश्चित करने के लिए कि सिस्टम कभी भी असुरक्षित स्थिति में प्रवेश न करे, यह संसाधन आवंटन अनुरोधों का विश्लेषण करता है। एक स्थिति को सुरक्षित कहा जाता है यदि सिस्टम सभी प्रक्रियाओं को एक निश्चित क्रम में निष्पादित करने के लिए पर्याप्त संसाधन आवंटित कर सकता है।

दिए गए उदाहरण का विश्लेषण:

  1. उपलब्ध (Available) संसाधनों की गणना करें:
    • कुल संसाधन: A=10, B=5, C=7
    • कुल आवंटित (Total Allocation): A = 0+2+3+2+0 = 7 B = 1+0+0+1+0 = 2 C = 0+0+2+1+2 = 5
    • Available = Total – Total Allocation = (10-7, 5-2, 7-5) = (3, 3, 2) । यह दिए गए मान से मेल खाता है।
  2. आवश्यकता (Need) मैट्रिक्स की गणना करें (Need = Max – Allocation):
    • P₀ Need = (7,5,3) – (0,1,0) = (7,4,3)
    • P₁ Need = (3,2,2) – (2,0,0) = (1,2,2)
    • P₂ Need = (9,0,2) – (3,0,2) = (6,0,0)
    • P₃ Need = (2,2,2) – (2,1,1) = (0,1,1)
    • P₄ Need = (4,3,3) – (0,0,2) = (4,3,1)
  3. सुरक्षा एल्गोरिथ्म (Safety Algorithm) लागू करें:
    • प्रारंभिक Work = Available = (3, 3, 2) . Finish = [F, F, F, F, F].
    • चरण 1: प्रक्रिया P₁ की जाँच करें। Need₁ (1,2,2) ≤ Work (3,3,2)? हाँ । P₁ निष्पादित होता है। New Work = Work + Allocation₁ = (3,3,2) + (2,0,0) = (5,3,2) . Finish = [F, T, F, F, F].
    • चरण 2: प्रक्रिया P₃ की जाँच करें। Need₃ (0,1,1) ≤ Work (5,3,2)? हाँ । P₃ निष्पादित होता है। New Work = Work + Allocation₃ = (5,3,2) + (2,1,1) = (7,4,3) . Finish = [F, T, F, T, F].
    • चरण 3: प्रक्रिया P₄ की जाँच करें। Need₄ (4,3,1) ≤ Work (7,4,3)? हाँ । P₄ निष्पादित होता है। New Work = Work + Allocation₄ = (7,4,3) + (0,0,2) = (7,4,5) . Finish = [F, T, F, T, T].
    • चरण 4: प्रक्रिया P₀ की जाँच करें। Need₀ (7,4,3) ≤ Work (7,4,5)? हाँ । P₀ निष्पादित होता है। New Work = Work + Allocation₀ = (7,4,5) + (0,1,0) = (7,5,5) . Finish = [T, T, F, T, T].
    • चरण 5: प्रक्रिया P₂ की जाँच करें। Need₂ (6,0,0) ≤ Work (7,5,5)? हाँ । P₂ निष्पादित होता है। New Work = Work + Allocation₂ = (7,5,5) + (3,0,2) = (10,5,7) . Finish = [T, T, T, T, T].

चूंकि सभी प्रक्रियाओं (Finish[i] = True for all i) के लिए एक निष्पादन क्रम मिल गया है, सिस्टम एक सुरक्षित स्थिति (Safe State) में है। एक संभावित सुरक्षित अनुक्रम है

Q2. (a) इंटरप्रोसेस कम्युनिकेशन क्या है? इसकी व्याख्या करें। (4) (b) डेकर के समाधान का उपयोग करके इंटरप्रोसेस सिंक्रोनाइज़ेशन समस्या को कैसे हल करें? (6) (c) प्रोसेस शेड्यूलर से आपका क्या मतलब है? शॉर्ट-टर्म शेड्यूलर, मीडियम-टर्म शेड्यूलर और लॉन्ग-टर्म शेड्यूलर पर चर्चा करें। (5) (d) उपयुक्त आरेख के साथ वर्चुअल मेमोरी की व्याख्या करें। (5)

Ans.

(a) इंटरप्रोसेस कम्युनिकेशन (IPC)

इंटरप्रोसेस कम्युनिकेशन (IPC) उन तंत्रों (mechanisms) का एक सेट है जो ऑपरेटिंग सिस्टम प्रदान करता है ताकि विभिन्न प्रक्रियाएं एक-दूसरे के साथ डेटा का आदान-प्रदान और संचार कर सकें। सहकारी प्रक्रियाओं (cooperating processes) के लिए IPC आवश्यक है।

IPC की आवश्यकता क्यों है?

  • सूचना साझाकरण (Information Sharing): कई प्रक्रियाओं को एक ही जानकारी तक पहुंचने की आवश्यकता हो सकती है (उदाहरण के लिए, एक साझा फ़ाइल)।
  • अभिकलनात्मक गति (Computational Speedup): एक कार्य को छोटे-छोटे उप-कार्यों में विभाजित करके और उन्हें समानांतर में चलाकर, कुल निष्पादन समय को कम किया जा सकता है।
  • मॉड्यूलरिटी (Modularity): सिस्टम को मॉड्यूलर तरीके से बनाना, अर्थात सिस्टम को अलग-अलग प्रक्रियाओं या थ्रेड्स में विभाजित करना।
  • सुविधा (Convenience): एक उपयोगकर्ता एक ही समय में कई कार्यों पर काम कर सकता है, जैसे कि प्रिंटिंग, एडिटिंग और कंपाइलिंग।

IPC के दो मुख्य मॉडल हैं:

  1. साझा मेमोरी (Shared Memory): एक मेमोरी क्षेत्र बनाया जाता है जिसे कई प्रक्रियाएं साझा कर सकती हैं। प्रक्रियाओं को डेटा का आदान-प्रदान करने के लिए इस साझा क्षेत्र में लिखने और पढ़ने की अनुमति होती है। यह तेज़ है लेकिन सिंक्रनाइज़ेशन सुनिश्चित करना प्रोग्रामर की ज़िम्मेदारी है।
  2. संदेश पासिंग (Message Passing): प्रक्रियाएं एक-दूसरे को सीधे संदेश भेजकर संवाद करती हैं। यह कर्नेल की मदद से कार्यान्वित किया जाता है और साझा मेमोरी की तुलना में धीमा होता है, लेकिन सिंक्रनाइज़ेशन आसान होता है।

(b) डेकर का समाधान (Dekker’s Solution)

डेकर का समाधान दो प्रक्रियाओं के लिए म्यूचुअल एक्सक्लूजन (mutual exclusion) समस्या का पहला सही सॉफ्टवेयर-केवल समाधान है। म्यूचुअल एक्सक्लूजन यह सुनिश्चित करता है कि एक समय में केवल एक ही प्रक्रिया अपने क्रिटिकल सेक्शन (वह कोड खंड जो साझा संसाधनों तक पहुँचता है) में प्रवेश कर सके।

डेकर का समाधान दो साझा चरों (shared variables) का उपयोग करता है:

  • boolean flag[2]; : यह एक बूलियन ऐरे है। flag[i] = true इंगित करता है कि प्रक्रिया ‘i’ क्रिटिकल सेक्शन में प्रवेश करना चाहती है।
  • int turn; : यह एक पूर्णांक है जो इंगित करता है कि किसकी बारी है, यदि दोनों प्रक्रियाएं एक ही समय में प्रवेश करना चाहती हैं।

प्रक्रिया Pᵢ के लिए एल्गोरिथ्म:

while (true) { flag[i] = true; // मैं प्रवेश करना चाहता हूँ while (flag[j]) { // क्या दूसरी प्रक्रिया भी प्रवेश करना चाहती है? if (turn == j) { // यदि यह दूसरी प्रक्रिया की बारी है flag[i] = false; // तो मैं अपनी इच्छा वापस लेता हूँ while (turn == j) { // दूसरी प्रक्रिया के समाप्त होने तक प्रतीक्षा करें } flag[i] = true; // अपनी इच्छा फिर से व्यक्त करें } } // क्रिटिकल सेक्शन turn = j; // अब दूसरी प्रक्रिया की बारी है flag[i] = false; // मैं समाप्त हो गया हूँ // शेष सेक्शन } यह समाधान तीन शर्तों को पूरा करता है:

  1. म्यूचुअल एक्सक्लूजन: एक ही समय में दो प्रक्रियाएं क्रिटिकल सेक्शन में नहीं हो सकतीं।
  2. प्रगति (Progress): यदि कोई प्रक्रिया क्रिटिकल सेक्शन में नहीं है और कुछ प्रक्रियाएं प्रवेश करना चाहती हैं, तो केवल वे प्रक्रियाएं जो अपने शेष सेक्शन में नहीं हैं, चयन में भाग ले सकती हैं, और यह चयन अनिश्चित काल तक स्थगित नहीं किया जा सकता है।
  3. बाउंडेड वेटिंग (Bounded Waiting): एक प्रक्रिया के क्रिटिकल सेक्शन में प्रवेश करने के अनुरोध के बाद, अन्य प्रक्रियाओं को कितनी बार प्रवेश करने की अनुमति है, इसकी एक सीमा होती है।

(c) प्रोसेस शेड्यूलर

एक प्रोसेस शेड्यूलर ऑपरेटिंग सिस्टम का एक हिस्सा है जो यह तय करता है कि किस प्रक्रिया को किस समय और कितने समय के लिए सीपीयू आवंटित किया जाएगा। इसका मुख्य उद्देश्य सीपीयू के उपयोग को अधिकतम करना, थ्रूपुट को बढ़ाना और प्रतिक्रिया समय को कम करना है।

शेड्यूलर तीन प्रकार के होते हैं:

  • लॉन्ग-टर्म शेड्यूलर (Job Scheduler):
    • यह जॉब पूल (डिस्क पर संग्रहीत) से प्रक्रियाओं का चयन करता है और उन्हें निष्पादन के लिए मेमोरी (रेडी क्यू) में लोड करता है।
    • यह बहुत कम बार चलता है (सेकंड या मिनट में)।
    • यह सिस्टम में डिग्री ऑफ मल्टीप्रोग्रामिंग (मेमोरी में प्रक्रियाओं की संख्या) को नियंत्रित करता है।
  • शॉर्ट-टर्म शेड्यूलर (CPU Scheduler):
    • यह रेडी क्यू से एक प्रक्रिया का चयन करता है और उसे सीपीयू आवंटित करता है।
    • यह बहुत बार चलता है (मिलीसेकंड में), क्योंकि सीपीयू पर एक प्रक्रिया बदलने की आवश्यकता अक्सर होती है।
    • यह बहुत तेज होना चाहिए ताकि शेड्यूलिंग में अधिक समय बर्बाद न हो।
  • मीडियम-टर्म शेड्यूलर:
    • यह स्वैपिंग की प्रक्रिया से जुड़ा है।
    • यह मेमोरी से एक प्रक्रिया को हटाकर (उसे डिस्क पर स्वैप आउट करके) डिग्री ऑफ मल्टीप्रोग्रामिंग को कम कर सकता है। बाद में, प्रक्रिया को मेमोरी में वापस लाया जा सकता है (स्वैप इन)।
    • यह मेमोरी में प्रक्रियाओं के मिश्रण को बेहतर बनाने और सिस्टम के प्रदर्शन को अनुकूलित करने में मदद करता है।

(d) वर्चुअल मेमोरी

वर्चुअल मेमोरी एक मेमोरी मैनेजमेंट तकनीक है जो एक प्रोग्राम को उपलब्ध फिजिकल मेमोरी से बहुत बड़े एड्रेस स्पेस का उपयोग करने की अनुमति देती है। यह उपयोगकर्ता के लॉजिकल मेमोरी को फिजिकल मेमोरी से अलग करती है।

कार्यप्रणाली:

  1. पूरे प्रोग्राम को एक साथ मेमोरी में लोड करने के बजाय, केवल वही हिस्से (पेज) लोड किए जाते हैं जिनकी तत्काल आवश्यकता होती है।
  2. एक प्रक्रिया का लॉजिकल एड्रेस स्पेस सेकेंडरी स्टोरेज (जैसे डिस्क) पर संग्रहीत होता है। जब किसी पेज की आवश्यकता होती है, तो उसे फिजिकल मेमोरी में लाया जाता है।
  3. इसे आमतौर पर डिमांड पेजिंग का उपयोग करके कार्यान्वित किया जाता है। जब सीपीयू एक ऐसे पेज तक पहुंचने की कोशिश करता है जो मेमोरी में नहीं है, तो एक पेज फॉल्ट होता है।
  4. पेज फॉल्ट होने पर, ऑपरेटिंग सिस्टम हस्तक्षेप करता है, आवश्यक पेज को डिस्क से मेमोरी में लाता है, पेज टेबल को अपडेट करता है, और फिर इंस्ट्रक्शन को फिर से शुरू करता है।

लाभ:

  • बड़े प्रोग्राम चलाए जा सकते हैं।
  • डिग्री ऑफ मल्टीप्रोग्रामिंग बढ़ जाती है, क्योंकि प्रत्येक प्रोग्राम मेमोरी में कम जगह लेता है।
  • प्रोग्राम निर्माण आसान हो जाता है क्योंकि प्रोग्रामर को फिजिकल मेमोरी की कमी के बारे में चिंता करने की आवश्यकता नहीं होती है।

आरेख:

एक उपयुक्त आरेख में निम्नलिखित तत्व शामिल होंगे:

  • लॉजिकल एड्रेस स्पेस: डिस्क पर संग्रहीत।
  • पेज टेबल: लॉजिकल पेजों को फिजिकल फ्रेम में मैप करता है। इसमें एक वैलिड-इनवैलिड बिट होता है यह इंगित करने के लिए कि पेज मेमोरी में है या नहीं।
  • फिजिकल मेमोरी: जिसमें कुछ पेज लोड होते हैं।
  • सेकेंडरी मेमोरी (डिस्क): जहां पूरा लॉजिकल एड्रेस स्पेस संग्रहीत होता है।

जब सीपीयू एक लॉजिकल एड्रेस उत्पन्न करता है, तो MMU (मेमोरी मैनेजमेंट यूनिट) पेज टेबल का उपयोग करके इसे ट्रांसलेट करने का प्रयास करता है। यदि वैलिड-इनवैलिड बिट ‘इनवैलिड’ है, तो पेज फॉल्ट ट्रैप उत्पन्न होता है।

Q3. (a) डिस्क मैनेजमेंट क्या है? यह कैसे काम करता है? उपयुक्त आरेख के साथ कंटीन्यूअस और नॉन-कंटीन्यूअस मेमोरी एलोकेशन की व्याख्या करें। (10) (b) एक्सेस मैट्रिक्स सुरक्षा मॉडल का विस्तार से वर्णन करें। (6) (c) रूल-बेस्ड एक्सेस कंट्रोल और रोल-बेस्ड एक्सेस कंट्रोल के बीच अंतर करें। (4)

Ans.

(a) डिस्क मैनेजमेंट और एलोकेशन मेथड्स

डिस्क मैनेजमेंट ऑपरेटिंग सिस्टम के उन कार्यों को संदर्भित करता है जो डिस्क ड्राइव जैसे सेकेंडरी स्टोरेज उपकरणों के प्रबंधन से संबंधित हैं। इसमें शामिल हैं:

  • डिस्क फॉर्मेटिंग: डिस्क को उपयोग के लिए तैयार करना, जिसमें इसे सेक्टरों में विभाजित करना और एक फाइल सिस्टम बनाना शामिल है।
  • बूटिंग: कंप्यूटर को शुरू करने के लिए बूटस्ट्रैप प्रोग्राम को लोड करना।
  • बैड ब्लॉक रिकवरी: खराब या क्षतिग्रस्त सेक्टरों का पता लगाना और उन्हें चिह्नित करना।
  • फाइल सिस्टम मैनेजमेंट: फाइलों के लिए डिस्क स्थान का आवंटन और मुक्त स्थान का प्रबंधन।

डिस्क स्पेस को फाइलों को आवंटित करने के तीन मुख्य तरीके हैं:

1. कंटीन्यूअस एलोकेशन (Contiguous Allocation):

  • प्रत्येक फ़ाइल डिस्क पर सन्निहित (contiguous) ब्लॉकों के एक सेट पर कब्जा कर लेती है।
  • उदाहरण के लिए, यदि कोई फ़ाइल 5 ब्लॉकों की है और ब्लॉक 10 से शुरू होती है, तो यह ब्लॉक 10, 11, 12, 13, और 14 पर कब्जा कर लेगी।
  • लाभ: सरल और तेज सीक्वेंशियल और रैंडम एक्सेस प्रदान करता है क्योंकि फ़ाइल के सभी ब्लॉक एक साथ होते हैं।
  • हानि: यह एक्सटर्नल फ्रेगमेंटेशन से ग्रस्त है। समय के साथ, डिस्क पर खाली स्थान छोटे-छोटे टुकड़ों में बिखर जाता है, जो किसी नई फ़ाइल को आवंटित करने के लिए बहुत छोटे हो सकते हैं, भले ही कुल मुक्त स्थान पर्याप्त हो।
  • आरेख: एक डिस्क का नक्शा दिखाएं जिसमें कुछ फाइलें सन्निहित ब्लॉकों में संग्रहीत हैं और उनके बीच खाली स्थान के टुकड़े (होल) हैं।

2. नॉन-कंटीन्यूअस एलोकेशन (Non-Contiguous Allocation): यह एक्सटर्नल फ्रेगमेंटेशन की समस्या को हल करता है। इसके मुख्य प्रकार हैं:

  • लिंक्ड एलोकेशन (Linked Allocation):
    • फ़ाइल के प्रत्येक ब्लॉक में अगले ब्लॉक के लिए एक पॉइंटर होता है। डायरेक्टरी एंट्री में फ़ाइल के पहले और अंतिम ब्लॉक का पता होता है।
    • लाभ: कोई एक्सटर्नल फ्रेगमेंटेशन नहीं होता है। फ़ाइल का आकार आसानी से बढ़ाया जा सकता है।
    • हानि: केवल सीक्वेंशियल एक्सेस कुशल है। रैंडम एक्सेस बहुत धीमा है क्योंकि किसी ब्लॉक तक पहुंचने के लिए शुरुआत से सभी पॉइंटर्स को फॉलो करना पड़ता है। पॉइंटर्स के लिए स्थान की बर्बादी होती है।
    • आरेख: ब्लॉकों को दिखाएं जो डिस्क पर बिखरे हुए हैं और तीरों (पॉइंटर्स) द्वारा एक दूसरे से जुड़े हुए हैं।
  • इंडेक्स्ड एलोकेशन (Indexed Allocation):
    • प्रत्येक फ़ाइल के लिए एक विशेष ब्लॉक, जिसे इंडेक्स ब्लॉक कहा जाता है, बनाया जाता है। इस इंडेक्स ब्लॉक में फ़ाइल के सभी डेटा ब्लॉकों के पते होते हैं।
    • लाभ: कोई एक्सटर्नल फ्रेगमेंटेशन नहीं होता है और यह रैंडम एक्सेस का समर्थन करता है।
    • हानि: छोटी फाइलों के लिए इंडेक्स ब्लॉक के कारण स्थान की बर्बादी होती है। बड़ी फाइलों के लिए, एक सिंगल इंडेक्स ब्लॉक पर्याप्त नहीं हो सकता है, जिससे लिंकिंग या मल्टी-लेवल इंडेक्सिंग जैसी योजनाओं की आवश्यकता होती है।
    • आरेख: एक इंडेक्स ब्लॉक दिखाएं जो डिस्क पर बिखरे हुए विभिन्न डेटा ब्लॉकों को इंगित करता है।

(b) एक्सेस मैट्रिक्स सुरक्षा मॉडल

एक्सेस मैट्रिक्स एक सैद्धांतिक सुरक्षा मॉडल है जो सिस्टम में सुरक्षा नीतियों को परिभाषित और लागू करने के लिए उपयोग किया जाता है। यह मॉडल बताता है कि कौन से विषय (subjects) किन वस्तुओं (objects) पर कौन से ऑपरेशन कर सकते हैं।

संरचना:

  • मैट्रिक्स एक द्वि-आयामी संरचना है।
  • पंक्तियाँ (Rows) विषयों (Subjects) का प्रतिनिधित्व करती हैं। विषय सक्रिय इकाइयाँ हैं जो ऑपरेशन करती हैं, जैसे उपयोगकर्ता या प्रक्रियाएं।
  • कॉलम (Columns) वस्तुओं (Objects) का प्रतिनिधित्व करते हैं। वस्तुएं निष्क्रिय इकाइयाँ हैं जिन पर ऑपरेशन किए जाते हैं, जैसे फाइलें, डिवाइस या मेमोरी सेगमेंट।
  • मैट्रिक्स की प्रत्येक प्रविष्टि Access[i, j] उन ऑपरेशनों (Operations) के सेट को परिभाषित करती है जो विषय ‘i’ वस्तु ‘j’ पर कर सकता है (जैसे, पढ़ना, लिखना, निष्पादित करना)।

उदाहरण:

| File F1 | File F2 | Printer —————————————— User A | read | read | print | write | | —————————————— User B | | read |

कार्यान्वयन (Implementation): चूंकि एक्सेस मैट्रिक्स आमतौर पर बहुत विरल (sparse) होता है, इसलिए इसे सीधे लागू करना अव्यावहारिक है। इसके बजाय, निम्नलिखित तरीकों का उपयोग किया जाता है:

  1. एक्सेस कंट्रोल लिस्ट (Access Control Lists – ACLs):
    • यह मैट्रिक्स के कॉलम के अनुरूप है।
    • प्रत्येक वस्तु के लिए, एक सूची होती है जो उन सभी विषयों और उनके अनुमत ऑपरेशनों को निर्दिष्ट करती है।
    • जब कोई विषय किसी वस्तु तक पहुंचने का प्रयास करता है, तो सिस्टम उस वस्तु की ACL की जांच करता है।
    • यह विंडोज एनटी जैसे कई ऑपरेटिंग सिस्टम में उपयोग किया जाता है।
  2. कैपेबिलिटी लिस्ट्स (Capability Lists):
    • यह मैट्रिक्स की पंक्तियों के अनुरूप है।
    • प्रत्येक विषय के लिए, एक सूची होती है जो उन सभी वस्तुओं और उन पर किए जा सकने वाले ऑपरेशनों को निर्दिष्ट करती है।
    • एक कैपेबिलिटी एक टोकन की तरह है जिसे विषय पहुंच प्राप्त करने के लिए प्रस्तुत करता है।
    • इन्हें प्रबंधित करना अधिक कठिन हो सकता है।

(c) रूल-बेस्ड और रोल-बेस्ड एक्सेस कंट्रोल में अंतर

आधार

रूल-बेस्ड एक्सेस कंट्रोल (Rule-BAC)

रोल-बेस्ड एक्सेस कंट्रोल (Role-BAC)

परिभाषा

पहुंच का निर्णय प्रशासक द्वारा निर्धारित नियमों या नीतियों के एक सेट के आधार पर किया जाता है।

पहुंच का निर्णय संगठन के भीतर उपयोगकर्ता की भूमिका (role) के आधार पर किया जाता है।

मुख्य अवधारणा

“यदि-तब” (if-then) तर्क पर आधारित है। उदाहरण: “यदि समय सुबह 9 बजे से शाम 5 बजे के बीच है, तो फ़ाइल तक पहुंच की अनुमति दें।”

अनुमतियाँ भूमिकाओं को सौंपी जाती हैं, और उपयोगकर्ता भूमिकाओं को सौंपे जाते हैं। उदाहरण: “प्रबंधक” भूमिका वाले सभी उपयोगकर्ता वित्तीय रिपोर्ट तक पहुंच सकते हैं।

लचीलापन

बहुत लचीला और सूक्ष्म-स्तरीय नियंत्रण प्रदान करता है। नियम बहुत विशिष्ट हो सकते हैं।

कम लचीला लेकिन प्रशासन में आसान। नीतियां उपयोगकर्ता की भूमिका से जुड़ी होती हैं, व्यक्ति से नहीं।

प्रशासन

जटिल हो सकता है क्योंकि नियमों का एक बड़ा सेट प्रबंधित करना पड़ता है।

सरल। उपयोगकर्ता की नौकरी बदलने पर, केवल उसकी भूमिका बदलने की आवश्यकता होती है, व्यक्तिगत अनुमतियों की नहीं।

उदाहरण उपयोग

फायरवॉल, नेटवर्क राउटर।

कॉर्पोरेट डेटाबेस, स्वास्थ्य सेवा प्रणाली।

Q4. (a) विंडोज 2000 में मेमोरी मैनेजमेंट तकनीक की व्याख्या करें। (6) (b) एक डिस्ट्रिब्यूटेड सिस्टम में शामिल डिजाइन मुद्दों पर चर्चा करें। (6) (c) मल्टीप्रोसेसर-सिंक्रोनाइज़ेशन क्या है? निम्नलिखित कैसे काम करते हैं, इसकी व्याख्या करें: (i) Test-and-Set (ii) Compare-and-Swap (iii) Fetch-and-Add (8)

Ans.

(a) विंडोज 2000 में मेमोरी मैनेजमेंट

विंडोज 2000 एक उन्नत मेमोरी मैनेजमेंट सिस्टम का उपयोग करता है जो वर्चुअल मेमोरी , डिमांड पेजिंग और पेज रिप्लेसमेंट पर आधारित है।

मुख्य विशेषताएं:

  1. वर्चुअल एड्रेस स्पेस:
    • यह एक 32-बिट फ्लैट एड्रेस स्पेस का उपयोग करता है, जो प्रत्येक प्रक्रिया को 4 GB का निजी वर्चुअल एड्रेस स्पेस प्रदान करता है।
    • यह 4 GB स्पेस दो भागों में विभाजित है: 2 GB उपयोगकर्ता प्रक्रियाओं के लिए (User Space) और 2 GB ऑपरेटिंग सिस्टम कर्नेल के लिए (Kernel Space)।
  2. डिमांड पेजिंग विद क्लस्टरिंग:
    • पेजों को केवल तभी मेमोरी में लाया जाता है जब उनकी आवश्यकता होती है (डिमांड पेजिंग)।
    • जब एक पेज फॉल्ट होता है, तो विंडोज न केवल आवश्यक पेज को लाता है, बल्कि उसके आसपास के कुछ पेजों को भी लाता है। इसे क्लस्टरिंग कहा जाता है, जो स्पेशियल लोकैलिटी के सिद्धांत का लाभ उठाकर प्रदर्शन में सुधार करता है।
  3. वर्किंग सेट मॉडल (Working Set Model):
    • प्रत्येक प्रक्रिया का एक वर्किंग सेट होता है, जो उन पेजों का समूह है जिनकी प्रक्रिया को हाल ही में आवश्यकता पड़ी है।
    • मेमोरी मैनेजर यह सुनिश्चित करने का प्रयास करता है कि निष्पादन के लिए तैयार प्रत्येक प्रक्रिया का वर्किंग सेट फिजिकल मेमोरी में हो।
    • यदि मेमोरी की कमी होती है, तो मेमोरी मैनेजर प्रक्रियाओं के वर्किंग सेट को “ट्रिम” कर सकता है, यानी उन पेजों को हटा सकता है जिनका हाल ही में उपयोग नहीं किया गया है।
  4. पेज रिप्लेसमेंट एल्गोरिथ्म:
    • विंडोज 2000 एक स्थानीय पेज रिप्लेसमेंट नीति का उपयोग करता है जो LRU (Least Recently Used) का एक प्रकार है।
    • यह एक क्लॉक-आधारित दृष्टिकोण का उपयोग करता है, जहां यह जांचता है कि हाल ही में किसी पेज का उपयोग किया गया है या नहीं। यदि नहीं, तो उसे रिप्लेसमेंट के लिए एक उम्मीदवार माना जाता है।
  5. पेज फ्रेम डेटाबेस: VMM (वर्चुअल मेमोरी मैनेजर) एक पेज फ्रेम डेटाबेस बनाए रखता है जो फिजिकल मेमोरी के प्रत्येक पेज फ्रेम की स्थिति (जैसे फ्री, यूज्ड, मॉडिफाइड) को ट्रैक करता है।

(b) डिस्ट्रिब्यूटेड सिस्टम में डिजाइन के मुद्दे

एक डिस्ट्रिब्यूटेड सिस्टम कई स्वायत्त कंप्यूटरों का एक संग्रह है जो एक नेटवर्क के माध्यम से जुड़े होते हैं और उपयोगकर्ताओं को एक एकल, सुसंगत सिस्टम के रूप में दिखाई देते हैं। इसके डिजाइन में कई चुनौतियां और मुद्दे शामिल हैं:

  • पारदर्शिता (Transparency): सिस्टम की वितरित प्रकृति को उपयोगकर्ताओं और अनुप्रयोगों से छिपाने का लक्ष्य। इसके विभिन्न रूप हैं:
    • एक्सेस ट्रांसपेरेंसी: स्थानीय और दूरस्थ संसाधनों तक एक समान तरीके से पहुंच।
    • लोकेशन ट्रांसपेरेंसी: संसाधनों के भौतिक स्थान को छिपाना।
    • माइग्रेशन ट्रांसपेरेंसी: प्रदर्शन में सुधार के लिए सिस्टम द्वारा संसाधनों को स्थानांतरित करने की क्षमता को छिपाना।
    • फेलियर ट्रांसपेरेंसी: हार्डवेयर या सॉफ्टवेयर की विफलताओं से उबरने की क्षमता को छिपाना।
  • विश्वसनीयता और दोष सहिष्णुता (Reliability and Fault Tolerance): सिस्टम को नोड या लिंक विफलताओं के बावजूद कार्य करना जारी रखना चाहिए। यह अतिरेक (redundancy) – डेटा और सेवाओं की प्रतियां रखना – के माध्यम से प्राप्त किया जाता है।
  • स्केलेबिलिटी (Scalability): सिस्टम को आकार (नोड्स की संख्या) में बढ़ने पर भी प्रभावी और कुशल बने रहना चाहिए। स्केलेबिलिटी प्राप्त करने के लिए केंद्रीकृत घटकों से बचना महत्वपूर्ण है।
  • प्रदर्शन (Performance): अच्छा प्रतिक्रिया समय और थ्रूपुट प्राप्त करना एक मुख्य लक्ष्य है। नेटवर्क संचार ओवरहेड प्रदर्शन को महत्वपूर्ण रूप से प्रभावित कर सकता है। लोड बैलेंसिंग तकनीकें महत्वपूर्ण हैं।
  • सिंक्रोनाइज़ेशन (Synchronization): वितरित वातावरण में घड़ियों को सिंक्रनाइज़ करना, म्यूचुअल एक्सक्लूजन लागू करना और डेडलॉक का पता लगाना या उसे रोकना जटिल है क्योंकि कोई वैश्विक घड़ी या साझा मेमोरी नहीं है।
  • सुरक्षा (Security): डेटा को एन्क्रिप्ट करना, उपयोगकर्ताओं और सर्वरों को प्रमाणित करना, और पहुंच नियंत्रण लागू करना आवश्यक है ताकि नेटवर्क पर अनधिकृत पहुंच और हमलों से बचा जा सके।

(c) मल्टीप्रोसेसर-सिंक्रोनाइज़ेशन

मल्टीप्रोसेसर-सिंक्रोनाइज़ेशन उन तंत्रों को संदर्भित करता है जो यह सुनिश्चित करते हैं कि कई प्रोसेसर पर चलने वाली समवर्ती प्रक्रियाएं या थ्रेड्स बिना किसी टकराव के साझा संसाधनों तक पहुंच सकें। चूंकि कई प्रोसेसर एक ही समय में मेमोरी तक पहुंच सकते हैं, इसलिए रेस कंडीशन को रोकने के लिए विशेष हार्डवेयर समर्थन की आवश्यकता होती है।

निम्नलिखित सिंक्रोनाइज़ेशन हार्डवेयर की व्याख्या:

  • (i) Test-and-Set:
    • यह एक परमाणु (atomic) निर्देश है, जिसका अर्थ है कि यह बिना किसी रुकावट के पूरा होता है।
    • यह एक मेमोरी लोकेशन (एक बूलियन वैरिएबल) के मान को पढ़ता है और उसे एक ही अविभाज्य ऑपरेशन में `true` पर सेट करता है। यह उस लोकेशन का पुराना मान लौटाता है।
    • कार्यप्रणाली: boolean TestAndSet(boolean lock) { boolean old_value = lock; *lock = true; return old_value; }
    • इसका उपयोग म्यूचुअल एक्सक्लूजन के लिए एक स्पिनलॉक को लागू करने के लिए किया जा सकता है: while (TestAndSet(&lock)); । यदि लॉक पहले से ही `true` है, तो प्रक्रिया लूप में घूमती रहती है (बिजी वेटिंग)।
  • (ii) Compare-and-Swap (CAS):
    • यह एक और परमाणु निर्देश है जो Test-and-Set से अधिक शक्तिशाली है।
    • यह तीन पैरामीटर लेता है: एक मेमोरी लोकेशन का पता, एक अपेक्षित मान, और एक नया मान।
    • यह परमाणु रूप से मेमोरी लोकेशन की सामग्री की तुलना अपेक्षित मान से करता है। यदि वे बराबर हैं, तो यह मेमोरी लोकेशन को नए मान से अपडेट करता है। यह हमेशा मेमोरी लोकेशन का मूल मान लौटाता है।
    • कार्यप्रणाली: int CompareAndSwap(int value, int expected, int new_value) { int temp = value; if ( value == expected) value = new_value; return temp; }
    • इसका उपयोग जटिल लॉक-फ्री और वेट-फ्री डेटा संरचनाओं को लागू करने के लिए किया जा सकता है।
  • (iii) Fetch-and-Add:
    • यह एक परमाणु निर्देश है जो एक मेमोरी लोकेशन के मान को एक निश्चित राशि से बढ़ाता है और उस लोकेशन का पुराना मान लौटाता है।
    • कार्यप्रणाली: int FetchAndAdd(int value, int increment) { int temp = value; *value = temp + increment; return temp; }
    • यह बहुत उपयोगी है जब कई प्रक्रियाओं को एक साझा काउंटर को अपडेट करने की आवश्यकता होती है या जब उन्हें बिना किसी स्पष्ट लॉकिंग के अद्वितीय आईडी आवंटित करने की आवश्यकता होती है। यह बिजी वेटिंग के बिना म्यूचुअल एक्सक्लूजन को लागू करने में मदद कर सकता है।

Q5. निम्नलिखित पर संक्षिप्त नोट्स लिखें: 5×4=20 (i) सेमाफोर (ii) RAID (iii) क्रॉसबार-कनेक्टेड सिस्टम (iv) राउंड रॉबिन शेड्यूलिंग एल्गोरिथ्म (v) SCAN और C-SCAN डिस्क शेड्यूलिंग एल्गोरिथ्म

Ans.

(i) सेमाफोर (Semaphore)

एक सेमाफोर एक सिंक्रनाइज़ेशन टूल है जिसे एडस्गर डिज्क्स्ट्रा द्वारा प्रस्तावित किया गया था। यह एक पूर्णांक वैरिएबल है जिसे दो परमाणु (atomic) ऑपरेशनों के माध्यम से ही एक्सेस किया जा सकता है: wait() और signal() ।

  • wait() ऑपरेशन (या P()): यह सेमाफोर के मान को एक से घटाता है। यदि मान ऋणात्मक हो जाता है, तो wait() को कॉल करने वाली प्रक्रिया ब्लॉक हो जाती है और एक प्रतीक्षा कतार में डाल दी जाती है।
  • signal() ऑपरेशन (या V()): यह सेमाफोर के मान को एक से बढ़ाता है। यदि मान शून्य या ऋणात्मक है, तो यह प्रतीक्षा कतार से एक प्रक्रिया को जगाता है।

सेमाफोर दो प्रकार के होते हैं:

  1. काउंटिंग सेमाफोर: इसका मान किसी भी गैर-ऋणात्मक पूर्णांक हो सकता है। इसका उपयोग सीमित संख्या में संसाधनों वाले संसाधन को नियंत्रित करने के लिए किया जाता है।
  2. बाइनरी सेमाफोर (म्यूटेक्स): इसका मान केवल 0 या 1 हो सकता है। इसका उपयोग म्यूचुअल एक्सक्लूजन समस्याओं को हल करने के लिए किया जाता है।

सेमाफोर क्रिटिकल सेक्शन समस्या और अन्य जटिल सिंक्रनाइज़ेशन समस्याओं को हल करने के लिए एक शक्तिशाली उपकरण है।

(ii) RAID (Redundant Array of Independent Disks)

RAID एक डेटा स्टोरेज वर्चुअलाइजेशन तकनीक है जो डेटा रिडंडेंसी, प्रदर्शन सुधार, या दोनों के लिए कई फिजिकल डिस्क ड्राइव को एक या अधिक लॉजिकल यूनिट में जोड़ती है। विभिन्न RAID स्तर अलग-अलग ट्रेड-ऑफ प्रदान करते हैं।

  • RAID 0 (स्ट्राइपिंग): डेटा को कई डिस्कों में ब्लॉक में विभाजित (स्ट्राइप) किया जाता है। यह उच्च प्रदर्शन (पढ़ने/लिखने की गति) प्रदान करता है क्योंकि कई डिस्क एक साथ काम करते हैं। इसमें कोई रिडंडेंसी नहीं है; एक डिस्क की विफलता से सारा डेटा खो जाता है।
  • RAID 1 (मिररिंग): डेटा को दो या दो से अधिक डिस्कों पर डुप्लिकेट किया जाता है। यह उत्कृष्ट रिडंडेंसी और दोष सहिष्णुता प्रदान करता है। यदि एक डिस्क विफल हो जाती है, तो डेटा मिरर डिस्क से पुनर्प्राप्त किया जा सकता है। लिखने का प्रदर्शन धीमा हो सकता है।
  • RAID 5 (पैरिटी के साथ स्ट्राइपिंग): डेटा और पैरिटी जानकारी को सभी डिस्कों में वितरित किया जाता है। यह प्रदर्शन और रिडंडेंसी के बीच एक अच्छा संतुलन प्रदान करता है। यह एक डिस्क की विफलता को सहन कर सकता है।
  • RAID 6 (डबल पैरिटी के साथ स्ट्राइपिंग): RAID 5 के समान, लेकिन यह दो स्वतंत्र पैरिटी ब्लॉकों का उपयोग करता है। यह दो डिस्कों की एक साथ विफलता को सहन कर सकता है, जिससे यह अधिक विश्वसनीय बन जाता है।

(iii) क्रॉसबार-कनेक्टेड सिस्टम (Crossbar-Connected System)

एक क्रॉसबार-कनेक्टेड सिस्टम, जिसे क्रॉसबार स्विच के रूप में भी जाना जाता है, एक मल्टीप्रोसेसर इंटरकनेक्शन नेटवर्क है। यह एक स्विच मैट्रिक्स का उपयोग करता है ताकि सिस्टम में किसी भी प्रोसेसर को किसी भी मेमोरी मॉड्यूल से सीधे जोड़ा जा सके।

  • संरचना: N प्रोसेसर और M मेमोरी मॉड्यूल वाले सिस्टम के लिए, क्रॉसबार में N x M स्विचों का एक ग्रिड होता है। प्रोसेसर ‘i’ और मेमोरी ‘j’ के चौराहे पर स्थित स्विच उन दोनों के बीच एक समर्पित पथ बना सकता है।
  • लाभ: यह उच्च प्रदर्शन प्रदान करता है क्योंकि यह विभिन्न मेमोरी मॉड्यूल के लिए एक साथ, गैर-अवरुद्ध (non-blocking) पहुंच की अनुमति देता है। जब तक दो प्रोसेसर एक ही मेमोरी मॉड्यूल तक पहुंचने का प्रयास नहीं करते, तब तक कोई टकराव नहीं होता है।
  • हानि: क्रॉसबार सिस्टम बहुत महंगे और जटिल होते हैं। आवश्यक स्विचों की संख्या (N * M) प्रोसेसर और मेमोरी मॉड्यूल की संख्या के साथ तेजी से बढ़ती है, जिससे यह बड़े सिस्टम के लिए अव्यावहारिक हो जाता है।

(iv) राउंड रॉबिन शेड्यूलिंग एल्गोरिथ्म (Round Robin Scheduling Algorithm)

राउंड रॉबिन (RR) एक सीपीयू शेड्यूलिंग एल्गोरिथ्म है जिसे विशेष रूप से टाइम-शेयरिंग सिस्टम के लिए डिज़ाइन किया गया है। यह एक प्रीएम्प्टिव एल्गोरिथ्म है।

  • कार्यप्रणाली: रेडी क्यू को एक FIFO (फर्स्ट-इन, फर्स्ट-आउट) क्यू के रूप में माना जाता है। प्रत्येक प्रक्रिया को एक छोटा समय अंतराल दिया जाता है, जिसे टाइम क्वांटम या टाइम स्लाइस (आमतौर पर 10-100 मिलीसेकंड) कहा जाता है।
  • सीपीयू शेड्यूलर रेडी क्यू से पहली प्रक्रिया का चयन करता है, टाइमर को एक क्वांटम के लिए सेट करता है, और प्रक्रिया को सीपीयू आवंटित करता है।
  • यदि प्रक्रिया अपने क्वांटम के समाप्त होने से पहले समाप्त हो जाती है, तो यह सीपीयू को छोड़ देती है। अन्यथा, टाइमर इंटरप्ट उत्पन्न होता है, और ऑपरेटिंग सिस्टम प्रक्रिया को प्रीएम्प्ट करता है और उसे रेडी क्यू के अंत में रख देता है।
  • प्रदर्शन: RR का प्रदर्शन काफी हद तक टाइम क्वांटम के आकार पर निर्भर करता है। यदि क्वांटम बहुत बड़ा है, तो यह FCFS की तरह व्यवहार करता है। यदि यह बहुत छोटा है, तो संदर्भ स्विचिंग (context switching) का ओवरहेड बहुत अधिक हो जाता है। यह अच्छा प्रतिक्रिया समय प्रदान करता है और भुखमरी (starvation) को रोकता है।

(v) SCAN और C-SCAN डिस्क शेड्यूलिंग एल्गोरिथ्म

ये डिस्क आर्म की गति को अनुकूलित करके डिस्क एक्सेस समय को कम करने के लिए उपयोग किए जाने वाले एल्गोरिदम हैं।

  • SCAN (एलिवेटर एल्गोरिथ्म):
    • डिस्क आर्म डिस्क के एक छोर से शुरू होता है और दूसरे छोर की ओर बढ़ता है, रास्ते में आने वाले सभी अनुरोधों को पूरा करता है।
    • जब यह दूसरे छोर पर पहुंचता है, तो यह अपनी दिशा उलट देता है और वापस जाते समय अनुरोधों को पूरा करना जारी रखता है।
    • यह उन सिलेंडरों के प्रति पक्षपाती हो सकता है जो हाल ही में पार किए गए हैं और जो किनारों पर हैं उन्हें अधिक प्रतीक्षा करनी पड़ सकती है।
  • C-SCAN (सर्कुलर SCAN):
    • यह SCAN का एक संस्करण है जो अधिक समान प्रतीक्षा समय प्रदान करता है।
    • SCAN की तरह, हेड डिस्क के एक छोर से दूसरे छोर तक जाता है, रास्ते में अनुरोधों को पूरा करता है।
    • हालांकि, जब यह दूसरे छोर पर पहुंचता है, तो यह तुरंत डिस्क की शुरुआत में लौटता है, बिना किसी अनुरोध को पूरा किए ।
    • यह एक गोलाकार सूची की तरह व्यवहार करता है, जिससे यह सुनिश्चित होता है कि सभी सिलेंडरों को उचित अवसर मिले।

IGNOU MCS-041 Previous Year Solved Question Paper in English

Q1. (a) Why is operating system needed in computer system? Explain generations of operating systems. (7) (b) What is paging? Discuss basic paging technique in detail. (8) (c) What are system calls and their use? Explain the following system calls: (i) Fork/Join (ii) Suspend (iii) Resume (iv) Exit (10) (d) List the types of multiprocessor operating system and explain any two types of it. (5) (e) What is Banker’s algorithm? Apply Banker’s algorithm to check safe or unsafe state in the following example: (10) No. of Processes 5 : (P₀, P₁, P₂, P₃, P₄) No. of Resources 3 : A (10 instances), B (5 instances), C (7 instances) at time T₀ Allocation Max. Available Process A B C A B C A B C P₀ 0 1 0 7 5 3 3 3 2 P₁ 2 0 0 3 2 2 P₂ 3 0 2 9 0 2 P₃ 2 1 1 2 2 2 P₄ 0 0 2 4 3 3

Ans. (a) Need for an Operating System and its Generations An Operating System (OS) is system software that manages computer hardware and software resources and provides common services for computer programs. It acts as an intermediary between the user and the computer hardware. Need for an Operating System:

  • Resource Management: The OS manages and allocates all resources such as CPU time, memory space, file storage space, and I/O devices among the various competing processes.
  • Abstraction: It hides the complexities of the hardware from users and applications, making the computer easier to use. For example, it provides a simple file interface instead of dealing with the details of disk hardware.
  • Security and Protection: It ensures the security of the system by preventing interference between different processes and users. It also prevents unauthorized access to resources.
  • Process Management: It handles the creation and termination of processes, and manages their synchronization and communication.
  • User Interface: It provides a user interface, which can be a Command-Line Interface (CLI) or a Graphical User Interface (GUI), allowing users to interact with the computer.


Generations of Operating Systems:

  1. First Generation (1940s-1950s): In this generation, there were no operating systems. Programmers interacted directly with the hardware using machine language.
  2. Second Generation (1950s-1960s): This era saw the emergence of Batch Processing Systems . Jobs were grouped together in batches and executed one by one by the computer, reducing setup time. A resident monitor program was a rudimentary form of OS.
  3. Third Generation (1960s-1970s): This generation introduced Multiprogramming and Time-Sharing systems. Multiprogramming allowed multiple jobs to reside in memory simultaneously, increasing CPU utilization. Time-sharing (multitasking) allowed multiple users to share the computer system concurrently.
  4. Fourth Generation (1980s-Present): This generation saw the development of Personal Computers (PCs) . It led to the creation of Graphical User Interfaces (GUIs), networking, and distributed operating systems. Today, we use mobile operating systems (like Android, iOS) and cloud-based operating systems.


(b) Paging Technique

Paging

is a memory management scheme that permits a process’s physical address space to be non-contiguous. It solves the problem of external fragmentation.


Basic Paging Technique:

  1. Division of Memory:
    • Physical Memory is divided into fixed-sized blocks called Frames .
    • Logical Memory (the address space of a process) is divided into blocks of the same size called Pages . The size of a page is the same as the size of a frame.
  2. Address Translation:
    • Every address generated by the CPU (a logical address) is divided into two parts: a page number (p) and an offset (d) .
    • The page number is used as an index into a page table . The page table contains the base address of each page in physical memory, i.e., its corresponding frame number.
    • The frame number (f) obtained from the page table is combined with the offset (d) to form the physical address .
  3. Page Table: This is a data structure used by the operating system for each process to map logical addresses to physical addresses. The Page Table Base Register (PTBR) stores the starting address of the page table.
  4. Implementation: When a process is to be executed, its pages can be loaded into any available free frames in memory. These frames need not be contiguous. The OS maintains a free-frame list.

A key advantage of paging is that it completely eliminates external fragmentation. However, it can suffer from

internal fragmentation

, as the last allocated page may not be completely full.

(c) System Calls and Their Use A system call is the programmatic way in which a computer program requests a service from the kernel of the operating system. It provides the interface between a process and the operating system. When a program wants to perform tasks like reading a file, accessing a device, or creating a new process, it cannot command the hardware directly. Instead, it makes a system call to request the OS to perform the task.

Explanation of the following system calls:

  • (i) Fork/Join:
    • Fork: This is a system call used to create a new process. The new process, called the child process , is a duplicate of the process that created it, called the parent process . After a fork call, both the parent and child processes continue their execution from the next instruction.
    • Join: This is a system call that forces a parent process to wait until one or more of its child processes have terminated. It is useful for ensuring synchronization between processes.
  • (ii) Suspend: This system call temporarily stops the execution of a running process. The process is moved to a “suspended” state and is not eligible for CPU time until it receives a signal to resume. It is often used for debugging or for managing system load.
  • (iii) Resume: This system call restarts the execution of a suspended process. It moves the process from the suspended state back to the ready state, allowing it to compete for the CPU again.
  • (iv) Exit: This system call allows a process to terminate its execution. When a process calls exit, the operating system reclaims all the resources used by it (such as memory, open files) and removes the process from the system.


(d) Types of Multiprocessor Operating Systems

A multiprocessor operating system manages a computer system with two or more CPUs, providing increased performance and reliability. There are primarily two types of multiprocessor operating systems:

  1. Asymmetric Multiprocessing:
    • This model is also known as the master-slave architecture.
    • One processor acts as the master and runs the operating system. It controls the system activities and assigns tasks to the other processors, which are called slaves .
    • The slave processors only execute user-level code or specific tasks assigned by the master.
    • Advantage: Simple in design.
    • Disadvantage: The master processor can become a bottleneck, and if the master fails, the entire system halts.
  2. Symmetric Multiprocessing (SMP):
    • In this model, all processors are peers. Each processor can run an identical copy of the operating system and can handle system calls.
    • The processors share resources like memory and I/O devices and communicate with each other.
    • The workload is balanced across all processors, leading to better performance.
    • Advantage: It is more reliable because the failure of one processor does not stop the entire system. It provides better load balancing.
    • Disadvantage: More complex to design and manage, as synchronization between processors is a critical issue.


(e) Banker’s Algorithm

The

Banker’s Algorithm

is a deadlock avoidance algorithm. It analyzes resource allocation requests to ensure that the system never enters an unsafe state. A state is considered

safe

if the system can allocate resources to each process (up to its maximum) in some order and still avoid a deadlock.


Analysis of the given example:

  1. Calculate Available Resources:
    • Total Resources: A=10, B=5, C=7
    • Total Allocation: A = 0+2+3+2+0 = 7 B = 1+0+0+1+0 = 2 C = 0+0+2+1+2 = 5
    • Available = Total – Total Allocation = (10-7, 5-2, 7-5) = (3, 3, 2) . This matches the given value.
  2. Calculate the Need Matrix (Need = Max – Allocation):
    • P₀ Need = (7,5,3) – (0,1,0) = (7,4,3)
    • P₁ Need = (3,2,2) – (2,0,0) = (1,2,2)
    • P₂ Need = (9,0,2) – (3,0,2) = (6,0,0)
    • P₃ Need = (2,2,2) – (2,1,1) = (0,1,1)
    • P₄ Need = (4,3,3) – (0,0,2) = (4,3,1)
  3. Apply the Safety Algorithm:
    • Initial Work = Available = (3, 3, 2) . Finish = [F, F, F, F, F].
    • Step 1: Check process P₁ . Need₁ (1,2,2) ≤ Work (3,3,2)? Yes . P₁ executes. New Work = Work + Allocation₁ = (3,3,2) + (2,0,0) = (5,3,2) . Finish = [F, T, F, F, F].
    • Step 2: Check process P₃ . Need₃ (0,1,1) ≤ Work (5,3,2)? Yes . P₃ executes. New Work = Work + Allocation₃ = (5,3,2) + (2,1,1) = (7,4,3) . Finish = [F, T, F, T, F].
    • Step 3: Check process P₄ . Need₄ (4,3,1) ≤ Work (7,4,3)? Yes . P₄ executes. New Work = Work + Allocation₄ = (7,4,3) + (0,0,2) = (7,4,5) . Finish = [F, T, F, T, T].
    • Step 4: Check process P₀ . Need₀ (7,4,3) ≤ Work (7,4,5)? Yes . P₀ executes. New Work = Work + Allocation₀ = (7,4,5) + (0,1,0) = (7,5,5) . Finish = [T, T, F, T, T].
    • Step 5: Check process P₂ . Need₂ (6,0,0) ≤ Work (7,5,5)? Yes . P₂ executes. New Work = Work + Allocation₂ = (7,5,5) + (3,0,2) = (10,5,7) . Finish = [T, T, T, T, T].

Since an execution order has been found for all processes (Finish[i] = True for all i), the system is in a

Safe State

. A possible safe sequence is

<P₁, P₃, P₄, P₀, P₂>

.

Q2. (a) What is Interprocess Communication? Explain it. (4) (b) How to solve interprocess synchronization problem using Dekker’s solution for mutual exclusion? (6) (c) What do you mean by Process Scheduler? Discuss short-term scheduler, medium-term scheduler and long-term scheduler. (5) (d) Explain virtual memory with suitable diagram. (5)

Ans. (a) Interprocess Communication (IPC) Interprocess Communication (IPC) is a set of mechanisms provided by the operating system that allows different processes to exchange data and communicate with one another. IPC is essential for cooperating processes. Why is IPC needed?

  • Information Sharing: Multiple processes may need to access the same piece of information (e.g., a shared file).
  • Computational Speedup: By dividing a task into smaller sub-tasks and running them in parallel, the total execution time can be reduced.
  • Modularity: Building a system in a modular fashion, i.e., dividing the system into separate processes or threads.
  • Convenience: A user may work on several tasks at the same time, such as printing, editing, and compiling.

There are two main models of IPC:

  1. Shared Memory: A region of memory is created that can be shared by multiple processes. Processes are allowed to write to and read from this shared region to exchange data. It is fast but ensuring synchronization is the programmer’s responsibility.
  2. Message Passing: Processes communicate by sending messages directly to each other. This is implemented with the help of the kernel and is slower than shared memory, but synchronization is easier.


(b) Dekker’s Solution

Dekker’s solution is the first correct software-only solution to the

mutual exclusion

problem for two processes. Mutual exclusion ensures that at most one process can be in its

critical section

(the code segment that accesses shared resources) at any given time.

Dekker’s solution uses two shared variables:

  • boolean flag[2]; : This is a boolean array. flag[i] = true indicates that process ‘i’ wants to enter the critical section.
  • int turn; : This is an integer that indicates whose turn it is if both processes want to enter at the same time.


Algorithm for process Pᵢ:

while (true) { flag[i] = true; // I want to enter while (flag[j]) { // Does the other process also want to enter? if (turn == j) { // If it's the other process's turn flag[i] = false; // Then I retract my intention while (turn == j) { // wait for the other process to finish } flag[i] = true; // Re-assert my intention } }

// CRITICAL SECTION

turn = j; // Now it's the other process's turn flag[i] = false; // I am done

// REMAINDER SECTION}

This solution satisfies the three required conditions:

  1. Mutual Exclusion: Two processes cannot be in the critical section at the same time.
  2. Progress: If no process is in its critical section and some processes wish to enter, then only those processes that are not in their remainder sections can participate in the selection, and this selection cannot be postponed indefinitely.
  3. Bounded Waiting: There is a limit on the number of times other processes are allowed to enter their critical sections after a process has made a request to enter its critical section.


(c) Process Scheduler

A

Process Scheduler

is a part of the operating system that decides which process should be allocated the CPU, at what time, and for how long. Its main objective is to maximize CPU utilization, increase throughput, and minimize response time.

There are three types of schedulers:

  • Long-Term Scheduler (Job Scheduler):
    • It selects processes from the job pool (stored on disk) and loads them into memory (the ready queue) for execution.
    • It runs much less frequently (in the order of seconds or minutes).
    • It controls the degree of multiprogramming (the number of processes in memory).
  • Short-Term Scheduler (CPU Scheduler):
    • It selects a process from the ready queue and allocates the CPU to it.
    • It runs very frequently (in the order of milliseconds), as a process change on the CPU is often required.
    • It must be very fast so that not too much time is wasted in scheduling.
  • Medium-Term Scheduler:
    • It is associated with the process of swapping .
    • It can reduce the degree of multiprogramming by removing a process from memory (swapping it out to disk). Later, the process can be brought back into memory (swapped in).
    • It helps in improving the process mix in memory and optimizing system performance.


(d) Virtual Memory

Virtual Memory

is a memory management technique that allows a program to use an address space that is much larger than the available physical memory. It separates the user’s logical memory from the physical memory.


Working Principle:

  1. Instead of loading the entire program into memory at once, only the parts (pages) that are immediately needed are loaded.
  2. The logical address space of a process is stored on secondary storage (like a disk). When a page is needed, it is brought into physical memory.
  3. This is typically implemented using Demand Paging . When the CPU tries to access a page that is not in memory, a page fault occurs.
  4. On a page fault, the operating system intervenes, brings the required page from the disk into memory, updates the page table, and then resumes the instruction.


Benefits:

  • Large programs can be run.
  • The degree of multiprogramming is increased, as each program takes up less space in memory.
  • Program creation is easier as the programmer does not need to worry about physical memory constraints.


Diagram:

A suitable diagram would include the following elements:

  • Logical Address Space: Stored on disk.
  • Page Table: Maps logical pages to physical frames. It contains a valid-invalid bit to indicate if the page is in memory.
  • Physical Memory: Containing some loaded pages.
  • Secondary Memory (Disk): Where the entire logical address space is stored.

When the CPU generates a logical address, the MMU (Memory Management Unit) attempts to translate it using the page table. If the valid-invalid bit is ‘invalid’, a page fault trap is generated.

Q3. (a) What is Disk Management? How does it work? Explain continuous and non-continuous memory allocation with suitable diagram. (10) (b) Describe access matrix security model in detail. (6) (c) Differentiate between Rule-based access control and Role-based access control. (4)

Ans. (a) Disk Management and Allocation Methods Disk Management refers to the tasks of the operating system related to managing secondary storage devices like disk drives. It includes:

  • Disk Formatting: Preparing the disk for use, which involves dividing it into sectors and creating a file system (low-level and high-level formatting).
  • Booting: Loading the bootstrap program to start the computer.
  • Bad Block Recovery: Detecting and marking bad or corrupted sectors so they are not used.
  • File System Management: Allocating disk space for files and managing free space.

There are three main methods of allocating disk space to files:


1. Contiguous Allocation:

  • Each file occupies a set of contiguous blocks on the disk.
  • For example, if a file is 5 blocks long and starts at block 10, it will occupy blocks 10, 11, 12, 13, and 14.
  • Advantages: Simple and provides fast sequential and random access because all blocks of the file are together.
  • Disadvantages: It suffers from external fragmentation . Over time, free space on the disk gets scattered into small, non-contiguous pieces (holes) that may be too small to allocate to a new file, even if the total free space is sufficient.
  • Diagram: Show a map of a disk with some files stored in contiguous blocks and fragments of free space (holes) between them.


2. Non-Contiguous Allocation:

This solves the problem of external fragmentation. Its main types are:

  • Linked Allocation:
    • Each block of the file contains a pointer to the next block. The directory entry contains the address of the first and last blocks of the file.
    • Advantages: No external fragmentation. The file size can be easily extended.
    • Disadvantages: Only sequential access is efficient. Random access is very slow as it requires following all pointers from the beginning to reach a block. Space is wasted for pointers.
    • Diagram: Show blocks scattered across the disk, linked to each other by arrows (pointers).
  • Indexed Allocation:
    • A special block, called an index block , is created for each file. This index block contains the addresses of all the data blocks of the file.
    • Advantages: No external fragmentation and it supports direct (random) access.
    • Disadvantages: Wastes space for the index block, especially for small files. For large files, a single index block may not be sufficient, requiring schemes like linking or multi-level indexing.
    • Diagram: Show an index block pointing to various data blocks scattered on the disk.


(b) Access Matrix Security Model

The

Access Matrix

is a theoretical security model used to define and enforce security policies in a system. The model specifies which subjects can perform which operations on which objects.


Structure:

  • The matrix is a two-dimensional structure.
  • Rows represent Subjects . Subjects are active entities that perform operations, such as users or processes.
  • Columns represent Objects . Objects are passive entities on which operations are performed, such as files, devices, or memory segments.
  • Each entry in the matrix, Access[i, j] , defines the set of Operations that subject ‘i’ can perform on object ‘j’ (e.g., read, write, execute).


Example:

 | File F1 | File F2 | Printer------------------------------------------User A | read | read | print | write | |------------------------------------------User B | | read |

Implementation: Since the access matrix is typically very sparse, implementing it directly is impractical. Instead, the following methods are used:

  1. Access Control Lists (ACLs):
    • This corresponds to the columns of the matrix.
    • For each object, there is a list specifying all subjects and their allowed operations.
    • When a subject attempts to access an object, the system checks the object’s ACL.
    • This is used in many operating systems like Windows.
  2. Capability Lists:
    • This corresponds to the rows of the matrix.
    • For each subject, there is a list specifying all objects and the operations that can be performed on them.
    • A capability is like a token that the subject presents to gain access.
    • These can be more difficult to manage and revoke.

(c) Difference between Rule-based and Role-based Access Control

Basis Rule-Based Access Control (Rule-BAC) Role-Based Access Control (Role-BAC)
Definition Access is decided based on a set of rules or policies defined by an administrator. Access is decided based on the user’s role within the organization.
Core Concept Based on “if-then” logic. Example: “If the time is between 9 AM and 5 PM, allow access to the file.” Permissions are assigned to roles, and users are assigned to roles. Example: “All users with the ‘Manager’ role can access financial reports.”
Flexibility Very flexible and provides fine-grained control. Rules can be very specific. Less flexible but easier to administer. Policies are tied to the user’s role, not the individual.
Administration Can be complex as a large set of rules must be managed. Simpler. When a user’s job changes, only their role needs to be changed, not individual permissions.
Example Use Case Firewalls, network routers. Corporate databases, healthcare systems.

Q4. (a) Explain the memory management technique in Windows 2000. (6) (b) Discuss the design issues involved in a distributed system. (6) (c) What is Multiprocessor-Synchronization? Explain how the following work: (i) Test-and-Set (ii) Compare-and-Swap (iii) Fetch-and-Add (8)

Ans. (a) Memory Management in Windows 2000 Windows 2000 uses a sophisticated memory management system based on virtual memory , demand paging , and page replacement . Key Features:

  1. Virtual Address Space:
    • It uses a 32-bit flat address space, providing each process with a private 4 GB virtual address space.
    • This 4 GB space is divided into two parts: 2 GB for user processes (User Space) and 2 GB for the operating system kernel (Kernel Space).
  2. Demand Paging with Clustering:
    • Pages are brought into memory only when they are needed (demand paging).
    • When a page fault occurs, Windows brings in not only the required page but also a few pages surrounding it. This is called clustering , which improves performance by leveraging the principle of spatial locality.
  3. Working Set Model:
    • Each process has a working set , which is the set of pages that the process has recently needed.
    • The Memory Manager tries to ensure that the working set of each ready-to-run process is in physical memory.
    • If there is a shortage of memory, the Memory Manager can “trim” the working sets of processes, i.e., remove pages that have not been used recently.
  4. Page Replacement Algorithm:
    • Windows 2000 uses a local page replacement policy which is a variation of LRU (Least Recently Used) .
    • It uses a clock-based approach, where it checks if a page has been accessed recently. If not, it is considered a candidate for replacement.
  5. Page Frame Database: The VMM (Virtual Memory Manager) maintains a page frame database that tracks the state of every page frame in physical memory (e.g., free, used, modified).


(b) Design Issues in a Distributed System

A distributed system is a collection of autonomous computers connected via a network that appear to users as a single, coherent system. Its design involves several challenges and issues:

  • Transparency: The goal of hiding the distributed nature of the system from users and applications. There are various forms:
    • Access Transparency: Accessing local and remote resources in a uniform way.
    • Location Transparency: Hiding the physical location of resources.
    • Migration Transparency: Hiding the ability of the system to move resources to improve performance.
    • Failure Transparency: Hiding the ability to recover from hardware or software failures.
  • Reliability and Fault Tolerance: The system should continue to function despite node or link failures. This is achieved through redundancy—keeping copies of data and services.
  • Scalability: The system should remain effective and efficient as it grows in size (number of nodes). Avoiding centralized components is crucial to achieving scalability.
  • Performance: Achieving good response time and throughput is a primary goal. Network communication overhead can significantly impact performance. Load balancing techniques are important.
  • Synchronization: Synchronizing clocks, enforcing mutual exclusion, and detecting or preventing deadlock in a distributed environment are complex because there is no global clock or shared memory.
  • Security: Encrypting data, authenticating users and servers, and enforcing access control are essential to protect against unauthorized access and attacks over the network.


(c) Multiprocessor-Synchronization

Multiprocessor synchronization

refers to the mechanisms that ensure that concurrent processes or threads running on multiple processors can access shared resources without conflicts. Since multiple processors can access memory at the same time, special hardware support is required to prevent race conditions.

Explanation of the following synchronization hardware:

  • (i) Test-and-Set:
    • This is an atomic instruction, meaning it completes without interruption.
    • It reads the value of a memory location (a boolean variable) and sets it to `true` in a single, indivisible operation. It returns the old value of that location.
    • Functionality: boolean TestAndSet(boolean lock) { boolean old_value = lock; *lock = true; return old_value; }
    • It can be used to implement a spinlock for mutual exclusion: while (TestAndSet(&lock)); . If the lock is already `true`, the process spins in the loop (busy waiting).
  • (ii) Compare-and-Swap (CAS):
    • This is another atomic instruction that is more powerful than Test-and-Set.
    • It takes three parameters: the address of a memory location, an expected value, and a new value.
    • It atomically compares the contents of the memory location to the expected value. If they are equal, it updates the memory location with the new value. It always returns the original value of the memory location.
    • Functionality: int CompareAndSwap(int value, int expected, int new_value) { int temp = value; if ( value == expected) value = new_value; return temp; }
    • It can be used to implement complex lock-free and wait-free data structures.
  • (iii) Fetch-and-Add:
    • This is an atomic instruction that increments the value of a memory location by a certain amount and returns the old value of that location.
    • Functionality: int FetchAndAdd(int value, int increment) { int temp = value; *value = temp + increment; return temp; }
    • This is very useful when multiple processes need to update a shared counter or when they need to be assigned unique IDs without explicit locking. It can help implement mutual exclusion without busy waiting.

Q5. Write short notes on the following: 5×4=20 (i) Semaphore (ii) RAID (iii) Crossbar-connected system (iv) Round Robin Scheduling Algorithm (v) SCAN and C-SCAN Disk Scheduling Algorithm

Ans. (i) Semaphore A semaphore is a synchronization tool proposed by Edsger Dijkstra. It is an integer variable that can only be accessed through two atomic operations: wait() and signal() .

  • wait() operation (or P()): This decrements the value of the semaphore. If the value becomes negative, the process calling wait() is blocked and placed on a waiting queue.
  • signal() operation (or V()): This increments the value of the semaphore. If the value is zero or negative, it wakes up a process from the waiting queue.

There are two types of semaphores:

  1. Counting Semaphore: Its value can be any non-negative integer. It is used to control access to a resource with a finite number of instances.
  2. Binary Semaphore (Mutex): Its value can only be 0 or 1. It is used to solve mutual exclusion problems.

Semaphores are a powerful tool for solving the critical-section problem and other complex synchronization problems.


(ii) RAID (Redundant Array of Independent Disks)

RAID is a data storage virtualization technology that combines multiple physical disk drives into one or more logical units for the purposes of data redundancy, performance improvement, or both. Different RAID levels provide different trade-offs.

  • RAID 0 (Striping): Data is split into blocks and striped across multiple disks. It offers high performance (read/write speed) as multiple disks work in parallel. There is no redundancy; the failure of one disk results in the loss of all data.
  • RAID 1 (Mirroring): Data is duplicated onto two or more disks. It offers excellent redundancy and fault tolerance. If one disk fails, the data can be recovered from the mirrored disk. Write performance can be slower.
  • RAID 5 (Striping with Parity): Data and parity information are distributed across all disks. It provides a good balance between performance and redundancy. It can tolerate the failure of one disk.
  • RAID 6 (Striping with Double Parity): Similar to RAID 5, but it uses two independent parity blocks. It can tolerate the simultaneous failure of two disks, making it more reliable.


(iii) Crossbar-Connected System

A crossbar-connected system, also known as a crossbar switch, is a multiprocessor interconnection network. It uses a matrix of switches to connect any processor in the system directly to any memory module.

  • Structure: For a system with N processors and M memory modules, the crossbar consists of a grid of N x M switches. The switch at the intersection of processor ‘i’ and memory ‘j’ can create a dedicated path between them.
  • Advantages: It offers high performance because it allows for simultaneous, non-blocking access to different memory modules. There is no contention unless two processors try to access the same memory module.
  • Disadvantages: Crossbar systems are very expensive and complex. The number of switches required (N * M) grows rapidly with the number of processors and memory modules, making it impractical for large systems.


(iv) Round Robin Scheduling Algorithm

Round Robin (RR) is a CPU scheduling algorithm designed especially for time-sharing systems. It is a preemptive algorithm.

  • Working Principle: The ready queue is treated as a FIFO (First-In, First-Out) queue. Each process is given a small unit of time, called a time quantum or time slice (typically 10-100 milliseconds).
  • The CPU scheduler picks the first process from the ready queue, sets a timer for one quantum, and dispatches the process.
  • If the process finishes before its quantum expires, it releases the CPU. Otherwise, the timer interrupt occurs, and the operating system preempts the process and places it at the end of the ready queue.
  • Performance: The performance of RR depends heavily on the size of the time quantum. If the quantum is too large, it behaves like FCFS. If it is too small, the overhead of context switching becomes very high. It provides good response time and prevents starvation.


(v) SCAN and C-SCAN Disk Scheduling Algorithm

These are algorithms used to reduce disk access time by optimizing the movement of the disk arm.

  • SCAN (Elevator Algorithm):
    • The disk arm starts at one end of the disk and moves towards the other end, servicing all requests in its path.
    • When it reaches the other end, it reverses its direction and continues servicing requests on its way back.
    • It can be biased against cylinders that have just been passed and those at the edges may have to wait longer.
  • C-SCAN (Circular SCAN):
    • This is a variation of SCAN that provides a more uniform wait time.
    • Like SCAN, the head moves from one end of the disk to the other, servicing requests along the way.
    • However, when it reaches the other end, it immediately returns to the beginning of the disk without servicing any requests on the return trip .
    • This treats the cylinders as a circular list, ensuring all cylinders get a fair chance.


Download IGNOU previous Year Question paper download PDFs for MCS-041 to improve your preparation. These ignou solved question paper IGNOU Previous Year Question paper solved PDF in Hindi and English help you understand the exam pattern and score better.

  • IGNOU Previous Year Solved Question Papers (All Courses)

Thanks!

Share this:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • More
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Telegram (Opens in new window) Telegram
  • Print (Opens in new window) Print
  • Email a link to a friend (Opens in new window) Email

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

लेटेस्ट अपडेट पायें

Telegram Telegram Channel Join Now
Facebook FaceBook Page Follow Us
YouTube Youtube Channel Subscribe
WhatsApp WhatsApp Channel Join Now

Search

Recent Posts

  • MSU Baroda Study Materials Free Download
  • Bhavnagar University Study Materials Free Download
  • Kachchh University Study Materials Free Download
  • BMTU Study Materials Free Download
  • SGGU Study Materials Free Download

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,611 other subscribers

Categories

  • 10th model paper (3)
  • bed books (3)
  • Bihar Board Model Paper (7)
  • Bihar Jobs (1)
  • cg board model paper (1)
  • DELED Books (1)
  • English Posts (1)
  • Essay (1)
  • Exam Prep (9)
  • G.K quiz in hindi (7)
  • General Knowledge in hindi (सामान्य ज्ञान) (24)
  • gk 2018 in hindi (12)
  • GK 2020 (2)
  • GK HINDI 2019 (9)
  • gk pdf download (16)
  • High school science notes in Hindi (3)
  • IERT (3)
  • MODEL PAPER (30)
  • Motivational quotes in hindi (1)
  • mp board model paper (4)
  • My Thoughts (Thoughts by Sachin Yadav) (1)
  • Navy (2)
  • NCERT Books in hindi free download (1)
  • Police (2)
  • Polytechnic (6)
  • Pratiyogita Darpan 2019 (2)
  • RBSE Model Papers (2)
  • School Books (1)
  • SSC GENERAL KNOWLEDGE (7)
  • StudyTrac (69)
  • Uncategorized (54)
  • University Books (106)
  • University Question Papers (153)
  • University Study Materials (89)
  • University Syllabus (144)
  • UP Board Books (5)
  • up board model paper (10)
  • Up board model papers (16)
  • UPSC Notes (3)
  • Uttar Pradesh Jobs (2)
  • रेलवे (7)
  • सामान्य हिन्दी (3)

Footer

University Books

University Study Materials (Books and Notes) in PDF Format in Hindi and English languages.

Click here to download.

University Question Papers

University Previous Year Question Papers and Sample Papers in PDF Format for all Courses.

Click here to download.

University Syllabus

Universities Syllabus in PDF Format in the English and Hindi languages for all courses.

Click here to download.

Copyright © 2026 ·GKPAD by S.K Yadav | Disclaimer