Two hours. Question ONE is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE. Date: Friday 25th January 2013 Time: 14:00-16:00

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

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

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

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

University of Waterloo Midterm Examination Model Solution CS350 Operating Systems

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.

Operating Systems (1DT020 & 1TT802)

Chendu College of Engineering & Technology


1995 Paper 10 Question 7

SNS COLLEGE OF ENGINEERING

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

Explain briefly how starvation may occur in process scheduling. (2 marks)

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

Exam Guide COMPSCI 386

CS140 Operating Systems and Systems Programming Midterm Exam

Operating Systems (Classroom Practice Booklet Solutions)

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

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

B. V. Patel Institute of Business Management, Computer &Information Technology, UTU

Course Syllabus. Operating Systems

QUESTION BANK UNIT I

CSE 153 Design of Operating Systems

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE) UNIT I OPERATING SYSTEMS

(MCQZ-CS604 Operating Systems)

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

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

ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.

Fundamentals of Operating Systems (COMP355/L) A Student's Manual for Practice Exercises

CITS2230 Operating Systems Mid-semester test 2006

Operating Systems Overview

Uniprocessor Scheduling. Aim of Scheduling

Uniprocessor Scheduling. Aim of Scheduling. Types of Scheduling. Long-Term Scheduling. Chapter 9. Response time Throughput Processor efficiency

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

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

CS4411 Intro. to Operating Systems Exam 2 Fall 2009

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

COMP 3361: Operating Systems 1 Final Exam Winter 2009

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

SYED AMMAL ENGINEERING COLLEGE CS6401- OPERATING SYSTEM

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

CS350: Final Exam Review

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

1.1 CPU I/O Burst Cycle

Module 1. Introduction:

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

CSC369H1 S2016 Midterm Test Instructor: Bogdan Simion. Duration 50 minutes Aids allowed: none. Student number:

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

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

Solution for Operating System

Process Description and Control. Chapter 3

Uniprocessor Scheduling

Announcements. Reading. Project #1 due in 1 week at 5:00 pm Scheduling Chapter 6 (6 th ed) or Chapter 5 (8 th ed) CMSC 412 S14 (lect 5)

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

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

Midterm Exam. October 20th, Thursday NSC

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

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

CSC369 Lecture 5. Larry Zhang, October 19,2015

Notes on the Exam. Question 1. Today. Comp 104:Operating Systems Concepts 11/05/2015. Revision Lectures (separate questions and answers)

2 nd Half. Memory management Disk management Network and Security Virtual machine

Concurrent & Distributed Systems Supervision Exercises

MC7204 OPERATING SYSTEMS

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

Practice Exercises 449

Comp 204: Computer Systems and Their Implementation. Lecture 25a: Revision Lectures (separate questions and answers)

Operating Systems ECE344. Ding Yuan

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

TDDB68 Processprogrammering och operativsystem / Concurrent programming and operating systems

Main Points of the Computer Organization and System Software Module

REAL-TIME MULTITASKING KERNEL FOR IBM-BASED MICROCOMPUTERS

412-S12 (shankar) Exam 2 SOLUTION Page 1 of 5. 5 problems. 50 points total. Closed book, closed notes, no electronic devices. Write your name above.

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Operating Systems. Computer Science & Information Technology (CS) Rank under AIR 100

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu December 10, Review

CSI3131 Final Exam Review

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

INSTITUTE OF AERONAUTICAL ENGINEERING

UNIT:2. Process Management

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

CS140 Operating Systems and Systems Programming

Design of Operating System

Scheduling of processes

Operating System Review Part

Announcements/Reminders

CS140 Operating Systems and Systems Programming Midterm Exam

CPS 310 second midterm exam, 11/14/2014

CS4411 Intro. to Operating Systems Final Fall points 12 pages

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

CROWDMARK. Examination Midterm. Spring 2017 CS 350. Closed Book. Page 1 of 30. University of Waterloo CS350 Midterm Examination.

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

Q1. State True/false with jusification if the answer is false:

Chapter 5: CPU Scheduling

Resource management. Real-Time Systems. Resource management. Resource management

Final Exam Preparation Questions

Properties of Processes

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition

8: Scheduling. Scheduling. Mark Handley

Transcription:

Two hours Question ONE is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE Operating Systems Date: Friday 25th January 2013 Time: 14:00-16:00 Please answer Question ONE and any TWO other Questions from the other THREE Questions provided This is a CLOSED book examination The use of electronic calculators is NOT permitted [PTO]

1. Compulsory a) Explain what the term deadlock means, and how it might occur. b) Computers typically operate in one of two modes, namely user mode or system mode (the latter is sometimes called privileged mode, supervisor mode or kernel mode). Explain why these two modes are needed and how they differ from each other. c) Briefly explain how starvation may occur in process scheduling. d) Why is the size of the time slice in pre-emptive scheduling algorithms chosen to be significantly higher than the time taken for a context switch? e) Explain what is meant by the term multiprogramming. f) Explain the difference between a virtual memory address and a physical memory address. g) What is a page replacement algorithm? h) What is meant by memory mapped I/O? i) What is a page fault? Describe how a page fault is handled by the Memory Management Unit and the operating system. j) Briefly explain why Java code that waits in a synchronized method for a condition to hold will commonly retest the condition when it has been released from its wait. Page 2 of 7

2. a) Explain briefly the difference between a process and a thread. b) Explain briefly what a CPU burst is and what an I/O burst is. What is a CPUbound process, and what is an I/O-bound process? Why is it a good strategy in process scheduling to give higher priority to I/O-bound processes? c) Three processes A, B and C all alternate between a CPU burst of 3 time-units and an I/O burst of 3 time-units. Draw a diagram showing the states of these processes as they are run by a Round Robin scheduler for a total of 30 timeunits, assuming that they all start ready at time-unit 0, the time-slice adopted by the scheduler is 2 time-units, and the time for a context switch is negligible. For what percentage of the time is the CPU executing user processes? d) A new scheduler is introduced using priority queues. There are two queues, Q1 (responsible for scheduling processes A and B) and Q2 (responsible for scheduling process C). Assuming they have ready processes, the two queues access the CPU alternately, as follows: Q1 gets 5 time-units, then Q2 gets 2 time-units, then Q1 gets 5 time-units, and so on. Processes in each queue are executed in Round Robin fashion with a time-slice of 1 time-unit. If a queue runs out of ready processes before its allocated time-units have been used, it yields access to the CPU to the other queue. Apart from this, the situation is as described for part c) above. Draw a diagram showing the states of the three processes A, B and C as they are run by the scheduler for a total of 30 timeunits. For what percentage of the time is the CPU executing user processes? e) In a certain system, the execution of three threads is synchronised using three semaphores, S1, S2 and S3, as shown below. Semaphores S1 and S2 are initialised to zero, while semaphore S3 is initialised to 1. All three semaphores are used only in the sections of code shown below. Thread A Thread B Thread C P(S1) P(S2) P(S3) P(S1) P(S1) V(S1) x=3*x+4 x=x+7 x=x*5 V(S2) V(S2) V(S1) V(S1) V(S1) V(S3) Question 2e continues overleaf Page 3 of 7

Question 2e continued i) If the variable x is defined as an integer shared variable, initialised to 1, and is not assigned a value in any other sections of the code apart from those shown above, what will be its value when all threads have finished executing? What will be the values in the three semaphores? Justify your answers. ii) Would it be possible to guarantee the same final value for x using only two semaphores? Would it be possible to guarantee the same final value for x using only one semaphore? Justify your answers. Page 4 of 7

3. a) On a paged machine with 3 pages frames (PFs) available for it, a particular process makes accesses to the following pages in the order given: 0, 3, 7, 1, 3, 2, 1, 3, 7 Show the contents of the 3 page frames and the cumulative total number of page faults (PF) after each memory access assuming that an LRU page replacement algorithm is in use and that the page frames are initially empty. The type of diagram you should draw up is depicted in Figure 3a. Access: 0 3 7 1 3 2 1 3 7 Most recent: X X X X X X X X X ) Contents of Second most : X X X X X X X X X ) page frames Third most: X X X X X X X X X ) in memory Total PFs: X X X X X X X X X Figure 3a. Typical diagram showing 3 page frames and the cumulative total number of page faults. b) A 16-bit virtual address is divided into an 8-bit page number and an 8-bit page offset; whereas the associated physical address has a 5-bit page frame with the appropriate page offset address sizing. Show, with the aid of a fully labelled diagram, the table structure necessary to convert this virtual address into a real physical address. (6 marks) c) With the aid of a diagram, describe the structure of a simple base and limit system and explain how it achieves relocation. NOTE: For full marks your answer must contain a detailed concise diagram and explanation; e.g. a fully labelled diagram and a concise explicit description of a base and limits system and how it achieves relocation. (6 marks) d) Given a 1G address space and associated 128K page size, calculate the number of pages in the virtual address space. NOTE: To gain full marks you must show full working. e) Given a physical address space of 2G and associated 64K block size, calculate the number of page frames in the physical address space. NOTE: To gain full marks you must show full working. Page 5 of 7

4. a) Explain how a peripheral communicates with the CPU using interrupts. b) Segmented memory is an alternative view to that adopted by paged memory; the following questions relate to segmented memory. i) Explain the difference between a page and a segment in a virtual memory system. ii) A computer system uses segmented virtual memory only (no pages). The state of the memory at a given time is shown in Figure 4b. Indicate what happens when a new segment requiring 9KB of memory space is loaded using the following algorithms: 1) Best Fit; and 2) First Fit. State where the 9KB will be placed given 1) and 2), and, due to the different algorithms, if any issues arise. Note that it is assumed that the lowest address is at the bottom of the diagram, and the third column indexes all the segments A,, J. 9 KB Gap J 15 KB Segment I 8 KB Gap H 20 KB Segment G 10 KB Gap F 10 KB Segment E 8 KB Gap D 18 KB Segment C 14 KB Gap B Lowest address is at the bottom of the diagram 9 KB Segment A Figure 4b. Typical diagram showing segmented memory. c) A pathname in a hierarchical file system defines how a file is to be located on the disk. i) Explain the distinction between an absolute pathname and a relative pathname. Page 6 of 7 Question 4c continues overleaf

Question 4c continued ii) Describe in detail the algorithm used to locate a file given an absolute pathname or given a relative pathname. iii) In a system using index nodes (i-nodes), the above algorithm will first find the identifier of the i-node that describes the target file. Explain how the identified i-node is found on disk. iv) Assume that each i-node contains up to 8 pointers to the first 8 successive blocks of the file on disk, then up to one pointer to a single indirect block on disk that contains 512 further pointers to the next 512 successive blocks of the file on disk, and then up to one pointer to a double indirect block that contains 512 further pointers to single indirect blocks on disk that each contain 512 pointers to the next 512 successive blocks of the file on disk. Any unused pointers contain a special null value. What is the size (in blocks) of the largest possible file? END OF EXAMINATION Page 7 of 7