OPERATING SYSTEMS FINAL EXAMINATION APRIL 30, 2006 ANSWER ALL OF THE QUESTIONS BELOW.

Similar documents
Operating Systems Comprehensive Exam. Spring Student ID # 2/17/2011

MC7204 OPERATING SYSTEMS

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

Department of Computer applications. [Part I: Medium Answer Type Questions]

QUESTION BANK UNIT I

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

COMP 3361: Operating Systems 1 Midterm Winter 2009

COMP 300E Operating Systems Fall Semester 2011 Midterm Examination SAMPLE. Name: Student ID:

Operating Systems Comprehensive Exam. Fall Student ID # 10/31/2013

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

Operating Systems Prof. Allan Gottlieb Practice Final Exam Page 1 Name

COMP 3361: Operating Systems 1 Final Exam Winter 2009

1. Consider the following page reference string: 1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.

(b) External fragmentation can happen in a virtual memory paging system.

Operating Systems: Quiz2 December 15, Class: No. Name:

SNS COLLEGE OF ENGINEERING

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

CHAPTER NO - 1 : Introduction:

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad COMPUTER SCIENCE AND ENGINEERING QUESTION BANK OPERATING SYSTEMS

Department of CSIT ( G G University, Bilaspur ) Model Answer 2013 (Even Semester) - AR-7307

Chapter 7: Deadlocks. Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009!

Q 1. (10 Points) Assume that a process executes the following pseudo codes:

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

The Deadlock Problem

SYED AMMAL ENGINEERING COLLEGE CS6401- OPERATING SYSTEM

Exam Guide COMPSCI 386

CS4411 Intro. to Operating Systems Exam 2 Fall 2009

Chapter 7: Deadlocks

FCM 710: Architecture of Secure Operating Systems

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory

Maximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait

R1 R2 R3 R CS 370: Operating Systems Department of Computer Science Colorado State University

CMPS 111 Spring 2003 Midterm Exam May 8, Name: ID:

CLASS: II YEAR / IV SEMESTER CSE SUBJECT CODE AND NAME: CS6401 OPERATING SYSTEMS UNIT I OPERATING SYSTEMS OVERVIEW

CS4411 Intro. to Operating Systems Final Fall points 10 pages

Chapter 7: Deadlocks. Operating System Concepts 8 th Edition,

CS 162 Midterm Exam. October 18, This is a closed book examination. You have 60 minutes to answer as many questions

CMPS 111 Spring 2013 Prof. Scott A. Brandt Midterm Examination May 6, Name: ID:

CSE Opera+ng System Principles

Operating System(16MCA24)

Chapter 7: Deadlocks. Operating System Concepts 8 th Edition,

INSTITUTE OF AERONAUTICAL ENGINEERING

Chapter 7: Deadlocks. Chapter 7: Deadlocks. The Deadlock Problem. Chapter Objectives. System Model. Bridge Crossing Example

Operating Systems (1DT020 & 1TT802)

CS 3204 Operating Systems Programming Project #2 Job / CPU Scheduling Dr. Sallie Henry Spring 2001 Due on February 27, 2001.

CS370 Operating Systems

The Deadlock Problem (1)

FCM 710: Architecture of Secure Operating Systems

Homework Assignment #5

CS630 Operating System Design, Second Exam, Fall 2014

EECE.4810/EECE.5730: Operating Systems Spring 2017 Homework 3 Solution

Chapter 7 : 7: Deadlocks Silberschatz, Galvin and Gagne 2009 Operating System Concepts 8th Edition, Chapter 7: Deadlocks

CPU Scheduling. CSE 2431: Introduction to Operating Systems Reading: Chapter 6, [OSC] (except Sections )

Scheduling of processes

CSE 120 Principles of Operating Systems

CS4411 Intro. to Operating Systems Final Fall points 12 pages

1.1 CPU I/O Burst Cycle


University of Waterloo Midterm Examination Model Solution CS350 Operating Systems

Chapter 7: Deadlocks. Operating System Concepts with Java 8 th Edition

Last Class: Deadlocks. Today

Unit In a time - sharing operating system, when the time slot given to a process is completed, the process goes from the RUNNING state to the

Fall COMP3511 Review

Deadlock Prevention. Restrain the ways request can be made. Mutual Exclusion not required for sharable resources; must hold for nonsharable resources.

UNIT-5 Q1. What is deadlock problem? Explain the system model of deadlock.

Topic 4 Scheduling. The objective of multi-programming is to have some process running at all times, to maximize CPU utilization.

Chapter 7: Deadlocks

CPSC/ECE 3220 Summer 2017 Exam 2

CSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo

COP 4610: Introduction to Operating Systems (Spring 2016) Chapter 7 Deadlocks. Zhi Wang Florida State University

Question Points Score Total 100

Chapter 7: Deadlocks. Operating System Concepts 9 th Edition

Unit 3 : Process Management

CPU Scheduling (1) CPU Scheduling (Topic 3) CPU Scheduling (2) CPU Scheduling (3) Resources fall into two classes:

General Objectives: To understand the process management in operating system. Specific Objectives: At the end of the unit you should be able to:

OPERATING SYSTEMS ECSE 427/COMP SECTION 01 WEDNESDAY, DECEMBER 7, 2016, 9:00 AM

STUDENT NAME: STUDENT ID: Problem 1 Problem 2 Problem 3 Problem 4 Problem 5 Total

b. How many bits are there in the physical address?

Deadlocks. Operating System Concepts - 7 th Edition, Feb 14, 2005

( B ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Shared memory (C) Semaphore (D) Monitor

Chapter 8: Deadlocks

Chapter 8: Deadlocks. The Deadlock Problem. System Model. Bridge Crossing Example. Resource-Allocation Graph. Deadlock Characterization

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Chapter 7: Deadlocks

CPU Scheduling Algorithms

CSI3131 Final Exam Review

CS307 Operating Systems Deadlocks

Deadlocks. Bridge Crossing Example. The Problem of Deadlock. Deadlock Characterization. Resource-Allocation Graph. System Model

Deadlocks. Deadlock Overview

PESIT SOUTHCAMPUS. Question Bank

System Model. Types of resources Reusable Resources Consumable Resources

Module 7: Deadlocks. The Deadlock Problem. Bridge Crossing Example. System Model

Operating System Design

Properties of Processes

King Fahd University of Petroleum and Minerals. Write clearly, precisely, and briefly!!

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

OPERATING SYSTEMS. Sharafat Ibn Mollah Mosharraf TOUCH-N-PASS EXAM CRAM GUIDE SERIES. Students. Special Edition for CSEDU

Last Class: Synchronization Problems. Need to hold multiple resources to perform task. CS377: Operating Systems. Real-world Examples

Course Description: This course includes the basic concepts of operating system

Transcription:

OPERATING SYSTEMS FINAL EXAMINATION APRIL 30, 2006 Name ANSWER ALL OF THE QUESTIONS BELOW. 1. Indicate which of the statements below are true or false and EXPLAIN your answer in ONE SENTENCE. a) A multi-level indexed file descriptor permits faster random access than a file descriptor with a single level of index. b) The dispatcher is the part of the Operating System that determines the priority of each process. c) A particular semaphore is used by only two processes at a time. 2. A number of jobs enter a system with characteristics shown in the table. Job Entry Time Burst Time 1 0 3 2 2 2 3 4 6 4 5 5 6 7 1 Determine the average turnaround (or completion ) time for these jobs using each of these scheduling mechanisms: a) FCFS b) Shortest job first with preemption. c) Round robin with time quantum of 3 seconds (no preemption). 3. Code has been written (see below) which claims to provide support for a critical section. Evaluate the code and answer the following: a) Does the code meet the three criteria for a critical section? b) If yes, justify your answer. If no, explain why not.

[There are two equivalent processes contending for control of a critical section, only one of which is shown below.] program DoesThisWork var p1_wants_to_enter, p2_wants_to_enter: boolean; procedure p1; while true do p1_wants_to_enter := true; while p2_wants_to_enter do p1_wants_to_enter := false; delay( short_random_time ); p1_wants_to_enter := true; end; /* while p2... */ CRITICAL SECTION p1_wants_to_enter := false; OTHER-NON-CRITICAL-STUFF end; /* while true */ end; /* procedure p1 */ p1_wants_to_enter := false; p1; end. /* program DoesThisWork */ 4. A particular river crossing is shared by both managers and engineers. Managers are assumed to be dangerous for engineers and so certain rules are required. You have been hired to write synchronization code to make sure that the engineers are safe. The boats used to cross the river seat three people, and must always carry a full load. In order to guarantee the safety of the engineers, no boat must ever carry more than one manager. You are to write code containing TWO procedures: "Check_Engineer" and "Check_Manager". The procedures group the arriving engineers and managers into safe boatloads. The appropriate procedure will be called by each engineer or manager when it arrives at the river crossing. The procedures shouldn't complete until enough

passengers have arrived for a safe boatload; in other words, the procedures provide a "gate" to prevent entrance onto the boat until all three participants are present. The procedures for each of the three lucky passengers should return at about the same time. a) List the constraints that must be satisfied before these procedures can return? b) c) Use this page and the next to write the code for Check_Engineer and Check_Manager in C using semaphores. Be sure to describe any shared variables and semaphores and give their initial values. There must NOT be any busy waiting in your solution. 5. See the following snapshot of a system containing four resources A, B, C, & D. Current Allocation Maximum Need Available A B C D A B C D A B C D p0 0 0 1 2 0 0 1 2 1 5 2 0 p1 1 0 0 0 1 7 5 0 p2 1 3 5 4 2 3 5 6 p3 0 6 3 2 0 6 5 2 p4 0 0 1 4 0 6 5 6 Answer the following questions using the Banker's/safety algorithm: a) What is the content of the matrix "need"? b) Is the system in a safe state? Prove it! c) If a request from process p1 arrives for ( 0,4,2,0 ), can the request be immediately granted?

6. Consider the following resource graph in a state S, with maximum claims shown by dashed lines. P1 and P2 are processes, R1 and R2 are resources holding the number of resources shown: P1 R1: O O O R2: O O P2 In state S, none of the resources have been allocated, they just MIGHT be allocated. a) Show a sequence of operations leading from state S to a deadlock state. b) Show how deadlock could have been prevented, in your example in part a), by using an appropriate deadlock prevention technique. Physical Frame Address PHYSICAL Number 7. A pure paging system has a page \ MEMORY / size of 512 words, a virtual 0+------------+0 memory of 512 pages numbered ~ ~ 0 through 511, and a physical ~ ~ memory of 10 page frames numbered 1536+------------+3 0 through 9. The current content Page 34 of physical memory is shown to 2048+------------+4 the right: Page 9 +------------+5 ~ ~ 3072+------------+6 Page Table 3584+------------+7 Page 65 +------------+8 ~ ~ 4608+------------+9 Page 10 +------------+

a) Assuming that page tables contain frame numbers (rather than physical memory addresses ), show the current content of the page table. b) Show the content of the page table after page 49 is loaded at frame number 0 and page 34 is replaced by page 12. c) What physical address is referenced by each of these virtual addresses: 4608, 5119, 5120, 33300. d) What happens when virtual address 33000 is referenced? 8. Assuming a physical memory of FOUR page frames, give BOTH the sequence of faults AND the GRAND TOTAL number of page faults for the reference string a b g a d e a b a d e g d e for each of the following policies. (Initially all frames are empty. ) It is recommended for a) and b) below that you draw the sequence of events by showing the pages which are in the FRAMES. For c) however, the simplest picture is one based on PAGES; showing which pages are physically in memory at each event. a) FIFO b) LRU c) Working Set (with T = 3). Do this one in terms of pages rather than frames. How many page faults occur for each of these scheduling types? 9. We wish to evaluate various seek algorithms for a moveable head disk. This disk has 100 cylinders. Suppose the head is currently at cylinder 40, having just completed a transfer. During that transfer, the following requests ( in chronological order ) were received:

60, 40, 30, 70, 20, 10. For EACH of the algorithms, FCFS, SSTF, SCAN, and C-SCAN a) List the order in which the cylinders are accessed. b) Determine the total seek distance travelled.