Final Exam Preparation Questions

Similar documents
MC7204 OPERATING SYSTEMS

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

Exam Guide COMPSCI 386

Practice Exercises 449

COMP 3361: Operating Systems 1 Final Exam Winter 2009

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

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

SYED AMMAL ENGINEERING COLLEGE CS6401- OPERATING SYSTEM

CS6401- Operating System QUESTION BANK UNIT-IV

SNS COLLEGE OF ENGINEERING

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

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

CS350: Final Exam Review

Final Review. Geoffrey M. Voelker. Final mechanics Memory management Paging Page replacement Disk I/O File systems Advanced topics

Fall COMP3511 Review

CSE 120 Principles of Operating Systems

Operating Systems. Week 9 Recitation: Exam 2 Preview Review of Exam 2, Spring Paul Krzyzanowski. Rutgers University.

4.1 Paging suffers from and Segmentation suffers from. Ans

Main Points of the Computer Organization and System Software Module

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

1993 Paper 3 Question 6

Architectural Support. Processes. OS Structure. Threads. Scheduling. CSE 451: Operating Systems Spring Module 28 Course Review

CS4411 Intro. to Operating Systems Final Fall points 12 pages

CS 537 Fall 2017 Review Session

CS4411 Intro. to Operating Systems Final Fall points 10 pages

QUESTION BANK UNIT I

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

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

INSTITUTE OF AERONAUTICAL ENGINEERING

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

Final Review. Quiz-5 Solutions. Tevfik Koşar

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

CHAPTER NO - 1 : Introduction:

Department of Information Technology Operating Systems Question Bank YEAR/SEM:III/V

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

CSE 421/521 - Operating Systems Fall Lecture - XXV. Final Review. University at Buffalo

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

Operating Systems Design Exam 2 Review: Fall 2010

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

Memory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization

Chapters 9 & 10: Memory Management and Virtual Memory

Design of Operating System

Distributed Deadlock Detection

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Swapping. Operating Systems I. Swapping. Motivation. Paging Implementation. Demand Paging. Active processes use more physical memory than system has

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

CSI3131 Final Exam Review

Operating Systems Design Exam 2 Review: Spring 2012

CS A320 Operating Systems for Engineers

Announcements. Final Exam. December 10th, Thursday Patrick Taylor Hall. Chapters included in Final. 8.

Operating Systems Design Exam 2 Review: Spring 2011

CS 416: Opera-ng Systems Design March 23, 2012

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

First-In-First-Out (FIFO) Algorithm

CS370 Operating Systems

Disk Scheduling COMPSCI 386

Virtual Memory COMPSCI 386

a. What is a lower bound on the number of page faults? b. What is an upper bound on the number of page faults?

CS6401- Operating System UNIT-III STORAGE MANAGEMENT

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

CS 5523 Operating Systems: Memory Management (SGG-8)

Virtual Memory Outline

Virtual Memory. CSCI 315 Operating Systems Design Department of Computer Science

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

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

CSC369 Operating Systems. Spring 2007

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

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2

CS 143A - Principles of Operating Systems

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

Chapter 8: Virtual Memory. Operating System Concepts

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

Chapter 9 Memory Management

Basic Memory Management

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

Midterm Exam #2 Solutions April 20, 2016 CS162 Operating Systems

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

Computing Science 300 Sample Final Examination

CSE 451: Operating Systems. Section 10 Project 3 wrap-up, final exam review

File Systems. ECE 650 Systems Programming & Engineering Duke University, Spring 2018

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

CS6401- OPERATING SYSTEM

CIS 21 Final Study Guide. Final covers ch. 1-20, except for 17. Need to know:

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

PESIT SOUTHCAMPUS. Question Bank

CSE 120: Principles of Operating Systems. Lecture 10. File Systems. November 6, Prof. Joe Pasquale

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

Chapter 8 Memory Management

CSE 120: Principles of Operating Systems. Lecture 10. File Systems. February 22, Prof. Joe Pasquale

Operating Systems (1DT020 & 1TT802)

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

20-EECE-4029 Operating Systems Spring, 2013 John Franco

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 4 Memory Management

OPERATING SYSTEM. Chapter 9: Virtual Memory

Virtual Memory. Chapter 8

Memory management: outline

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Operating Systems. Operating Systems Professor Sina Meraji U of T

CS153: Final Review1. Chengyu Song. Slides modified from Harsha Madhyvasta, Nael Abu-Ghazaleh, and Zhiyun Qian

Transcription:

EECS 678 Spring 2013 Final Exam Preparation Questions 1 Chapter 6 1. What is a critical section? What are the three conditions to be ensured by any solution to the critical section problem? 2. The following code only ensures two of the three conditions for solving the critical section problem. What condition does it not support? Modify the code to provide support for all three conditions to address the critical section problem. int mutex = 0; do { while(testandset(&mutex)); // Critical section mutex = 0; // Remainder section }while (TRUE); 3. What are the three essential conditions to address the Critical Section Problem? 4. Provide the pseudo code definitions of the following hardware atomic instructions: (a) TestAndSet and (b) Swap. 5. A general synchronization solution using locks looks as follows: int mutex; init_lock(&mutex); do { lock(&mutex); // critical section unlock(&mutex); // remainder section }while(true); Provide the definitions of init lock, lock, and unlock when using (a) TestAndSet, (b) Swap and (c) Semaphores. 1

6. Define semphores (simple semaphores and semaphores with no busy waiting). 7. What is priority inversion? How does the priority inheritance protocol address this issue? 8. Explain why spinlocks are not appropriate for uniprocessor systems, yet may be suitable for multiprocessor systems. 9. Show that if the wait and signal semaphore operations are not executed atomically, then mutual exclusion may be violated. 10. List the drawbacks of Semaphores. How can Monitors overcome the drawbacks? 11. How do monitors ensure mutual exclusion? 12. The code on Slide 53 shows a solution to the bounded buffer problem using monitors and condition variables. Using illustrative figures (as demonstrated in class) show how the following sequence of process events will be handled with (a) Hoare and (b) Mesa condition variable semantics. Events: C1 P1 C2 Here, Pn indicates producer and Cn indicates a consumer process. 13. How do the semantics of the wait() and signal operations differ in semaphores and monitors? 2 Chapter 8 1. Illustrate how to protect processes from one-another using the base and limit registers. 2. Explain compiler time, load time, and execution time address binding. What type of binding is generally used in current OS? 3. Discuss the differences between logical and physical addresses and address spaces as they relate to an executing program. 4. Explain static and dynamic loading. 5. What is dynamic linking? 6. What is the need for swapping? 7. What are the drawbacks of contiguous memory allocation? 8. Explain, compare, and contrast the following resource allocation policies: (a) First Fit, (b) Best Fit, and (c) Worst Fit. 9. Compare and contrast internal and external fragmentation. 10. What is paging? How does it overcome the drawbacks of contiguous memory allocation? 11. Assuming a page size of 2K and a 32-bit machine, how many bits are used for the page number, and how many are used for the offset within the page? Give the main reason why page sizes are usually powers of two. 2

12. Consider a system with memory mapping done on a page basis, and using a single level page table. Assume that the necessary page table is always in memory. (a) If a memory reference takes 100 nanoseconds, how long does a memory mapped reference take if there is no TLB within the MMU to cache recently used page addresses? (b)now we add an MMU which imposes an overhead of 15 nanoseconds on a hit or a miss. If we assume that 90 percent of all memory references hit in the MMU TLB, what is the Effective Memory Access time? 13. When is a simple page table structure ineffective? Explain the properties of (a) hierarchical page tables, (b) hashed page table, and (c) inverted page tables. 14. How is segmentation different from the paging memory model? Illustrate the segmentation architecture. 15. Is there any advantage to supporting multiple page sizes, as is done on the Pentium? 16. (Problem 8.11) Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order), how would each of the first-fit, best-fit, and worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB, and 426 KB (in order)?which algorithm makes the most efficient use of memory? 17. (problem 8.17) Assuming a 1 KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers): a. 2375, b. 19366, c. 30000, d. 256, e. 16385 18. (problem 8.19) Consider a computer system with a 32-bit logical address and 4 KB page size. The system supports up to 512 MB of physical memory. How many entries are there in: a. A conventional single-level page table? b. An inverted page table? 19. (problem 8.23) Consider the following segment table: What are the physical addresses for Segment Base Length 0 219 600 1 2300 14 2 90 100 3 1327 580 4 1952 96 the following logical addresses? a. 0,430, b. 1,10, c. 2,500, d. 3,400, e. 4,112 3 Chapter 9 1. Explain the need for Virtual Memory. Do you know any modern OS that use virtual memory concepts? 2. Explain demand paging. 3. Under what circumstances do page faults occur? Describe the actions taken by the operating system when a page fault occurs. 3

4. When would the OS invoke a page replacement algorithm? Explain basic page replacement. 5. Assume that you have a page-reference string for a process with M frames (initially all empty). The page-reference string has length P; N distinct page numbers occur in it. Answer these questions for any page replacement algorithm: (a) What is a lower bound on the number of page faults? (b) What is an upper bound on the number of page faults? 6. What is the Belady s anomaly? Which page replacements suffer from it, and which are immune? 7. Explain two LRU implementation algorithms (counter and stack implementation). 8. How can victim frames optimize page fault handling? 9. Should there be a minimum and/or maximum limit on the number of frames allocated to each process? Explain. 10. Distinguish between: (a) Equal and proportional allocation, (b) Global and local page replacement algorithms. 11. What is thrashing? How may it be caused? 12. Consider a demand-paged computer system where the degree of multi-programming is currently fixed at four. The system was recently measured to determine utilization of CPU and the paging disk. The results are one of the following alternatives. For each case, what is happening? Can you increase the degree of multiprogramming to increase the CPU utilization? (a) CPU utilization, 13 percent; disk utilization, 97 percent (b) CPU utilization, 87 percent; disk utilization, 3 percent (c) CPU utilization, 13 percent; disk utilization, 3 percent. 13. What are the benefits of the slab allocation policy over the buddy allocator. 14. Explain some issues in deciding the page size to use. 15. (Problem 9.5) List costs and benefits of using virtual memory. 16. (Problem 9.8) 17. (Problem 9.20) A certain computer provides its users with a virtual-memory space of 2 32 bytes. The computer has 2 18 bytes of physical memory. The virtual memory is implemented by paging, and the page size is 4096 bytes. A user process generates the virtual address 11123456. Explain how the system establishes the corresponding physical location. Distinguish between software and hardware operations. 18. (Problem 9.23) Table 9.1 is a page table for a system with 12-bit virtual and physical addresses with 256-byte pages. The list of free page frames is D, E, F (that is, D is at the head of the list, E is second, and F is last.) Given the following virtual addresses, convert them to their equivalent physical addresses in hexadecimal. All numbers are given in hexadecimal. (A dash for a page frame indicates the page is not in memory.) (a) 9EF, (b) 111, (c) 700, (d) 0FF 19. (Problem 9.33) What is the cause of thrashing? How does the system detect thrashing? Once it detects thrashing, what can the system do to eliminate this problem? 4

Page Page Frame 0-1 2 2 C 3 A 4 5 4 6 3 7 8 B 9 0 20. (Problem 9.36) Assume there is an initial 1024 KB segment where memory is allocated using the Buddy system. Using Figure 9.27 as a guide, draw the tree illustrating how the following memory requests are allocated: (a) request 240 bytes (b) request 120 bytes (c) request 60 bytes (d) request 130 bytes. Next, modify the tree for the following releases of memory. Perform coalescing whenever possible: (a) release 240 bytes (b) release 60 bytes (c) release 120 bytes. 4 Chapter 10 1. The OS file system interface is said to provide an abstraction over reality. Explain. 2. List the modes for accessing information in a file. 3. What is a raw partition? When might it be useful? 4. What are the advantages and disadvantages of : (a) Single-level directory, (b) Tree structured directory. 5. How do acyclic graph directory structure overcome the limitation of tree structured directory structure? 6. Explain soft and hard links, as used in Unix. 7. Explain in brief the file protection system maintained in Linux. 8. (Problem 10.4) Could you simulate a multilevel directory structure with a single-level directory structure in which arbitrary long names can be used? How? Would your answer change if the file names were limited to seven characters? 9. (Problem 10.10) Consider a file system where a file can be deleted and its disk space reclaimed while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided? 5 Chapter 11 1. List the typical layers in a general-purpose File System. 5

2. What file system structures are maintained: (a) on disk, (b) in memory. 3. Explain the characteristics, advantages, drawbacks of the following disk allocation methods: (a) Contiguous, (b) linked, and (c) indexed. 4. What is a File Allocation Table (FAT). How does it get over the main drawback of linked file allocation? 5. Consider the organization of a UNIX file as represented by the inode. Assume there are 8 direct block pointers, and a singly, doubly, and triply indirect pointer in each inode. Further, assume that the system block size and the disk sector size are both 4K. (a) What is the maximum file size supported by this system? (b) Assuming no information other than the file inode is already in system memory, how many disk accesses are required to access the byte in position 2,634,012? 6. When and why does an OS invoke a file system consistency check? 7. Explain the strategy of file system recovery using logs. 8. What are the benefits of using NFS? 9. Illustrate an example of file system mounting using NFS. 10. What are the major layers in a NFS architecture? How do they communicate? 6 Chapter 12 1. Explain disk terms: platter, head, track, cylinder, sector. 2. What is a head crash? 3. Explain track skew. 4. What is the disk seek time and rotational delay? 5. What is the average rotational latency of a disk rotating at 5,600 RPM? 6. Serial ATA bus interface is faster than parallel ATA interface. Explain. 7. All the disk scheduling algorithms, except FCFS, are not truly fair (starvation may occur). Explain why this is true. 8. What are benefits of arranging disks in a RAID array? 9. What intuition is used in RAID level 3 to improve cost over RAID level 2? 10. (Problem 12.16) Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is: 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130. Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk-scheduling algorithms? a. FCFS b. SSTF c. SCAN d. LOOK e. C-SCAN 6

11. (Problem 12.23) Could a RAID Level 1 organization achieve better performance for read requests than a RAID Level 0 organization (with nonredundant striping of data)? If so, how? 7