COMP 3361: Operating Systems 1 Midterm Winter 2009

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

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

COMP 3361: Operating Systems 1 Final Exam Winter 2009

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

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

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

Midterm Exam #2 Solutions October 25, 2016 CS162 Operating Systems

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

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

King Saud University. College of Computer & Information Sciences. Information Technology Department. IT425: Operating Systems.

QUESTION BANK UNIT I

FCM 710: Architecture of Secure Operating Systems

CS630 Operating System Design, Second Exam, Fall 2014

MC7204 OPERATING SYSTEMS

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

University of Waterloo Midterm Examination Model Solution CS350 Operating Systems

Midterm Exam Amy Murphy 6 March 2002

CPSC/ECE 3220 Summer 2017 Exam 2

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

FCM 710: Architecture of Secure Operating Systems

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

CS153: Midterm (Winter 19)

CPSC/ECE 3220 Summer 2018 Exam 2 No Electronics.

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

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

Operating Systems (1DT020 & 1TT802)

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

CS162, Spring 2004 Discussion #6 Amir Kamil UC Berkeley 2/26/04

EECE.4810/EECE.5730: Operating Systems Spring Midterm Exam March 8, Name: Section: EECE.4810 (undergraduate) EECE.

CS630 Operating System Design, First Exam, Spring 2017,

CS 140 Midterm Examination Winter Quarter, 2012

CS630 Operating System Design Second Exam, Spring 2015,

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

CS 370 Operating Systems

Operating Systems Structure

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

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

Lecture 9: Midterm Review

CSE 153 Design of Operating Systems

For The following Exercises, mark the answers True and False

CS140 Operating Systems and Systems Programming Midterm Exam

Midterm Exam. October 20th, Thursday NSC

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register

CS-537: Midterm Exam (Spring 2001)

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

Homework Assignment #5

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

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

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

Chendu College of Engineering & Technology

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Midterm I October 11 th, 2006 CS162: Operating Systems and Systems Programming

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

University of California College of Engineering Computer Science Division- EECS. Midterm Exam March 13, 2003 CS162 Operating Systems

Midterm Exam Solutions Amy Murphy 28 February 2001

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

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

TENTAMEN / EXAM. TDDB68 / TDDB72 Processprogrammering och operativsystem / Concurrent programming and operating systems 14 jan 2009, 08:00 12:00 TER2

Sample Questions. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

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

INSTITUTE OF AERONAUTICAL ENGINEERING

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

MCS-378 Intraterm Exam 1 Serial #:

CS4411 Intro. to Operating Systems Exam 2 Fall 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.

EECE.4810/EECE.5730: Operating Systems Spring 2017

This exam paper contains 8 questions (12 pages) Total 100 points. Please put your official name and NOT your assumed name. First Name: Last Name:

CS450 OPERATING SYSTEMS FINAL EXAM ANSWER KEY

CPS 310 second midterm exam, 11/14/2014

CSE 410 Final Exam Sample Solution 6/08/10

PESIT SOUTHCAMPUS. Question Bank

Stanford University Computer Science Department CS 140 Midterm Exam Dawson Engler Winter 1999

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

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

Operating Systems and Networks Course: International University Bremen Date: Dr. Jürgen Schönwälder Deadline:

Course Syllabus. Operating Systems


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

SNS COLLEGE OF ENGINEERING

Midterm I October 12 th, 2005 CS162: Operating Systems and Systems Programming

CS-537: Midterm Exam (Fall 2013) Professor McFlub

Suggested Solutions (Midterm Exam October 27, 2005)

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

Jonnada,Vizianagaram LABORATARY MANUAL III-B.Tech-IT OPERATING SYSTEMS LAB

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

CHAPTER NO - 1 : Introduction:

CS604 - Operating System Solved Subjective Midterm Papers For Midterm Exam Preparation

Midterm Exam October 15, 2012 CS162 Operating Systems

Midterm Exam Amy Murphy 19 March 2003

COMP SCI 3SH3: Operating System Concepts (Term 2 Winter 2006) Test 2 February 27, 2006; Time: 50 Minutes ;. Questions Instructor: Dr.

Second Midterm Exam March 21, 2017 CS162 Operating Systems

Processes-Process Concept:

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Midterm Exam Solutions March 7, 2001 CS162 Operating Systems

OS Structure. User mode/ kernel mode. System call. Other concepts to know. Memory protection, privileged instructions

CSE 120 Principles of Computer Operating Systems Fall Quarter, 2002 Halloween Midterm Exam. Instructor: Geoffrey M. Voelker

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

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK

CS 153 Design of Operating Systems Winter 2016

Assignment 3 (Due date: Thursday, 10/15/2009, in class) Part One: Provide brief answers to the following Chapter Exercises questions:

Transcription:

COMP 3361: Operating Systems 1 Midterm Winter 2009 Name: Instructions This is an open book exam. The exam is worth 100 points, and each question indicates how many points it is worth. Read the exam from start to finish and allocate your time wisely. That is, do not spend a lot of time trying to answer a question that is only worth a few points. If you think any question is ambiguous, make and state a reasonable assumption. Answer all questions on this exam paper. Please make sure your writing and diagrams are legible. 1 of 1

1. (7 points) Describe the difference between a normal test-and-set spinlock and a read-before-test-and-set spin-lock. Why would the latter be advantageous over the former on multiprocessor systems? 2. (8 points) Describe the four conditions required for deadlock to occur. Describe a common method for deadlock prevention that prevents one of the conditions occurring. 2 of 2

3. (15 points) Here are two processes. Can they deadlock? If so, give a concurrent execution (show a combined sequence of the lettered steps of process0 [A,B,C,D,E,F,G,H] and the numbered steps of process1 [1,2,3,4,5,6,7,8] in which they deadlock and propose a change to one or both to make them deadlock free. lock *file1, *file2, *mutex; void process0() { lock_acquire(mutex); //Step A /* do something */ lock_acquire(file1); //Step B /* write to file 1 */ lock_acquire(file2); //Step C /* write to file 2 */ lock_release(file1); //Step D lock_release(mutex); //Step E /* do something */ lock_acquire(file1); //Step F /* read from file 1 */ /* write to file 2 */ lock_release(file2); //Step G lock_release(file1); //Step H void process1() { /* do stuff */ lock_acquire(file1); //Step 1 /* read from file 1 */ lock_acquire(file2); //Step 2 /* write to file 2 */ lock_release(file1); //Step 3 lock_release(file2); //Step 4 lock_acquire(mutex); //Step 5 /* do something */ lock_acquire(file1); //Step 6 /* write to file 1 */ lock_release(file1); //Step 7 lock_release(mutex); //Step 8 3 of 3

4. (8 points) A system has four page frames. The time of loading, time of last access, and the reference and modify bits for each page are as shown below (the times are in clock ticks, assume clock time 0 is when the machine was reset): Page Loaded Last referenced Reference bit Modify bit 0 126 280 1 0 1 230 265 0 1 2 140 270 0 0 3 110 285 1 1 a. Which page will the FIFO algorithm replace? Why? b. Which page will the LRU algorithm replace? Why? c. Under what circumstance do page faults occur? Describe the actions taken by the operating system when a page fault occurs. 5. (7 points) Consider a paged logical virtual address space (composed of 32 pages of 2Kbytes each) mapped into a 1 MByte physical memory space. a. What is the format of the processor s logical address? How many bits of the virtual address are used for the virtual page number AND how many are bits for the page offset? b. What is size (in total bytes) of the page table assuming each page table entry requires 4 bytes? 4 of 4

6. (15 points) For each of the following resource allocation graphs, find out whether there is a deadlock? 5 of 5

Given the following resource allocation diagram, a. If another instance of resource r1 is made available, is the deadlock resolved? If yes specify the allocation sequence, if no explain why? b. Repeat part a. for resource r2. c. Repeat part a. for resource r3. 6 of 6

7. (15 points) Consider the following two systems. Given that all resource instances are of the same type and using the definitions presented in the discussion of the Banker s Algorithm, answer these questions for each system: a. Determine the values in the Need matrix for each process in the system. b. Determine whether each of the systems is safe or unsafe. c. If the system is in a safe state, list a sequence of requests and releases that will make it possible for all processes to run to completion. d. If the system is in an unsafe state, show how it is possible for deadlock to occur. System 1 has 12 instances of the resource. Only 1 is available. Process Allocation Max 1 5 6 2 4 7 3 2 6 4 0 2 System 2 has 14 instances of the resource. 2 are available. Process Allocation Max 1 5 8 2 3 9 3 4 8 7 of 7

8. (15 points) Given the following information: Process number Arrival time Burst time 1 0 8 2 1 4 3 2 3 4 3 2 5 4 4 a) Draw a Gantt chart (time-line) for each of the following scheduling algorithms. First-come first-served Shortest job first Round robin (using a time quantum of 4) b) For the round robin algorithm above, compute the waiting time and turnaround time for each process (not the average). 8 of 8

9. (10 points) The following three interacting processes share two semaphores initialized as follows: Semaphore S1 = 3; Semaphore S2 = 0; P 1 : while (true) { wait (S1); print ( C ); signal (S2); P 2 : while (true) { wait (S2); print ( A ); print ( B ); signal (S2); P 3 : while (true) { wait (S2); print ( D ); a. Assuming execution is eventually halted, how many C s are printed when the set of processes runs? Explain your answer. b. What is the smallest number of A s that might be printed when this set of processes runs? Explain your answer. c. Is CCABBABDDCABD a possible output sequence when this set of processes runs? Explain your answer. 9 of 9