Example Sheet for Operating Systems I (Part IA)

Similar documents
Example Sheet for Operating Systems I (Part IA)

1993 Paper 2 Question 10

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS

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

COMP 3361: Operating Systems 1 Final Exam Winter 2009

COMPUTER SCIENCE TRIPOS

1995 Paper 10 Question 7

Last class: Today: CPU Scheduling. CPU Scheduling Algorithms and Systems

File. File System Implementation. Operations. Permissions and Data Layout. Storing and Accessing File Data. Opening a File

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

1993 Paper 3 Question 6

Operating Systems I Supervision Exercises

Operating Systems I Supervision Exercises

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

Operating Systems (1DT020 & 1TT802)

Midterm Exam Amy Murphy 6 March 2002

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

Operating Systems. Process scheduling. Thomas Ropars.

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs).

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

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

Main Points of the Computer Organization and System Software Module

CPU Scheduling. The scheduling problem: When do we make decision? - Have K jobs ready to run - Have N 1 CPUs - Which jobs to assign to which CPU(s)

CSI3131 Final Exam Review

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

Final Exam Preparation Questions

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

Mid Term from Feb-2005 to Nov 2012 CS604- Operating System

Today: Protection! Protection!

CPU Scheduling Algorithms

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

MC7204 OPERATING SYSTEMS

Exam Guide COMPSCI 386

FCM 710: Architecture of Secure Operating Systems

8: Scheduling. Scheduling. Mark Handley

Today: Protection. Sermons in Computer Science. Domain Structure. Protection

Properties of Processes

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

Chapter 6: CPU Scheduling

File. File System Implementation. File Metadata. File System Implementation. Direct Memory Access Cont. Hardware background: Direct Memory Access

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

CHAPTER 2: PROCESS MANAGEMENT

Chapter 5: CPU Scheduling

Operating Systems, Fall

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

CS370 Operating Systems

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

Chap 7, 8: Scheduling. Dongkun Shin, SKKU

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

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

SAMPLE MIDTERM QUESTIONS

CS350: Final Exam Review

So far. Next: scheduling next process from Wait to Run. 1/31/08 CSE 30341: Operating Systems Principles

QUESTION BANK UNIT I

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

CHAPTER NO - 1 : Introduction:

1.1 CPU I/O Burst Cycle

8th Slide Set Operating Systems

(MCQZ-CS604 Operating Systems)

CPU Scheduling: Part I ( 5, SGG) Operating Systems. Autumn CS4023

CPU Scheduling. Schedulers. CPSC 313: Intro to Computer Systems. Intro to Scheduling. Schedulers in the OS

CPU Scheduling. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University

Lecture 2 Process Management

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

CS6401- Operating System QUESTION BANK UNIT-IV

CS3733: Operating Systems

OPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:

Lecture 17: Threads and Scheduling. Thursday, 05 Nov 2009

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

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

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

FCM 710: Architecture of Secure Operating Systems

Operating System Concepts Ch. 5: Scheduling

Lecture 5 / Chapter 6 (CPU Scheduling) Basic Concepts. Scheduling Criteria Scheduling Algorithms

CSE120 Principles of Operating Systems. Prof Yuanyuan (YY) Zhou Scheduling

COSC243 Part 2: Operating Systems

CSE 120 Principles of Operating Systems Spring 2017

Computer Systems Assignment 4: Scheduling and I/O

* What are the different states for a task in an OS?

Sample solution of the written examination in Operating Systems

LECTURE 3:CPU SCHEDULING

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

CS630 Operating System Design, First Exam, Spring 2017,

CS2506 Quick Revision

CS 3733 Operating Systems

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

Operating Systems (G53OPS) - Examination. Operating Systems (G53OPS) - Examination. Question 1. Question 2. Operating Systems (G53OPS) - Examination

Programming Assignment HW5: CPU Scheduling draft v04/02/18 4 PM Deadline April 7th, 2018, 5 PM. Late deadline with penalty April 9th, 2018, 5 PM

AC59/AT59/AC110/AT110 OPERATING SYSTEMS & SYSTEMS SOFTWARE DEC 2015

Last Class: Processes

Process Scheduling. Copyright : University of Illinois CS 241 Staff

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

Question Points Score Total 100

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Operating System MC Exercises

Problem Set: Processes

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

Operating System Review Part

May 19, Answer pieces in italics were not required to receive full points.

Transcription:

Example Sheet for Operating Systems I (Part IA) Solutions for Supervisors Michaelmas 2018 / Last Updated: April 5, 2018 Note these may be updated in the light of feedback. (Check update time.) 1 Processes & Scheduling 1. (a) Modern computers store data values in a variety of memories, each with differing size and access speeds. Briefly describe each of the following: i. cache memory ii. main memory iii. registers (b) Give an example situation in which operating systems effectively consider disk storage to be a fourth type of memory. 2. (a) Describe (with the aid of a diagram where appropriate) the representation in main memory of: i. An unsigned integer ii. A signed integer iii. A text string iv. An instruction (b) Does an operating system need to know whether the contents of a particular register represent a signed or unsigned integer? (c) Describe what occurs during a context switch. 3. Describe with the aid of a diagram how a simple computer executes a program in terms of the fetch-execute cycle, including the ways in which arithmetic instructions, memory accesses and control flow instructions are handled. 4. Process scheduling can be preemptive or non-preemptive. Compare and contrast these approaches, commenting on issues of simplicity, fairness, performance and required hardware support. 5. (a) Describe how the CPU is allocated to processes if static priority scheduling is used. Be sure to consider the various possibilities available in the case of a tie. (b) All scheduling algorithms are essentially priority scheduling algorithms. Discuss this statement with reference to the first-come first-served (FCFS), shortest job first (SJF), shortest remaining time first (SRTF) and round-robin (RR) scheduling algorithms. (c) What is the major problem with static priority scheduling and how may it be addressed? (d) Why do many CPU scheduling algorithms try to favour I/O intensive jobs? 1

6. An operating system uses a single queue round-robin scheduling algorithm for all processes. You are told that a quantum of three time units is used. (a) What can you infer about the scheduling algorithm? (b) Why is this sort of algorithm suitable for a multi-user operating system? (c) The following processes are to be scheduled by the operating system. Process Creation Time Required Computing Time P 1 0 9 P 2 1 4 P 3 7 2 None of the processes ever blocks. New processes are added to the tail of the queue and do not disrupt the currently running process. Assuming context switches are instantaneous, determine the response time for each process. (d) Give one advantage and one disadvantage of using a small quantum. 7. (a) Describe with the aid of a diagram the life-cycle of a process. You should describe each of the states that it can be in, and the reasons it moves between these states. (b) What information does the operating system keep in the process control block? (c) What information do the shortest job first (SJF) and shortest remaining time first (SRTF) algorithms require about each job or process? How can this information be obtained? (d) Give one advantage and one disadvantage of non-preemptive scheduling. (e) What steps does the operating system take when an interrupt occurs? Consider both the programmed I/O and DMA cases, and the interaction with the CPU scheduler. (f) What problems could occur if a system experienced a very high interrupt load? What if the device[s] in question were DMA-capable? 2 Memory Management 1. (a) What is the address binding problem? (b) The address binding problem can be solved at compile time, load time or run time. For each case, explain what form the solution takes, and give one advantage and one disadvantage. 2. For each of the following, indicate if the statement is true or false, and explain why: (a) Preemptive schedulers require hardware support. (b) A context switch can be implemented by a flip-flop stored in the translation lookaside buffer (TLB). (c) Non-blocking I/O is possible even when using a block device. (d) Shortest job first (SJF) is an optimal scheduling algorithm. 2

(e) Round-robin scheduling can suffer from the so-called convoy effect. (f) A paged virtual memory is smaller than a segmented one. (g) Direct memory access (DMA) makes devices go faster. (h) System calls are an optional extra in modern operating systems. (i) In Unix, hard-links cannot span mount points. (j) The Unix shell supports redirection to the buffer cache. 3. Most operating systems provide each process with its own address space by providing a level of indirection between virtual and physical addresses. (a) Give three benefits of this approach. (b) Are there any drawbacks? Justify your answer. (c) A processor may support a paged or a segmented virtual address space. i. Sketch the format of a virtual address in each of these cases, and explain using a diagram how this address is translated to a physical one. ii. In which case is physical memory allocation easier? Justify your answer. iii. Give two benefits of the segmented approach. 4. System calls are part of most modern operating systems. (a) What is the purpose of a system call? (b) What mechanism is typically used to implement system calls? 5. (a) Operating systems need to be able to prevent applications from crashing or locking up the system, or from interfering with other applications. Which three kinds of hardware support do we require to accomplish this? (b) How do applications request that the operating system perform tasks on their behalf? (c) What could we do if we did not have the requisite hardware support? 6. (a) In the context of memory management, under which circumstances do external and internal fragmentation occur? How can each be handled? (b) What is the purpose of a page table? What sort of information might it contain? How does it interact with a TLB? (c) Describe with the aid of a diagram a two-level page table. Explain the motivation behind the structure and how it operates. 3 File Systems & IO 1. Explain how a program accesses I/O devices when: (a) it is running in supervisor-mode (b) it is running in user-mode 3

2. From the point of view of the device driver, data may be read from an I/O device using polling, inerrupt-driven programmed I/O, or direct memory access (DMA). Briefly explain each of these terms, and in each case outline using pseudo-code (or a flow chart) the flow of control in the device driver when reading data from the device. 3. From the point of view of the application programmer, data may be read from a device in a blocking, non-blocking or asynchronous fashion. Using a keyboard as an example device, describe the expected behaviour in each case. 4. File systems comprise a directory service and a storage service. (a) What are the two main functions of the directory service? (b) What is a directory hierarchy? Explain your answer with the aid of a diagram. (c) What information is held in file meta-data? (d) What is a hard link? Does file system support for hard links place any restrictions on the location of file meta-data? (e) What is a soft (or symbolic) link? Does file system support for soft links place any restrictions on the location of file meta-data? 5. Suppose we have a system with three users a, b and c and ten files f 0,f 1,...f 9. Further suppose we have four operations for which we wish to control access: read, append, replace and modify. (a) Do we require all of these or can some be described by combinations of others? (b) Create a nontrivial example set of access tuples of the the form (user, file, permission) and show how it might be represented as: i. an access matrix, ii. access control lists, iii. capability sets 6. (a) Compare and contrast blocking, non-blocking and asynchronous I/O. (b) Give four techniques which can improve I/O performance. 4 Protection, Access Control & Case Studies 1. Describe the basic access control scheme used in the Unix filing system. How does Unix support more advanced access control policies? 2. (a) Describe with the aid of a diagram the on-disk layout of a Unix V7 filesystem. Include in your description the role of the superblock, and the way in which free inodes and data blocks are managed. (b) Describe with the aid of a diagram a Unix V7 inode. (c) Estimate the largest file size supported by a Unix V7 filesystem. (d) Suggest one reliability enhancement and two performance enhancements which could be made to the Unix V7 filesystem. 4

3. (a) Describe, with the aid of diagrams where appropriate, how Unix implements and manages: i. a hierarchical name space for files ii. allocation of storage on disk iii. file-system and file meta-data iv. pipes (b) A Unix system administrator decides to make a versioned file-system in which there are a number of directories called /root-dd-mm-yyyy, each of which holds a copy of the file-system on day dd, month mm and year yyyy. The idea is that at any particular time only the most recent snapshot will be used as the real filesystem root, but that all previous snapshots will be available by explicitly accessing the directory in question. In this way the system administrator hopes to allow resilience to mistaken edits or unintentional deletions by users, or to hardware problems such as a disk head crash. To implement this, the system administrator arranges for a program to run every morning at 01:00 which recursively copies the current snapshot to the new one. However to save disk space, hardlinks are used in place of actual copies. Once the copy is complete, the new snapshot is used as the new root. To what extent will this scheme provide the functionality the system administrator hopes for? What advantages and disadvantages does it have? 4. Describe how CPU scheduling algorithms favour I/O intensive jobs in the Unix operating systems. 5. Describe with the aid of a diagram a Unix inode. You should explain the motivation behind indirect blocks, and how they are used when accessing a file. 6. Describe the operation of the Unix shell with reference to the process management system calls it makes use of. You might like to use pseudo-code or a diagram to aid with your description. 5