Syllx Akash OS

You might also like

Download as pdf
Download as pdf
You are on page 1of 138
SYLLABUS OPERATING SYSTEMS (CIC-305) Applicable from Batch admitted in Academic Session 2021-22 Onwards UNITI Introduction: What is an Operating System, Simple Batch Systems, Multiprogrammed Batches Systems, Time Sharing Systems, Personal-Computer Systems, Parallel Systems, Distributed Systems, Real-Time Systems, OS — A Resource Manager. Processes: Introduction, Process states, Process management, Interrupts, Interprocess Communication Threads: Introduction, Thread States, Thread Operation, Threading Models. Processor Scheduling: Scheduling: levels, Preemptive vs no preemptive scheduling, priorities, scheduling objective, scheduling criteria, scheduling algorithms, demand scheduling, real time scheduling. (No. of Hrs. 12] UNITY Process Synchronization: Mutual exclusion, software solution to Mutual exclusion problem, hardware solution to Mutual excltision problem, semaphores, Critical section problems. Case study on Dining philosopher problem, Barber shop problem etc. Memory Organization & Management: Memory Organization, Memory Hierarchy, Memory Management Strategies, Contiguous versus non- Contiguous memory allocation, Partition Management ‘Techniques, Logical versus Physical Address space, swapping, Paging, Segmentation, Segmentation with Paging Virtual Memory: Demand Paging, Page Replacement, Page-replacement Algorithms, Performance of Demand Paging, Thrashing, Demand Segmentation, and Overlay Concepts, _[No. of Hrs. 13) UNIT III Deadlocks: Examples of deadlock, resource concepts, necessary conditions for deadlock, deadlock solution, deadlock Prevention, deadlock avoidance with Bankers algorithms, deadlock detection, deadlock recovery. Device Management: Disk Scheduling Strategies, Rotational Optimization, System Consideration, Caching and Buffering. [No. of Hrs. 18] UNIT IV . File System: Introduction, File Organization, Logical File System, Physical File System, File Allocation strategy, Free Space Management, File Access Control, Data Access Techniques, Data Integrity Protection, Case study on file system viz FATS2, NTFS, Ext2Ext3 etc. INo. of Hrs. 12] SYLLABUS OPERATING SYSTEM (AIDS/AIML-301) ed in Academic Session 2021.32 ¢ UNIT I inwards wating system and function, Evolution of operating canara nd Real Time System, System protection. Operating Syce ts, System structure, Operaung System Services, Scheduling Concept, process scheduling strategies. First.¢ First-Served (FCFS) Scheduling, Shortest-Job-Next (SJN) Scheduling, Prionty Scheduling, Shortest Remaining ‘Time, Round Robin (RR) Scheduling, Multiple Level Queues Scheduling, Performance Critenia of Scheduling Algorithm, Evolution Multiprocessor Scheduling INo. of Hrs. 10 UNIT IT rocesses: Process concept, Principle of Concurrency, Producer Consume maphdres:Binary and counting semaphores, Pl Applicable from Batch admitt Introduction: Ope: teractive, Time Sharing # nm Componen' Int Structure: Syste! CPU Scheduling: Concurrent Pi Problem, Critical Section problem, Se ns, Classical problems un Concurrency, Inter Process Communmicatior and Vi) operatio: Process Generation, Process Scheduling Deadlocks: Examples of deadlock, resource concepts, necessary conditions for deadlock deadlock solution, deadlock prevention, deadlock avoidance with Bankers algonthm deadlock detection, deadlock recovery. {No. of Hrs. i UNIT III Memory Organization & Management: Memory Organization, Memory Mierarch Memory Management Strategies, Contiguous versus non- Contiguous memo allocation, Partition Management Techniques, Logical versus Physical Address spas swapping, Paging, Segmentation, Segmentation with Paging Virtual Memory: Dem Paging, Page Replacement, Page-replacement Algorithms, Performance of Dem Pagnug. Thrashing, Demand Segmentation, and Overlay Concepts. [No- of Hire} UNIT IV ! LO Device and the organization: LO Device and the organizauon of the F pst ad . = Disk 10, Disk Scheduling Algorithms, Fite system 8 ssation ag pepe File organization and Access mechanis™ disk Nalini nwds, Directory structure, free disk space management, File f 2on teaver. Case studies: Unix aystem, Windows XP, INo- of Hew SYLLABUS (2016-17) a ES ee OPERATING SYSTEM (ETCS-304) s to Paper Setters: MM. 75 1. Question No. 1 should be compulsory and cover the entire syllabus. This question should pen objective or short answer type questions. It should be of 25 marks. 2. Apart from Question No. 1, rest of the paper shall consist of four units as per the syllabus. Every unit spould ha be two questions. However, student may be asked to attempt only 1 question from each unit, Each question sh oul Be of 12.5 marks. UNIT-I Introduction: What is an Operating System, Simple Batch Systems, Multiprogrammed' atches systems, Time-Sharing Systems, Personal-computer systems, Parallel systems, istributed Systems, Real-Time Systems, OS — A Resource Manager. Memory Organization & Management: Memory Organization, Memory Hierarchy, emory Management Strategies, Contiguous versus non-Contiguous memory allocation, artition Management Techniques, Logical versus Physical Address space, swapping, Paging, - sgmentation, Segmentation with Paging \ Virtual Memory: Demand Paging, Page Replacement, Page-replacement Algorithms, “formance of Demand Paging, Thrashing, Demand ‘Segmentation, and Overlay Concepts. [11] [T2](R2](R3] (No. of hrs. 10] UNIT-IL Processes: Introduction, Process states, ptocess management, Interrupts, Interprocess ymmunication. Threads: IntroductiomThread states, Thread Operation, Threading Models. Processor Scheduling: Scheduling levels, pre emptive vs no: pre emptive scheduling joritics, scheduling objective, scheduling criteria, scheduling algorithms, demané nstruction: heduling, real time scheduling. Process Synchrenization: Mutual exclusion, software solution to Mutual‘exclusion oblem, hardware solution to Mutual exclusion problem, semaphores, Critical section oblems. Case study on Dining philosopher problem, Barber shop problemetc. ~ t _ (T1)[T2)[0R3] [No. of hrs. 10] UNIT-III Deadlocks: Examples of deadlock, resource concepts, necessary conditions Yor deadlock; . ladlock solution, deadlock prevention, deadlock avoidance with Bankers algorithms, lock detection, deadlock recovery. i Device Management: Disk Scheduling Strategies, Rotational Optimization, System nsideration, Caching and Buffering. [T1][T2][R1) (No. of hrs. 10] UNIT-IV File System: Introduction, File Organization, Logical File System, Physical File System, Allocation strategy, Free Space Management, File Access Control, Data Accei niques, Data Integrity Protection, Case study on file system viz FAT32, NTFS, Ext2/ ete. (T1] (T2]{R4]{R5) (No. of hrs. 10] As per the New Syllabus 2021-22 OPERATING SYSTEM (CIC-305) UNIT -I Q Refer to QI (b) of First Term Examination 2016 (Pg. No. 1-2016). Q Refer to Q.1 (ce) of First Term Examination 2016 (Pg. No. 1-2016) Q. Refer to QI (d) of First Term Examination 2016 (Pg. No. 2-2016). Q. Refer to Q2 (a) of First Term Examination 2016 (Pg. No. 3-2016). Q. Refer to Q3 (a) of First Term Examination 2016 (Pg. No. 6-2016). Q Refer to Q3 (b) of First Term Examination 2016 (Pg. No. 7-2016). Q. Refer toQ1 (a) of End Term Examination 2016 (Pg. No. 20-2016). Q. Refer to Q.1 (e) of End Term Examination 2016 (Pg. No. 21-2016). Q. Refer to Q.2 (a) of End Term Examination 2016 (Pg. No. 21-2016). Q. Refer to Q.3 (c) of End Term Examination 2016 (Pg. No. 25-2016). Q. Refer to Q.4 (a) of End Term Examination 2016 (Pg. No. 25-2016). Q. Refer to Q.4 (b) of End Term Examination 2016 (Pg. No» 26-2016). : Q. Refer to Q.1 Refer Question (Pg_No. 31 2017). Q. Refer to Q.1 (a),(b) of First Term Examination 2017 (Pg. No. 1-2017). Q. Refer to Q.1 (c) of First Term Examination 2017 (Pg. No. 2-2017). Q. Refer to Q.2 (a) of First Term Examination 2017 (Pg. No. 3-2017). Q. Refer to Q.3 (a) of First Term Examination 2017 (Pg. No. 9-2017). Q. Refer to Q.3 (b),(e) of First ‘Term'Examination 2017 (Pg. No. 10-2017). Q. Refer to Q.1 (a),(b),fe) of End Term Examination 2017 (Pg. No. 12-2017). Q. Refer to Q:1 (Nof End Term Examination 2017 (Pg. No. 13-2017). Q. Refer to Q.3 fc) of Ené.Term Examination 2017 (Pg. No. 18-2017). Q. Refer to Q.4\a) of End Term Examination 2017 (Pg. No. 19-2017). Q. Refer to Q.4 (by of End Term Examination 2017 (Pg. No. 21-2017). Q. Refer to Q.4 (ce) of End Term Examination 2017 (Pg. No. 22-2017). Q. Refer to Q.1 (a) of First Term Examination 2018 (Pg. No. 1-2018). Q. Refer to Q.1 (c),(d) of First ‘Term Examination 2018 (Pg. No. 2-2018)- Q. Refer to Q.2 of First Term Examination 2018 (Pg. No. 2-2018) Q. Refer toQ.1 (a) of End Term Examination 2018 (Pg. No. 6-2018). Q. Refer to Q.1 (f) of End Term Examination 2018 (Pg. No. 9-2018). Q. Refer to Q.1 (h) of End Term Examination 2018 (Pg. No. 10-2018). Q. Refer to Q 4 (a) of End Term Examination 2018 (Pg. No. 11-2018). Q Refer to Q4 (b) of End Term Examination 2018 (Pg. No. 17-2018). Q. Refer to Q.1 (a) of First Term Examination 2019 (Pg. No. 1-2019). Q Refer to Q.1 (b),(c) of First Term Examination 2019 (Pg. No. 1-2019). Q Refer to Q.2 (a) of First Term Examination 2019 (Pg. No. 3-2019)- < aed to QA (a),b) of End Term Examination 2019 (Pg. No. 6-2019). . Refer to Q 2 (a) of End Term Examination 2019 (Pg. No. 8-2018)- LP. Univermity (1 Tech| Alwel Hoole 20K O Q. Refor to Q.2 Ce) af 1 ‘xumination 2019 (My Nob 4O1K) Q. Refer to QA (a) of E 20190 Noo Zoi) Q Rofer to QA (a) of End Term Examination 2019 (yy Ne 12 2019) 12019) Q. Refor to Q.6 (b) of End Term Examination 2019 (Pg, No 14-2010) UNIT «II Q. Refer to Q.1 (a) of First Term Examination 2016 (Pg. No. 12016) Q. Rofer to Q.1 (e) of First Term Examination 2016 (Py No. 2.2016) Q,. Refer to Q.2 (b) of First Term Examination 2016 (Pg, No 5-2016), Q. Refer to Q.2 (c) of Firat Term Examination 2016 (Pg. No. 6-2016) Q. Refer to Q.4 (a) of First Term Examination 2016 (Pg. No. 4 2016) Q Refer to Q.4 (b),(c) of First Term Examination 2016 (Pg. No. 92016). Q. Refer to Q.1 (c) of End Term Examination 2016 (Pg. No. 20-2016) Q. Refer to Q.1 (d) of End Term Examination 2016 (Pg. No, 20-2016) Q. Refer to Q.2 (b) of End Term Examination 2016 (Pg. No. 22 2016). Q, Refer to Q.2 (c) of End Term Examination 2016(Pg. No. 23-2016), Q. Refer to Q.3 (a) of End Term Examination 2016 (Pg. No. 23-2016). Q. Refer to Q.3 (b) of End Term Examination 2016 (Pg. No. 24-2016). Q. Refer to Q.4 (c) of End Term Examination 2016 (Pg. No. 26-2016). Q. Refer to Q.2 Refer Question (Pg. No. 31-2016). Q. Refer to Q.3 Refer Question (Pg..No.°3 1-2016). Q. Refer to Q.4 Refer Question (Pg. No. 32-2016). Q. Refer to Q.1 (d) of First Term Examination 2017 (Pg. No. 3-2017). Q. Refer to Q.2(b) of First Term Examination 2017 (Pg. No. 4-2017). Q. Refer to Q.4 (a),(b)\(c) of First Term Examination 2017 (Pg. No. 11-2017). Q. Refer to Q.1 (d) of End Term Examination 2017 (Pg. No. 12-2017), Q. Refer to Q.1 (e),of End Term Examination 2017 (Pg. No. 13-2017). Q. Refer to Q.1 (i) of End Term Examination 2017 (Pg. No. 14-2017). Q. Refer to Q.2 (a) of End Term Examination 2017 (Pg. No. 14-2017). Q. Refer to Q.2 (b),(c) of End Term Examination 2017 (Pg. No. 16-2017). Q. Refer to Q.3 (a),(b) of End Term Examination 2017 (Pg. No. 17-2017). Q. Refer to Q.5 (a) of End Term Examination 2017 (Pg. No. 22-2017). Q. Refer to Q.5 (b) of End Term Examination 2017 (Pg. No. 27-2017). Q. Refer to Q.1 (b) of First Term Examination 2018 (Pg. No. 1-2018). Q. Refer to Q.3 (a),(b) of First Term Examination 2018 (Pg. No. 4-2018). Q. Refer to Q.4 of First Term Examination 2018 (Pg. No. 5-2018). Q. Refer to Q.1 (b) of End Term Examination 2018 (Pg. No. 6-2018). Q. Refer to Q.1 (d),(¢) of End Term Examination 2018 (Pg. No. 8-2018). Q Refer to Q.1 (g) of End Term Examination 2018 (Pg. No. 9-2018). Q. Refer to Q.2 (a),(b),(c) of End Term Examination 2018 (Pg. No. 10-2018). y Rxaminiat Q Rofer to QA (c) of End Term Examination 2019 (Py. No Fifty Semester, Operating System 6-2022 3 >) of End ‘t Q. Refer to Q.3 (a),tb),(c) of Ene ; 3 og Q Refer to Q5 (a) of End Term bx mination 2018 (Pg. No. 18.2018) O 1g) Q Refer to. & (b) of End Term Exuro nation 2018 (Pg. No. 19-2018) Q. Refer 9 Q1 (d),(e) of First Term Exemination 2019 (Pg. No, 2.2019) Q Refer: Q2(b) of First Term Examination 2019 (2. No. 4 2019), ‘Term Examination 2019 (Pg. No 4-219) m Examination 2018 (Pg. N, Q. Refer to 0.3 (a) of First @ Refer to Q.1(b) of First Term Examination 2019 (P's, No 4-2019) Q Refor to Q.4 of Pirst Term Examination 2019 (Pg. No. 5-2019) Q. Refer to Q.1 (c),(d) of Kind Term Examination 2019 (Pg. No 6-2019), @Q Refer to Q.1 (h),G) of End Term Examination 2019 (Pg. No. 7-2019) Q. Refer to Q.2 (b) of End Term Examination 2019 (Pg. No. 8-2019), Q. Refer to Q.3 (b) of End Term Examination 2019 (Pg. No. 11-2019), Q Refer to Q.3 (c) of End Term Exainination 2019 (’g. No. 12-2019), @ Refer to Q.4 (b) of End Term Examination 2019 (Pg. No. 13-2019), Q. Refer to Q.5 (a) of End Term Exitninati» 2019 (Pg. No. 13-2018) UNIt- Nt Q. Refer to Q.1 (a),(b) of Second Term Exatmimation 216 (Pg. No. 11-2016), Q. Refer to Q.1 (d) of Second Term Examination 2016 (1’g. No. 11-2016). Q. Refer to Q.2 (a) of Second Perm Examination 2016 (Pg. No. 12-2016). Q. Refer to Q.3 (a) of Second ‘Term Examination 2016 (Pg. No. 13-2016). Q. Refer to Q.1 (9 of End Term Examination 2016 (Pg. No. 21-2016). Q. Refer to Q5 (w),(b) of End Tern Examination 2016 (Pg. No. 27-2014) Q. Refer 16 Q.5 (c).of End Term Examination 2016 (Pg. No. 28-2016) Q. Refer to Q 6 (a)\(b) of End Term Examination 2016 (Pg. No. 28-2018). Q. Refer to Q.6 (c) of End Term Examination 2016 (Pg. No. 29-2016). Q. Refer to Q.1,(g)f End Term Examination 2017 (Pg. No. 13-2017). Q. Refer to Q.6 (a),(b) of End Term Examination 2017 (Pg. No. 28-2017). Q. Refer to Q.6 (e) of End Term Examination 2017 (Pg. No. 29-2017). Q. Refer to Q.7 (a) of End Term Examination 2017 (Pg. No. 29-2017). Q. Refer to Q.7 (b),(c) of End Term Examination 2017 (Pg. No. 31-2017). Q. Refer to Q.1 (c) of End Term Examination 2018 (Pg. No. 8-2018). Q Refer to Q.6 (a),(b) of End Term Examination 2018 (Pg. No. 20,21-2018). Q Refer to Q.7 of End Term Examination 2018 (Pg. No. 24-2018) @ Refer to Q.1 (e) of End Term Examination 2019 (Pg. No. 6-2019)- Q Refer to Q.1 (i) of End Term Examination 2019 (Pg. No. 7-2019)- Q Refer to Q.6 (a),(b),(c) of End ‘Term Examination 2019 (Pg. No. 16, 17-2019). Q Refer to Q.7 (a) of End Term Examination 2019 (Pg. No. 18-2019). Q Refer to Q.7 (b),(c) of End Term Examination 2019 (Pg. No. 20-2019). % LP. University-1B.Tech|-Akash Books 2022-7 “UNIT - IV Q. Refer to Q.1 (c) of Second Term Exam 2016 (Pg. No. 11-2016) Q. Refer to Q.2 (b) of Second Term Exam 2016 (Pg. No. 13-2016) Q. Refer to Q.3 (b) of Second Term Exam 2016 (Pg. No. 16-2016) Q. Refer to Q-4 (a) of Second Term Exam 2016 (Pg. No. 17-2016) Q. Refer to Q.4 (b) of Second Term Exam 2016 (Pg. No. 18-2016) Q. Refer to Q.1 (g) of End Term Exam 2016 (Pg. No. 21-2016) Q. Refer to Q.7 of End Term Exam 2016 (Pg. No. 29-2016) Q. Refer to Q.1 (h) of End Term Exam 2017 (Pg. No. 13-2017) Q. Refer to Q.1 Gj) of End Term Exam 2017 (Pg. No. 14-2017) Q. Refer to Q.8 (a) of End Term Exam 2017 (Pg. No. 32-2017) Q. Refer to Q.8 (b) of End Torm Exam 2017 (Pg. No. 35-2017) Q. Refer to Q.8 (c) of End Term Exam 2017 (Pg. No, 86-2017) Q, Refer to Q.9 (a),(b) of End Term Exam 2017 (Pg. No. 37-2017) Q. Refer to Q.9 (c) of End Term Exam 2017 (Pg-No. 38-2017) Q. Refer to Q.8 (a) of End Term Exam 2018 (Pg. No. 25-2018) Q. Refer to Q.8(b) of End Term Exam 2018 (Pg. No. 27-2018) Q. Refer to Q.9 (a) of End Term Exam 2018 (P2No. 29-2018) Q Refer to Q.9 (b),(c) of End Term Exam 2018\(Pz. No. 30-2018) Q Refer to Q.1 (f(g) of End Term Exarm2019 (Pg No. 7-2019) Q. Refer to Q.8 (a),(b),(c) of End Term Exar)2019 (Pg. No. 20,21-2019) Q. Refer to Q.9 (a),(c) of End Term. Exam 2019 (Pg. No. 22-2019) As per New Syllabus 2021-22 OPERATING SYSTEM (AIDS/AIML-301 ) UNIT -I p)(c) of First Term Pxamination 2016 (Pg. No. 1.2046) Q ; c ne pirat Term Examination 2016 ( Py No. 2.2019) F Be ta of Fir Term Examination 2016 (Pg. No. 3 2016), by) of First Term Examination 2016 (De. No. 6, 7.2016) e) of End Term Examination 2016 (Pg. No, 20,21-2016) arate wQ2te of End Term Examination 2016 ( Pg. No. 21-2016), Q Refer to Q.3 (0) of Bnd Term Examination 2016 (Pg. No. 25-2016), Q. Refer to Q-4 (a) of End Term Examination 2016 (Pg. No. 25-2016), @. Refer to Q-4 (b) of End Term Examination 2016 (Pg. No. 26-2016), @ Refer to Q.1 Refer Question (Px, No. 31;2018) ‘ Q. Refer to Q.1 (a),(b),(c) of First Term bxamination 2017 (Pg. No. 1,2-2917), @ Refer to Q2 (a) of First Term Examination 2017 (Pg. No. 3-2017). ” Q. Refer to Q.3 (a),(b),(c) of First Term Examination 2017 (Pg. No, 9,10-2017), Q. Rofer to Q.1 (a),(b),(c)(1) of End Term Examination 2017 (Pg. No. 12,13-20%y, Refer to Q3 (c) of End Term Bxamination 2017 (Pg, No. 18-2017), ‘ Q. Rofer to Q4 (a),(b) of Bnd Term Examination 2017 (Pg. No. 19,21-2017), Q. Refer to Q.1 (a) of First Terma Examination 2018 (Pg. No. 1-2018). Q. Refer to Q.1 (c)(d) of First Term, Examination 2018 (Pg. No. 2-2018). Q. Refer to Q.2 of First Term Examination 2018 (Pg. No. 2-2018). Q. Refer to Q.1 (a) of End Term Examination 2018 (Pg. No. 6-2018). Q. Refer to Q.1 (f) of, End Term Examination 2018 (Pg. No. 9-2018). Q. Refer to Q.1 (h) of End Term Examination 2018 (Pg. No. 10-2018). . ma a Ren ee Peon 2018 (Pg. No. 11,17-2018). eae a a Ser... é ‘irst core paarination 2019 (Pg. No. 1-2019). Bee heii aa peeaeon 2019 (Pg. No. 3-2019). a anise bo en iad a, Examination 2019 (Pg. No. 6-2019). Bits G8 Gera as seainataony 2019 (Pg. No. 8,9-2019). Q Refer to Q 4 (a),(c) of End Reccifia, se ee Q Refer to Q.5 (b) of End ‘Term ie sarnaton 2010. examination 2019 (Pg. No. 14-2019). UNIT - IT t ‘amination 2016 (Pg. No. 2-2016). ate a Examination 2016 (Pg. No. oe ie ate 2016 (Pg. No. 11-2016) Examination 2016 (Pg, No. 13-2018 mn Fi; s Xamination 2016 (Pg. No. 21-2018). Q. Refer to Q. Refer to Q Refer to Q Q Refer to Q3 (a) Q Refer to Qt (al : i to Q1 (e) of First Term Ex: pe ioe 2 Q4 (0),0b),(0) of First Te ice to Q.1 (b) of Second ane TtoQ3 (a) of Second TtOQ1(N of End Ter LP. Univeraity-1B Tech} Akash Books 2022-9 Q Refer to Q4 (c) of End Torm Examination 2016 (Pg. No. 26-2016) Q. Refer to Q.5 (a),(b) of End Term Examination 2016 (Pg. No. 27 2016) Q. Refer to Q.5 (c) of End Term Examination 2016 (Pg. No, 28-2016) Q Refer to Q6 (c) of End Term Examination 2016 (Py. No. 29-2016) Q Refer to Q2 Refer Question (Pg. No. 31-2016) Q. Refer to Q4 (w),(b),e) of First Term Examination 2017 (Pg. No. 11-2017) Q. Rofer to Q.1 Gp) of End Term Examination 2017 (Pg. No. 13-2017). Q. Refer to Q.5 (a),(b) of End Term Examination 2017 (Pg. No. 22,27-2017). Q. Refer to Q.6 (a),(b),(c) of End Term Examination 2017 (Pg. No. 2829-2017). Q. Refer to Q.1 (d),(e) of End Term Examination 2018 (Pg. No. 8-2018). Q, Refer to Q.5 (a),(b) of End Term Examination 2018 (Pg. No. 18,19-2018). Q, Refer to Q.6 (a),(b) of End Term Examination 2018 (Pg. No, 20,21-2018). Q. Refer to Q 1 (e) of First Term Examination 2019 (Pg. No. 2-2019). Q,. Refer to Q.1 (i) of End Term Examination 2019 (Pg. No. 7-2019). Q Refer to Qa (b) of End Term Examination 2019 (Pg. No. 13-2019). Q. Refer to Q5 (a) of End Term Examination 2019 (Pg. No. 13-2019) Q. Refer to Q.6 (a),(b),(c) of End Term Examination 2019 (Pg. No. 16,17-2019). UNIT - UI Q. Refer to Q.1 (a) of First Term Examination 2016 (Pg. No. 1-2016). Q. Refer to Q.2 (b) of First Term Examination 2016 (Pg No. 5-2016) Q. Refer to Q.2 (c) of First Term Examinatisn2016 (Pg No. 6-2016). Q. Refer to Q.1 (c),(d) of End Term Examination 2016 (Pg. No. 20-2016). Q. Refer to Q.2 (v),(c) of End Term Examination 2016 (Pg. No. 22,28-2016). Q. Refer to Q.3 (a) of End Term Examination 2016 (Pg. No. 23-2016), Q. Refer to Q.3.(b) of End Term Examination 2016 (Pg. No. 24-2016). Q. Refer to QS Refer Question (Pg. No. 31-2016) Q. Refer to QA Refer Question (Pg. No. 32-2016). Q. Refer to Q.1 (a) of First Term Examination 2017 (Pg. No. 3-2017). Q. Refer to Q.2 (b) of First Term Examination 2017 (Pg. No, 4-2017). Q. Refer to Q.1 (d),(e) of End Term Examination 2017 (Pg. No. 12,13-2017). Q. Refer to Q.1 (i) of End Term Examination 201? (Pg. No. 14-2017). Q. Refer to (2 (a) of End Term Examination 2017 (Pg. No. 14-2017). Q. Refer to Q.2 (b),(c) of End Term Examination 2017 (Pg. No. 16-2017). Q. Refer to Q.3 (w),(b) of End Term Examination 2017 (Pg. No. 17-2017) Q. Refer to Q.1 (b) of First Term Examination 2018 (Pg. No. 1-2018). Q. Refer to Q.3 (a),(b) of First Term Examination 2018 (Pg. No. 4-2018). Q. Refer to Q.4 of First Term Examination 2018 (Pg. No. 5-2018). Q. Refer to Q.1 (b) of End Term Examination 2018 (Pg. No. 6-2018). Q. Refer to Q.1 (g) of End Term Examination 2018 (Pg. No. 9-2018). Q. Refer to Q.2 (a),(b),(c) of End Term Examination 2018 (Pg. No. 10-2018). 10-2022 Fifth Semester, Operating System Q. Refer to Q.3 of End Term Examination 2018 (Pg. No. 11-2018) Q. Refer to Q.1 (d) of First Term Examination 2019 (Pg. No. 2-2019 Q Refer to Q.2 (b) of First Term Examination 2019 (Pg. No. 4-2019 Q. Refer to Q.3 (a),(b) of First Term Examination 2019 (Pg. No. 4-2019 Q. Refer to Q.4 of First Term Examination 2019 (Pg. No. 5-2019) Q. Refer to Q.1 (c),(d) of End Term Examination 2019 (Pg. No. 6-2019) Q. Refer to Q.* (h),(j) of End Term Examination 2019 (Pg. No. 7-2019). Q. Refer to Q.2 (b) of End Term Examination 2019 (Pg. No. 8-2019) Q. Refer to Q.3 (b) of End Term Examination 2019 (Pg. No. 11-2019) Q. Refer to Q.3 (c) of End Term Examination 2019 (Pg. No. 12-2019) UNIT - IV Q Refer to Q.1 (a),(c),(d) of Second Term Exam 2016 (Pg. No. 11-2016) Q Refer to Q.2 (a),(b) of Second Term Exam 2016 (Pg, No. 12,13-2016) Q. Refer to Q.3 (b) of Second Term Exam, 2016 (Pg. No. 16-2016) Q. Refer to Q.4 (a) of Second Term Exam 2016 (Pg. No. 17-2016) Q. Refer to Q.4 (b) of Second Term Exam 2016 (Pg. No. 18-2016) Q. Refer to Q.1 (g) of End Term Exam 2016 (Pp. No. 21-2016) Q. Refer to Q.6 (a),(b) of End Term Exam 2016 ( Pg. No. 25-2016) Q. Refer to Q.7 of Second Term Exam 2016 (Pg: No. 29-2016) Q. Refer to Q.1 (h) of End Term Exam 2017)(Pg. No. 13-2017) Q. Refer to Q.1 (j) of End Term Bxam 2017 (Pg. No. 14-2017) Q. Refer to Q.7(a),(b),(c) of End Term Exam 2017 (Pg. No. 29,31-2017) Q. Refer to Q.8 (2),(b),(e) of EndPerm Exam 2017 (Pg. No. 32,35,36-2017) Q. Refer'to Q.9 (a),(b)(c) of End Term Exam 2017 (Pg. No. 37,28-2017) Q. Refer to Q.1 (c), of End‘Term Exam 2018 (Pg No. 8-2018) Q. Refer to. Q.7_of End Term Exam 2018 (Pg. No. 24-2018) Q. Refer to Q.8(a),(b) of End Term Exam 2018 (Pg. No. 25,27-2018) . Refer to Q.9 (a)\b)(c) of End Term Exam 2018 (Pg. No 29,30-2018) @Q Refer to Q.1 (e)(1,(g) of End Term Exam 2019 (Pg, No 6,7-2019) Q. Refer to Q.7 (a),(b)(c) of End Term Exam 2019 (Pg, No. 18,20-2019) Refer to Q8 (a),(b),c) of End Term Exam 2019 (Pg, No, 20.21-2019) Q. Refer to Q.9 (a)(c) of End Term Exam 2019 (Pg. No. 22-2019) END TERM EXAMINATION [JULY 2023] SIXTH SEMESTER [B.TECH] OPERATING SYSTEMS [ETCS-304] ‘Time: 3 Hrs. Max. Marks: 75 Note: Attempt five questions in all including @. No. 1 which is compulsory. Select one question from each unit. 1. Attempt any Five (5 x5 = 2.5) a Q.1. (a) What is the meaning of the term busy waiting? What other kinds of waiting are there in an operating system? Can busy waiting be avoided -altogether? Explain your answer. Q.1 (b) What is multiprogramming operating system? How it is different from Multiprocessing. Explain. Q.1 (c) Explain Process Control Block with the help of suitable diagram in detail. Q.1 (d) Explain race condition with suitable example? Q.1 (e) What are the four conditions that must be present for a deadlock to be possible? Q.1 ( What are various file attributes? UNIT -I Q.2. (a) Explain the layered approach of Opcrating System? What are main task of OS? (6) Q2. (b) Given Memory Partitions of)100K,500K.200K.300K and 600K (in order), how would each of the first fit, best fit, and worst fit algorithms place processes of 212K, 417K, 112K and 426K (in order]? Which algorithms make the most efficient use of memory? (6.5) Q.3 (a) Explain the difference between logical and physical addresses. (3) Q.3 (b )Why are pages'sizes always power of 2? (3) Q.3 (c) Consider there are 4 frames allocated to a process and the page reference string is: 7,0,1,2,0,3,0,4,2,3,0,8,2,1,2,0,1,7,0,1 Calculate the number of page faults for the FIFO and LRU pagereplacement algorithms. (6.5) . UNIT - IT Q.4. (a) Consider the following set of processes with the CPU burst & arrival time in milliseconds. (6.5) Process Arrival Time Burst Time A 0 12 B 1 7 c 2 9 >. D 3 4 = E 4 ll Draw the Gantt chart & find: (i) Average waiting time for these processes with the Shortest Remaining Time first, Round Robin (Time quantum = 3ms) & FCFS scheduling algorithm. 1y- 2022 Fifth Semester, Operating System (ii) Average turnaround time for these processes with the SRTF, Robin & FCFS Algo. (b) Explain the Dining Philosophers classical IPC problem and ita Solution, Roung Q.5 (a) What is thread? What are the differences between user-level th: and kernel-level threads? Under what circumstances is one type better than the other? ®) Q.5. (b) Explain bakery algorithm. Prove that it satisfy all the threy requirements for critical section problem. (65) UNIT - Il : Q.6. (a) A disk with 1000 cylinders, numbered 0 to 999, compute the numbe, | of tracks the disk arms must move to satisfy the entire request in the disk. queue. Assume the current request serviced is at track 345 and head is moving, towards track 0. The queue in FIFO order contains request for the following’ tracks: 123,874,692,400,475,105,376. Perform the computation for the following | scheduling algorithm- 16.5) () FIFO (2) SSTF (3)SCAN (4) C-SCAN (6) LOOK Q.6. (b) Explain resource allocation graph. (3)) Q.6 (c) What is Safe state? Explain with the help of suitable example. (3)! Q7. (a) Explain Bankar's Algorithm including safety algorithm & resource | request algorithm? (6) Q.7. (b) Consider the following snapshot of a syatem- (6.5) Allocation Maximum | Process AB CD ABCD Pl my fa 2 P2 1000 a P3 1354 2356 P4 063 2 0652 P5 O00 104 0656 ‘ Let the available number of resources be given by avail vector as (1, 5, 2, 0). Use banker’s algorithm and answer. 1. Find the contents of the matrix “NEED” 2. Is the system in a safe state? 3. If a request from process P1 for (0,4,2,0) arrives, can it be granted immediately? UNIT -IV Q.8. (a) Explain various types of file and file access methods? (6.5) Q.8. (b) Why do you mean by directory structure? Explain various directory structures with suitable diagram? © Q.8. Write short notes on any two: (6.25 x 2 = 12.5) Q.9. (a) Logical file system v/s Physical file system Q.9. (b) FAT v/s NTFS Q.9. (c) Explain various file allocation strategies FIRST TERM EXAMINATION [FEB. 2016] SIXTH SEMESTER [B.TECH] OPERATING SYSTEM [ETCS-304] Time ; 1.30 Hrs. M.M. : 30 Note: Attempt Q no. 1 which is compulsory and any two more questions. Q.1(a) Why page size is always represented as power of 2? Ans : It is most efficient to break the address into X page bits and Y offset bits, rather than perform arithmetic on the address to calculate the page number and offset Because each bit position represents a power of 2, splitting an address between bits results in a page size that is a power of 2. Q.1(6) What is multiprogramming operating system? Explain. Ans: In a multiprogramming system there are one or more programs loaded in main memory which are ready to execute. Only one program at a time is able to get the CPU for executing its instructions (i.e., there is atymost one process running on the system) while all the others are waiting their turn. The main idea of multiprogramming is to maximize the use of CPU time. Indeed, suppose the currently running process is performing an I/O task (which, by definition, does not need the CPU to be accomplished). Then, the OS may interrupt that process and give the control to one of the other in-main-memory programs that are ready to execute (i.e. process context switching). In this way, no CPU time is wasted by the system waiting for the /O task to be completed, and a running process keeps executing until either it voluntarily releases the CPU or when itblocks for an I/O operation. Therefore, the ultimate goal of multiprogramming is to)keep the CPU busy as long as there are Processes ready to execute. Note that in order for such a system to function properly, the OS must be able to load multiple programs into separate areas of the main memory and provide the required protection to avoid the chance of one process being modified by another one. Other problems that need t0 be addressed when having multiple programs in memory is fragmentation as programs enter or leave the main memory. Another issue that needs to be handled as well is that large programs may not fit at once in memory which can be solved by using paging and virtual memory. T Finally, note that if there are N ready processes and all of those are highly CPU- bound (i.e., they mostly execute CPU tasks and none or very few I/O operations), in the very worst case one program might wait all the other N-1 ones to complete before executing. | Q-1.(c) Explain Process Control Block in brief? Ans: A process in an operating system is represented by a data structure known as 4 process control block (PCB) or process descriptor. The PCB contains important information about the specific process including * The current state of the process i.e., whether it is ready, running, waiting, or whatever, * Unique identification of the process in order to track “which is which” information. * A pointer to parent process, * Similarly, a pointer to child process (if it exists). 2-2016 sixth Bemester, Operating System Sixth * The priority of process (a part of CPU scheduling information) * Pointers to locate memory of processes © The processor it is running on Q.1.(d) What is starvation? What are the possible sulutions y, problem? “tly, ‘Ans: In computer science, starvation 1s 8 problem encountered in computang where a process 18 perpetually denied nesetbary TEMOUTCES Lo prope. Starvation may be caused by errors in 4 scheduling or mutual exclusion 4); hel can alse be caused by resource leaks, and can be intentionally caused vig g tilly service attack wuch as a fork bomb. Starvation is similar to deadlock in that it causes a process to freeze. Two processes become deadlocked when each of thems doing nothing while waitin resource cocupied by another program in the same set. On the other hand, a tin starvation when it is waiting for a resource that is continuously given to othe ae Starvation-freedum is a stronger than the absence of deadlock. g caciusion algurithm that rust choose toflet ene! wo penceasesinto @ critical picks one arbitrarily is deadiock-free, but not starv ii " Possible solution: A possible solution to ttarvation is to use a scheduling: with Prunity queue that also uses the aging techniaue. Aging is a technique cf increasing the priority of s thai waitin the system for a long time. Q-1te) Explain race condition with suitable example? Ans: Race conditions ere moet ‘ormmonly associated with computer sci z ‘condition may occur if commands to read andwa a large amount of datajare received at almost the same instant, and the mada = some cr all of the old data while that old data is still being sx The recat way be oneter mere of the following: a computer crash, an “illegal aonhention aed thutdown of the program, errors reading the old data or errors Petre data Avace epoditien can also occur if instructions are processed in thes order Example: Scppose for a moment that two processes need to perform ait speafie memory location. Under normal circumstances the operation should this: qn this example, Process 1 performs a bit flip, changing the memory "=m 1 Press 2 then performs a bit Sip and changes the memory value from 3 condition occurred caurng thene two processes to overlap, the sequetie Sta look cuore like this: LP. University-(B.Tech)-AB Publisher 2916-4 In this example, the bit has an ending value of 1 when its value should be © Thos occurs because Process 2 is unaware that Process 1 is performing a simultaneous be flip. Q.2.(a) Explain the layered approach of operating system? What are main task of OS. Ans: Layered Approach: With proper hardware support, operating systems can be broken into pieces that are smaller and more appropriate than those allowed by the original MS-DOS or UNIX systems. The operating system can then retain much gre: control over the computer and over the applications that make use of that cen pur, Implementers have more freedom in changing the inner workings of the system and in creating modular operating systems. Under the top-down approach, the overall functionality and features are determined and the separated into components Information hiding is also important, because it leaves programmers free to implement the low-level routines as they see fit, provided that the external interface of the routine stays unchanged and that the routine itself performs the advertised task. A system can be made modular in mafiy, ways. One method is the layered approach, in which the operating system is broken up into a number of layers (levels). The bottom layer (layer 0) id the hardware; the highest (ayer N) isthe user interface An operating-system layer is an implementation of an abstract object made up of data and the operations that can manipulate those data. A typical operating - system layer-say, layer M-consists of data structures and a\sét of routines that can be invoked by higher-level layers. Layer M, in turn, can invoke operations on lower-level layers The main advantage of the layered approach is simplicity of construction and debugging. The layers are selected so that eachuses functions (operations) and services of only lower-level layers. This approach simplifies debugging and system verification. The first layer can be debugged without any concern for the rest of the system, because, by definition, it uses only the basic hardware (which is assumed correct) to implement its functions. Once the first layer is debugged, its correct functioning can be assumed while the second layer is debugged, and so on. If an error is found during debugging of a particular layer, the error must be on that layer, because the layers below it are already debugged. Thus, the design and implementation of the system is simplified. Each layer is implemented with only those operations provided by lower-level layers A layer does not need to know how these operations are implemented; it needs to know only what these operations do. Hence, each layer hides the existence of certain data structures, operations, and hardware from higher-level layers. The major difficulty with the layered approach involves appropriately defining the various layers. Because layer can use only lower-level layers, careful planning is necessary. For example, the device driver for the backing store (disk space used by virtual-memory algonthms} ust be at a lower level than the memory-management routines, because memory gement requires the ability to use the backing store. Other requirement may not be o obvious. The backing-store driver would normally above the CPU scheduler, because the driver may need to wait for I/O and the CPU be rescheduled during this time, However, on a larger system, the CPU scheduler 'y have more information about all the active processes than can fit in memory. fore, this information may need to be swapped in and out of memory, requiring the store driver routine to be below the CPU scheduler. A final problem with layered implementations is that they tend to be less efficient in other typea. For instance, when a user program executes an I/O operation, it ites a aystem call that is trapped to the‘I/O layer, which calls the memiory- 4-2016 Sixth Semester, Operating System management layer, which in turn calls the CPU-scheduling layer, which is then pag, to the hardware. At each layer, the parameters may be modified; data may neeq toe passed, and so on. Each layer adds overhead to the system call; the net resuls jy a system call that takes longer than does one on a non-layered system. These Virriiteaticny have caused a small backlash against layering in recent years. Fewer layers with tregg functionality are being designed, providing most of the advantages of medularized Che while avoiding the difficult problems of layer definition and interaction. Main tasks of Operating System: There are several tasks which are performed by practically all operating system, regardless of the complexity of the computer the operating system is being used on, These tasks include: * Managing communications between software and hardware. * Allocation of computer memory. * Allocation of CPU time. * Organising data on backing storage devices. Managing Communications between Software and Hardware There are many tasks which practically every program written for a computer will need to carry out. For example : a * Loading and saving data and programs. * Communicating with peripherals such as a mouse ora printer. * Displaying information on the VDU. There has to be some control over these activities to make sure that problems do not occur. Consider what might happen ifa computer program was trying to load a file from a floppy disk and, at the same time, another program was trying to save data. ‘Therefore the operating system manages all of these tasks. If, for example, a program wants to save or print afile it must send a request to the operating system asking itt do so. The operating system will then carry out the task. Becatise an application such as a spreadsheet works by communicating with the operating system the application will probably only work with one particular operating system. If you buy Microsoft Works for Windows 2000 it will only operate on computer with the Windows 2000 operating system. If you want to use Microsoft Works with th MS-DOS operating system you will have to buy a different version of the application Computer Software Messages 4 Putting commonly used operations such as saving data into the operating sy also reduces the amount of work that a person writing a new application must Allocation of Computer Memory a Computer memory must be allocated to (divided between) the different task the computer is performing. Even if your computer appears to be doing only one such as word processing there will be several different items to which memory allocated. For example memory would have to be allocated to storing thé ieee LP. University-B.Tech)-AB Publisher 2016-65 processor program, storing your word processed document and storing a copy of the image that is being displayed on the monitor. And of course the operating system iteelf will also use up some memory. 8BMb 12Mb ve fae Sotware Memory Example Allocation of Computer Memory Allocation of CPU Time Most computers have only one microprocessor in their Central Processing Unit (CPU). Therefore the CPU can only process one piece of data at a time. The CPU’s time must be divided up between all of the tasks that the computer is currently carrying out. If you were printing a document form a word processor application then the CPU's time would need to be divided up between: * Letting you type on the computer. * Sending the document that is being printed to the printer. * Updating the screen display to show you what is going on. Chunks of the CPU's time known as time slices are allocated to each task in turn. Time slices are normally very short so that cach task can appear to be running at the same time. Organising Data on Backing Storage Devices Work and programs must be saved on a backing storage device go that they can be kept when a computer is turned off. The operating system is responsible for organising data on backing storage devices. Work and programs are saved as files which must be organised so that they can be found and loaded when required. Each file is identified by a filename. Most operating systems divide a backing storage device up into directories (also known as folders). Files can be stored within each directory. Q.2.(6) On a simple paged system, associative registers hold the most active page entries & full page table is stored in the main memory. If the references satisfied by the associative registers take 100ns & reference through the main memory page table take 180ns.What must be the hit ratio to be achieved on effective access time of 125ns? Ans: Effective Access Time= [x*(m,+m,)] + [(1-x)*(c +m,+m,)} Where m, represents references satisfied by associative registers, m, represents Teference through main memory, c represents access the page table, x represents the hit Tatio. So, EAT = [x*(100+180)]+{(1-x)*(180+100+180)} 125 = (280x)+(460-460x) 125 = 460-180x 180x = 460-125 180x = 335 x = 1.86%(Hit Ratio) 6-2016 Sixth Semester, Operating System Q.2.(c) What is Belady’s Anomaly? Explain with the help of suita, examples. ble Ans: Belady's Anomaly is also called FIFO anomaly. Usually, on increasing number of frames allocated to a process virtual memory, the process execution is fag, because fewer page faults occur. Sometimes, the reverse happens, i.e., the executi,” time increases even when more frames are allocated to the process. This is Beladyy Anomaly. This is true for certain page reference patterns. Example : Page faults are marked with an “f". 1: In this case Assume frame size is 3 Page Requests 3 os 03 24 Ss 21 Om Newest Page sf oafif Of 3f 2f 4f 4 4 If OF Qg 8.2 9 1 BS. 26) 2648040 Jee Oldest Page 3 2@MMo 3 3 8 2 4 4 2: In this case Assume frame size is 4 Page Requests 3 2 eee 2 1 0 € Newest Page 3f 2fif Of O O 4f Sf 2f If Of 4f 3.2 1‘ Ow 42 0 3 2 fmt 0 4 8 2 1 Oldest Page Beam 2 10 4 38 In the first example (with fewer page’), there are 9 page faults. In the second example (with more pages), there are 10 page faults. Q.3.(a) What are various scheduling criteria? Ans: There are many different criteria’s to check when considering the “bes scheduling algorithm: 1. CPU utilization: To make out the best use of CPU and not to waste any CP cycle, CPU would be working most of the time(Ideally 100% of the time). Considering real system, CPU usage should range from 40% (lightly loaded) to 90% (heavily loaded 2. Throughput: It is the total number of processes completed per unit time rather say total amount of work done in a unit of time. This may range from 10/secot to I/hour depending on the specific processes. 3. Turnaround time: It is the amount of time taken to execute a particular proce ie. The interval from time of submission of the process to the time of completion oft process(Wall clock time). 4, Waiting time: The sum of the periods spent waiting in the ready queue amou of time a process has been waiting in the ready queue to acquire get control on the 5. Load average: It is the average number of processes residing in the ready qv waiting for their turn to get into the CPU. 6. Response time: Amount of time it takes from when a request was submit until the first response is produced. Remember, it is the time till the first response not the completion of process execution (final response). In general CPU utilization and Throughput are maximized and other reduced for proper optimization. LP. University-(B,Tech)-AB Publisher Q.3.(b) Consider the following set of processes with the CPU burst time in milliseconds? 2016-7 & arrival Process Arrival Time Burst Time A 0 10 B 1 5 c 2 8 D 3 4 E 4 11 Draw the Gantt chart & find: (i) Average waiting time for these processes with the shortest Remaining Time First, Round Robin (Time quantum=3ms) & FOFS scheduling algorithms. (ii) Average turnaround time for these processes with the shortest Remaining Time First, Round Robin (Time quantum=3ms) & FCFS scheduling algorithms. Ans: Gantt Chart for FCFS [a Ts ToloTe] 0 10 15 23 27 38 For FCFS: Process | AT BT ct | TATs(CTPAT) | wreraT-BT) A 0 10 10 10 0 B 1 5 15, 14 9 c 2 8 23 21 13 D 3 4 27 24 20 E 4 u 38 34 23 (i) Average Waiting Time=(0+9+13+20+23)/5=65/5=13ms (ii) Average Turnaround Time=(10+14+21+24+34)/5=103/5=20.6ms Gantt Chart for SRTF Alslip[clale 0 1 6 10 18 27 38 For SRTF: Process | AT | BT cr =(CT-AT) | WTe(TAT-BT) A 0 10 27 27 7 B 1 5 6 5 0 c 2 8 18 16 8 D 3 4 10 1 3 E 4 ul 38 34 23 (i) Average Waiting Time=(17+0+8+3+23)/5=51/5=10.2ms (ii) Average Turnaround Time=(27+5+16+7+34/5=89/5=17.8ms 2016 Sixth Semester, Operating System Gantt Chart for RR(Time quantum 3ma) [falplelolaleletelpltaletatecl ae) 0 3 6 9 12 16 18 20 2 24 27:80 St SA 38 For RR(Time quantum 3ms) BT cr TATs(CT-AT) WT=(TATAT) 31 a. 19 4 31 23 a 17 a 23 G) Average Waiting Time=(21+14+23+17+23/5=98/5=19.6ms (ii) Average Turnaround Time=(314+19+31+21434)/5 =136/5=27.2m8 Q.4. (a) Explain bakery algorithm, Prove that itsatisfies all the three requirements for critical section problem, Ans: Bakery algorithm: The Bakery algorithm is one of the simplest knowr solutions to the mutual exclusion problem for the general case of N process, The basi idea is that each non-thinking process has.a variable that indicates tho position of tha process in a hypothetical queue of all the non-thinking processes. Each process in thi queue scans the variables of the other processes, and enters the critical section onl; upon determining that it is at the head of the queue. But the resulting algorithm is stillnot easy to understand. So in this note we firs look at a simplified version of the bakery algorithm, based a coarser grain of atomicit than is allowed by the mutual exclusion problem. Solution to the Critical Section Problem must meet three conditions... 1. Mutual excliision: Ifprocess is executing in its critical section, no other proces is executing in its critical section 2. Progress: If no/process is executing in its critical section and there exists som processes that wish to enter their critical sections, then only those processes that an not executing in their remainder section can participate in the decision of which wi enter its critical section next, and this decision cannot be postponed indefinitely Ifno process is in critical section, can decide quickly who enters Only one process can enter the critical section so in practice, others are put onth queue 3. Bounded waiting: There must exist a bound on the number of times that processes are allowed to enter their critical sections after a process has made to enter its critical section and before that request is granted The wait is the time from when a process makes a request to enter ite section until that request is granted In practice, once a process enters its critical section, it does not get another ti until a waiting process gets a turn (managed as a queue). 4 The three requirements for critical section problem Suppose that Pi is in its critical section, and Pk(k!=i) has already chose? number(k], there are two cases: 5» til LP. University-(B,Tech)}-AB Publisher 2016-9 1. Pk has already chosen its number when Pi does the last test before entering its critical section. In this case, if (numbert({i) i) < (number{k},k) does not hold, since they cannot be equal, s0 (number(i}i) > (number{k},k). Suppose this is true, then Pi cannot get into the cirtical section before Pk does, and Pi will looping at the last while statement until the condition does not hold, which is modified by Pk when it exits from its critical section Note that if Pk get a new number again, it must be larger than that of Pi’s. 2. Pk did not chose its number when Pi does the last test before entering its critical section. In this case, since Pk has chosen its number when Pi is in its critical section, Pk must chose its number later than Pi. According to the algorithm, Pk can only get a bigger number than Pi, so (numberfi],i) < number({k],k) holds. Q.4.(6) Define a monitor? Ans: In concurrent Programming, a monitor is a synchronization construct that allows threads to have both mutual exclusion and the ability to wait (block) for a certain condition to become true. Monitors also have a mechanisin for signalling other threads that their condition has been met. A monitor consists of a mutex (lock) object and condition variables. A condition variable is basically a container of threads that are waiting for a certain condition. Monitors provide a mechanism for threads to temporarily give up exclusive access in order to wait for some condition to be mét, before regaining exclusive access and resuming their task. Another definition of monitor isa thread-safe class, object, or module that uses wrapped mutual exclusion in order to safely allow access to a method or variable by more than one thread. The defining characteristic of a monitor is that its methods are executed with mutual exclusion: Ateach point in time, at most one thread may be executing any of its methods. Using avendition variable(s), it can also provide the ability for threads to wait on a certain condition (thus using the above definition of a ‘monitor”). For the rest of this, article, this sense of “monitor” will be referred to as a ‘thread-safe object/class/module”, Q.4.(c) Explain the Dining Philosophers Problem? Ans: The Dining Philosophers problems are a classic synchronization problem E. W. Dijkstra. Co-operating Sequential Processes). Dining Philosophers: There is a dining room containing a ircular table with five chairs. At each chair is a plate, and ween each plate is a single chopstick. In the middle of the ble is a bowl of spaghetti. Near the room are five Philosophers ‘ho spend most of their time thinking, but who occasionally get lungry and need to eat so they can think some more. In order to eat, a philosopher must sit at the table, pick up two chopsticks to the left and right of a plate, then serve and t the spaghetti on the plate. Thus, each philosopher is represented by the following pseudocode: Process P[i] while true do ( THINK; PICKUP(CHOPSTICKIi], CHOPSTICK[i+1 mod 5)); EAT; PUTDOWN(CHOPSTICKIi), CHOPSTICK{i+1 mod 5) ) 10-2016 Sixth Semester, Operating System philosopher may THINK indefinately. Every philosopher who EATs will event finish. Philosophers may PICKUP and PUTDOWN their chopsticks in either Order non deterministically, but these are atomic actions, and, of course, two Philosophy cannot use a single CHOPSTICK at the same time. ‘The problem is to design a protocol to satisfy the liveness condition: any philosop, who tries to EAT, eventually does. Discussion. Of course, the best thing is to go off and try to solve this problem, your own by exploring various protocols philosophers might use to acquire chopstig You are likely to quickly encounter the same deadlock and livelock scenarios we say the mutual exclusion problem, but you will quickly see in this case that mutual exclug is too primitive a synchronization mechanism for solving this problem. Similar solutions are found in most operating systeins textbooks. All of them; renditions of the original treatment by Dijkstra, which motivated the semaph mechanism he was introducing in his original article. A\emph(semaphore} is an inte or boolean value, S, with two associated atomic operations: DOWN(S) wait until S > 0, then decrement S; UPS) increment S In time-sharing systems, “waiting” is implemented by the operating system, wi may put processes on a wait-list for later execution. In hardware, “waiting” may accomplished by busy-waiting or by some form of explicit signaling, such as to passing. SECOND TERM EXAMINATION [APRIL- 2016) SIXTH SEMESTER [B.TECH] OPERATING SYSTEM [ETCS- 304] Time : 1.30 Hrs. M.M.:30 Note: Attempt Q no. 1 which is compulsory and any two more questions. Q.1.(a) Explain seek time and rotational latency in disk scheduling? (2.5%4=10) Ans : Seek Time: Seck time is the time taken to locate the disk arm to a specified track where the data is to be read or write. So the disk scheduling algorithm that gives minimum average seek time is better. Rotational Latency: Rotational Latency is the time taken by the desired sector of disk to rotate into a position so that it can access the read/write heads. So the disk scheduling algorithm that gives minimum rotational lateney is better. Q.1.(6) What are the four conditions that must be present for a deadlock to be possible? Ans: Deadlock Conditions 1, Mutual Exclusion: The resources involved must be un-shareable; otherwise, the processes would not be prevented from using thé resource when necessary. 2. Hold and wait or partial allocation: The processes must hold the resources they have already been allocated while waiting for other (requested) resources. If the Process had to release its resources when anew resource or resources were requested, deadlock could not occur because the procéss would not prevent others from using resources that it controlled. 3. No preemption: The processes must not have resources taken away while that resource is being used. Otherwise, deadlock could not occur sir.ce the operating system could simply take enough)resources from Tunning processes to enable any process to finish. 4, Resource waiting or circular wait: A circular chain of Processes, with each process holding resources which are currently being requested by the next process in the chain, cannot exist. If it does, the cycle theorem (which states that “a cycle in the resource graph is necessary for deadlock to occur”) indicated that deadlock could occur. Q.1.(c) What are various file attributes? Ans: File attributes are settings associated with computer files that grant or deny certain rights to how a user or the operating system can access that file. For example, IBM compatible computers running MS-DOS or Microsoft Windows have capabilities of having read, archive, system, and hidden attributes. *Read-only - Allows a file to be read, but nothing can be written to the file or changed. *Archive - Tells Windows Backup to backup the file. * System - System file. *Hidden - File will not be shown when doing a regular dir from DOS, Q.1.(d) Explain the term caching and buffering? Ans: Buffering: * Preloading ‘data into a reserved area of memory (the buffer). 12-2016 Sixth Semester, Operating System * It temporarily stores input or output data in an attempt to better match 4’ speeds of two devices such as a fast CPU and a slow disk drive. & ¢ Buffer may be used in between when moving data between two processes wy acomputer. Data is stored in buffer as it is retrieved frora one processes or just belay it is sent to another process. : * With spooling, the disk is used as a very large buffer. Usually complete jobs a queued on disk to be completed later. It is mostly used for input, output, and sometimes temporary storage of data eithe when transfer of data takes place or data that may be modified in a non-sequentiy manner. 5 Caching: J * Caching transparently stores data in component called Cache, so that futua request for that data can be served faster. : + A special high-speed storage mechanism. It can be either a reserved sectiony main memory or an independent high-speed storage device. : « The data that is stored within a cache might be values that have been computa earlier or duplicates of original values that are stored elsewhere: E.g: Memory Cachiny Disk Caching, Web Caching(used in browser), Database Caching etc. Acache’s sole purpose is to reduce accesses to the underlying slower storage. Q.2.(a) A disk with 1000 cylinders, numbered 0 to 999, compute the numb of tracks the disk arms must move to satisfy the entire request in the di: queue. Assume the last request serviced was at track 345 and head is movis towards track 0. The queue in FIFO order contains request for the followil tracks :123,874,692,345,475,105,376. Perform the computation for the followil scheduling algorithms- ( (1) FIFO (2) SSTF (3) SCAN (4) C-SCAN (5) LOOK (6) C-LOOK “Ans: (1) FIFO - 2013 The tracks traveled to will be 345,123, 874, 692, 475, 105 and 376 making the t2 distance 222-475 1+ 1824+217+370+271=2013. (2) SSTF - 1298 The tracks traveled to will be 345, 376, 475, 692, 874, 123 and 105 making! total distance 529+769=1298 (3) SCAN - 1219 The tracks traveled to will be 345,123, 105, 0, 376, 475, 692 and 874 making total distance 345+874 =1219 (4) C-SCAN - 1967 The tracks traveled to will be 345,123, 105, 0, 999, 874, 692, 475 and 376 oa the total distance 345+999+623 =1967 (5) LOOK - 1009 The tracks traveled to will be 345, 123, 105, 376, 475, 692 and 874 m total distance 240+769=1009 (6) C-LOOK - 1507 The tracks traveled to will be 345, 123, 105, 874, 692, 475 and 376 total distance 240+769+498=1507 LP. University-(B.Tech)-AB Publisher 2016-13 .2.(b) Differentiate between logical file system and physical file system, 4) ‘Ans: Physical file Logical file . Occupies the portion of memory. . Does not occupy any memory It contains the original data, space. Does not contain any data. It loads itself at run time as per the defined access path. 2. A physical file contains one record 2. A logical file can contain up to 32 format. record formats. 3._Can exist even without LF 3. Can't exist without PF 4. If there is a logical file for a PF, the 4, Ifthere is a logical file for a PF, the PF can't be deleted until and unless LF can be deleted without deleting we delete the LF. the PF. 5. CRTPF command is used to create 5. CRTLF command is used to such creat such object. object. Q.3.(a) Consider the following snapshot of a system. Process Allocation Maximum Available AB CD ABCD ABCD Pl 0012 oo1 2 1520 P2 1000 1750 P3 1354 2356 P4 0632 0652 P5 0-0 14 0656 Let the available number of resources be given by avail vector as (1, 5, 2, 0). e banker’s algorithm and answer. 1.Find the contents of the matrix “NEED", 2. Is the system in a safe state? 3. If a request from process P, for (0, 4, 2, 0) arrives, Can it be granted ediately? (6) Ans. 1. Need 2. Banker's Algorithm Step 1: Safety for process P, Need, = (0,0, 0,0) 14-2016 Blath Hemeater, Operating Hystern Ifnevd, <¢ Available if (10, 0,0,0) < (1,6, 2, 0)| (true) Process P, will execute. Available = Available + Allocation = (1,5, 2, 0) + (0,0, 1,2) =(1,6,4,2) Step 2 Safety for process P, Need, = (0,7, 6,0) ifneed, < Available if((0, 7,5,0) ¢ 1,6, 4,2) Proceas P, must wait Step a Safety for process P, Need, = (1, 0,0, 2) ifneed, < Available if{(1, 0,0, 2) < (1, 6,4, 2)) (true) Process P, will execute, Available = Available + Allocation = (1, 5,3, 2)+(1, 3,6, 4) = (2, 8, 8, 6) Step 4: Safety for process PY, need, #(0, 0, 2.0) Ifneed, « Available 1f((0, 0,2, 0) < (2,8, 8 6)! Process Py will execute. Available = Available + Allocation = (2, 8, 8, 6) + (0, 0, 4, 2) = (2, 14, 11,8) Stop 6: Safety for process Py Need, = (0, 6,4, 2) ifneed, < Available if{(0, 6, 4,2) ¢ (2,14, 11, 4)) Process P, will execute, Available = Available + Allocation = (2, 14, 11, 8) + (0,0, 1, 4) = (2, 14, 12, 12) Btep 6 Bafety for proce need, # (0,7,5,0) LP. University-(B,Tech)-AB Publisher ifneed, < Available if{(0, 7, 5,0) < (2, 14, 12, 12)) Process P, will execute. Available = Available + Allocation = (2, 14, 12, 12) + (1, 0,0, 0) = (3, 14, 12, 12) Safety Sequence = Sf a request from process P, for (0, 4, 2, 0) arrives, Can it be granted nmediately? After allocated process P, request it will subtract from the available. So ew available comes (1, 1,0, 0) Step 1: Safety for process P, Need, =(0,0,0,0) Ifneed, < Available if [(0, 0, 0, 0) < (1, 1, 0, 0)) (true) Process P, will execute. - Available = Available + Allocation =(1, 1, 0,0) + (0,0, 1, 2) =(1,1,1,2) Step 2: Safety for process P, Need, = (0, 7, 5, 0) ifneed, < Available if (0, 7, 5, 0)< (1,1, 1,2)) Process P, must wait? Step 3: Safety for process P; Need, = (1,0, 0, 2) ifneed, < Available if (1, 0, 0, 2) < (1, 1, 1, 2)) (true) 88 P, will execute. wailable = Available + Allocation (1, 1, 1, 2) + (1,3, 5, 4) 2016-15 1. = (0,0, 2, 0) ‘need, < Available ((0, 0, 2,0) < (2,4, 6, 6)) Sixth Semester, Operating System 16-2016 =(2, 4,6, 6) + (0, 6, 3, 2) = (2, 10, 9, 8) Step 5: Safety for process P, Need, = (0, 6, 4, 2) ifneed, < Available if ((0, 6, 4,2) < (2, 10,9, 8)] Process P, will execute. Available = Available + Allocation = (2, 10, 9, 8) + (0, 0, 1, 4) = (2, 10, 10, 12) Step 6: Safety for p rocess P, need, = (0,7, 5, 0) ifneed, < Available if ((0, 7, 5, 0) < (2, 10, 10, 12))} Process P, will execute. Available = Available + Allocation = (2, 10, 10, 12) + (1, 0, 0,0) = (3, 10, 10, 12) Safety Sequence = Hence the new system state is safe, so we can immediately grant the request rocess P, Q.3.(6) Explain various file allocation strategies (i) Contiguous ~ (i) Linked (iii) Indexed ‘Ans: (i) Contiguous Allocation: With contiguous allocation, each file has to oee contiguous blocks on the disk. The location of a file is defined by the disk address of first block and its length. Both sequential access and direct/Random access are suppa by the contiguous allocation. The disadvantage of contiguous allocation is thati often difficult to find free space for a new file. Moreover, one is often not sure of thes required while creating a new tue. The various methods adopted to find space fora file suffer from external fragmentation. (ii) Linked Allocation: In linked allocation, each file is a linked list off blocks. The directory contains a pointer to the first and (optionally the last) blockd file, For example, a file of 5 blocks which starts at block 4, might continue at bla then block 16, block 10, and finally block 27. Each block contains a pointer to the! block and the last block contains a NIL pointer. The value -1 may be used for, differentiate it from block 0. j With linked allocation, each directory entry has a pointer to the first disk By the file. This pointer is initialized to nil (the end-of-list pointer value) to si; block and writes to that block s empty file. A write to a file removes the first free new block is then linked to the end of the'file. To read a file, the pointers # P followed from block to block. $i There is no external fragmentation with linked allocation. Any free well i e size” used to satisfy a request. Notice also that there is no need to declare tht

You might also like