CS140 Operating Systems and Systems Programming Midterm Exam

Similar documents
CS140 Operating Systems and Systems Programming Midterm Exam

CS140 Operating Systems and Systems Programming Midterm Exam

CS140 Operating Systems and Systems Programming

CS140 Operating Systems and Systems Programming Final Exam

CS 140: Operating Systems and Systems Programming Midterm Exam

CS140 Operating Systems and Systems Programming Final Exam

CS140 Operating Systems and Systems Programming Final Exam

CS140 Operating Systems and Systems Programming Final Exam

CS140 Operating Systems and Systems Programming Final Exam

Computer Science 161

Suggested Solutions (Midterm Exam October 27, 2005)

EECS 482 Midterm (Fall 1998)

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

University of Waterloo Midterm Examination Model Solution CS350 Operating Systems

CSE 120 Principles of Operating Systems Spring 2017

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

COS 318: Midterm Exam (October 23, 2012) (80 Minutes)

CSC369 Lecture 5. Larry Zhang, October 19,2015

CS 140 Midterm Examination Winter Quarter, 2012

CS140 Operating Systems and Systems Programming

Operating Systems. CPU Scheduling ENCE 360

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

CSE 120 Principles of Operating Systems

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

Midterm Exam Amy Murphy 19 March 2003

Midterm Exam Amy Murphy 6 March 2002

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

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

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

Do not start the test until instructed to do so!

CSCI-GA Operating Systems Lecture 3: Processes and Threads -Part 2 Scheduling Hubertus Franke

Midterm Exam. October 20th, Thursday NSC

Midterm Exam Solutions and Grading Guidelines March 3, 1999 CS162 Operating Systems

Timers 1 / 46. Jiffies. Potent and Evil Magic

CS-537: Midterm Exam (Spring 2001)

Midterm Exam March 3, 1999 CS162 Operating Systems

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

There are 19 total numbered pages, 8 Questions. You have 2.5 hours. Budget your time carefully!

CMPSCI 377: Operating Systems Exam 1: Processes, Threads, CPU Scheduling and Synchronization. October 9, 2002

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

CSE 120 Principles of Operating Systems

Lecture 9: Midterm Review

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

CS350: Final Exam Review

Midterm I October 18 th, 2010 CS162: Operating Systems and Systems Programming

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

Advanced Operating Systems (CS 202) Scheduling (1)

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

University of Waterloo Midterm Examination Term: Winter Year: Solution. begin solution

Midterm I October 15 th, 2008 CS162: Operating Systems and Systems Programming

Operating Systems (1DT020 & 1TT802)

CS 153 Design of Operating Systems Winter 2016

Problems Kernel Scheduler User Level Scheduler Universität Karlsruhe (TU), System Architecture Group

Processes and Threads. Processes: Review

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

To Everyone... iii To Educators... v To Students... vi Acknowledgments... vii Final Words... ix References... x. 1 ADialogueontheBook 1

CS Final Exam. Stanford University Computer Science Department. June 5, 2012 !!!!! SKIP 15 POINTS WORTH OF QUESTIONS.!!!!!

Operating Systems EDA092, DIT 400 Exam

Midterm Exam March 13, 2013 CS162 Operating Systems

MC7204 OPERATING SYSTEMS

CSL373: Lecture 6 CPU Scheduling

Stanford University Computer Science Department CS 240 Sample Quiz 2 Questions Winter February 25, 2005

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

PROCESSES & THREADS. Charles Abzug, Ph.D. Department of Computer Science James Madison University Harrisonburg, VA Charles Abzug

Last Class: CPU Scheduling! Adjusting Priorities in MLFQ!

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

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

Last Class: Processes

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

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

CSE 451 Midterm Exam May 13 th, 2009

MCS-378 Intraterm Exam 1 Serial #:

Midterm Exam Solutions Amy Murphy 28 February 2001

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

COMP 3361: Operating Systems 1 Final Exam Winter 2009

CS140 Operating Systems Midterm Review. Feb. 5 th, 2009 Derrick Isaacson

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

CS 450 Exam 2 Mon. 11/7/2016

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

CSE 451 Midterm 1. Name:

Stanford University Computer Science Department CS 240 Quiz 2 with Answers Spring May 24, total

Operating Systems Overview

Uniprocessor Scheduling

CS4411 Intro. to Operating Systems Exam 2 Fall 2009

OS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions).

CS418 Operating Systems

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

CS315A Midterm Solutions

Operating Systems 2013/14 Assignment 3. Submission Deadline: Tuesday, December 17th, :30 a.m.

Name: uteid: 1. CS439H: Fall 2011 Final Exam

CSE 153 Design of Operating Systems

Real Time and Embedded Systems. by Dr. Lesley Shannon Course Website:


CS153: Midterm (Fall 16)

Eastern Mediterranean University School of Computing and Technology Department of Information Technology. ITEC202 Operating Systems

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

Processes and Threads

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

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

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)

Transcription:

CS140 Operating Systems and Systems Programming Midterm Exam October 28 th, 2002 (Total time = 50 minutes, Total Points = 50) Name: (please print) In recognition of and in the spirit of the Stanford University Honor Code, I certify that I will neither give nor receive unpermitted aid on this exam. Signature: This examination is close notes and close book. You may not collaborate in any manner on this exam. You have 50 minutes to complete the exam. Before starting, please check to make sure that you have all 9 pages. 1 2 3 4 5 6 Total Name:

1. CPU Scheduling (6 points 2 points each) (a) Explain how the effects of priority donation in a priority-based CPU scheduler are approximated in a system that uses lottery scheduling. (b) In a multi-level feedback queue (MLFQ) CPU scheduler, the length of a process s timeslice depends on the process s priority level. Explain the reasoning behind this property of a MLFQ scheduler. (c) You and your Nachos partner are arguing over how to implement a fair CPU scheduler. Your partner claims that round-robin with a reasonable timeslice is the fairest possible algorithm. Is your partner correct? Justify your answer. Page 2 of 9f

2. Synchronization and deadlock (10 points 2 points each) (a) Explain why an OS designer needs to worry about deadlock involving physical memory but not the CPU. (b) Is it possible to have a deadlock involving virtual memory? Justify your answer. (c) Many operating systems designed to run only on uniproccessors use disabling of interrupts to create critical sections in the code. Explain how this interrupt disabling prevents multiple threads from entering the critical section. Page 3 of 9f

(d) Explain why disabling of interrupts to implement critical sections will not work on a multiprocessor. (e) When running on a multiprocessor, would it ever make sense to have a spin lock also disable interrupts for the duration of a critical? Explain your answer. Page 4 of 9f

3. Linking & code generation (6 points 3 points each) (a) Explain why a system that uses dynamically linked libraries (DLLs) might have the first call to a library function take much long than subsequent calls. (b) Explain how dynamically generated code can be faster than more traditional statically compiled code even thought it has the additional overhead of runtime code generation. Page 5 of 9f

4. Operating System Structure (8 points) It is common for operating systems on modern machines to map the operating system kernel into the top of all the address spaces. This approach allows the OS kernel to directly access data structures such as system call arguments that are in the application s portion of the address space. Although these addresses can be used in the kernel, care must be taken when an OS uses this approach. Describe two of the problems that can occur if the OS is not careful with these application-provided addresses. Page 6 of 9f

5. Memory management (12 points) Assume that you are working on the operating system for a computer system that uses a segmentation scheme that works as follows: The machine has a 32bit address where the top 2 bits are the segment number and the lower 30 bits are the offset into the segment. The hardware segment table has 4 entries each with a valid bit, protection bits (read/write, user/supervisor), 32 bit base and 32 bit length. To save having to store all the bits, the lower 12 bits of the base and the length must be zero. The architects of the machine are thinking of replacing the segmentation with a pure paging scheme that uses a 4 kilobyte page size and a flat page table per process. The page table has 2 20 entries each with a 20bit physical page number, a valid bit, protection bits (read/write, user/supervisor), and the normal reference and dirty bits. You are asked if you could add a layer to the operating system that would emulate the old segmentation approach on top of this new paging hardware. (a) (8 points) Describe how you do this mapping of segmentation on to paging. Show the page table you would build for the following segmentation table: Seg # Valid Protection Base Length 0 Yes Read only 0x0000000 0x800000 1 Yes Read/Write 0x0800000 0x800000 2 No No Access 0 0 3 Yes Read/Write 0x1000000 0x1000000 Sup Only (Hint: 0x800000 is 8MB and 0x1000000 is 16MB) Page 7 of 9f

(b) (4 points) Let s say you were required to do a native port of the operating system to take advantage of this paging system. What would be your biggest complaint about the paging support in the memory management unit. Page 8 of 9f

6. Paging (8 points) (a) (5 points) Given a modern computer system such as the Sweet Hall machines, would you expect a disk used only as the backing store for the virtual memory system to have: 1. More page read than page write requests. 2. About the same number of read and write requests. 3. More write than read requests. Justify your answer. (b) (3 points) Your Nachos partner claims that any thrashing problem of a system can be fixed by adding more memory to the computer. Assuming that you can add infinite memory to a computer, is this a valid claim? If so, justify your answer. If not, explain why not. Page 9 of 9f