Student Name:.. Student ID... Course Code: CSC 227 Course Title: Semester: Fall Exercises Cover Sheet:

Similar documents
MC7204 OPERATING SYSTEMS

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

CSC 716 Advanced Operating System Fall 2007 Exam 1. Answer all the questions. The maximum credit for each question is as shown.

Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)

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

QUESTION BANK UNIT I

Midterm Exam. October 20th, Thursday NSC

Exam Guide COMPSCI 386

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

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

King Saud University College of Computer and Information Sciences Computer Science Department

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

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

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

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

Main Points of the Computer Organization and System Software Module

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

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

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

CHAPTER 2: PROCESS MANAGEMENT

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

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

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

FCM 710: Architecture of Secure Operating Systems

FCM 710: Architecture of Secure Operating Systems

Chendu College of Engineering & Technology

CS370 Operating Systems Midterm Review

TDIU25: Operating Systems II. Processes, Threads and Scheduling

MARUTHI SCHOOL OF BANKING (MSB)

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

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

SNS COLLEGE OF ENGINEERING

ECE 3055: Final Exam

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

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

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

Lecture 2 Process Management

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

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

INSTITUTE OF AERONAUTICAL ENGINEERING

LECTURE 3:CPU SCHEDULING

Chapter 2 Processes and Threads

UNIT:2. Process Management

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

King Saud University College of Computer and Information Sciences Computer Science Department

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Chapter 1: Introduction Dr. Ali Fanian. Operating System Concepts 9 th Edit9on

CSI3131 Final Exam Review

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

CHAPTER NO - 1 : Introduction:

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

(MCQZ-CS604 Operating Systems)

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

CHAPTER 3 - PROCESS CONCEPT

Multiprocessor and Real- Time Scheduling. Chapter 10

CS370 Operating Systems Midterm Review. Yashwant K Malaiya Spring 2019

OPERATING SYSTEMS UNIT - 1

CS3733: Operating Systems

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

COMP 3361: Operating Systems 1 Final Exam Winter 2009

CS418 Operating Systems

CPU scheduling. Alternating sequence of CPU and I/O bursts. P a g e 31

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

CS307: Operating Systems

Operating Systems Design Fall 2010 Exam 1 Review. Paul Krzyzanowski

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

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

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

CSC 2405: Computer Systems II

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

Chapter 6: CPU Scheduling

Properties of Processes

CSC 4320 Test 1 Spring 2017

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

CS370 Operating Systems

Following are a few basic questions that cover the essentials of OS:

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Class average is Undergraduates are performing better. Working with low-level microcontroller timers

Operating System MC Exercises

8: Scheduling. Scheduling. Mark Handley

CS370 Operating Systems

CS307 Operating Systems Main Memory

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

Processes The Process Model. Chapter 2. Processes and Threads. Process Termination. Process Creation

Unit 3 : Process Management

Operating System(16MCA24)

CPU Scheduling: Objectives

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

CSE 4/521 Introduction to Operating Systems. Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018

CS Mid term Exam Maximum points 100; Maximum time allowed: 75 minutes

OPERATING SYSTEMS CS3502 Spring Processor Scheduling. Chapter 5

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Chapter 8: Memory-Management Strategies

Operating Systems Overview. Chapter 2

PESIT SOUTHCAMPUS. Question Bank

Operating Systems Course 2 nd semester 2016/2017 Chapter 1: Introduction

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

Indian Institute of Technology, Kharagpur

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

Transcription:

King Saud University College of Computer and Information Sciences Computer Science Department Course Code: CSC 227 Course Title: Operating Systems Semester: Fall 2016-2017 Exercises Cover Sheet: Final Exam Student Name: Student ID: Student Section No. Tick the Relevant X X X Computer Science B.Sc. Program ABET Student Outcomes a) Apply knowledge of computing and mathematics appropriate to the computer science; (1.1) Question No. Relevant Q. 1 b) Analyze a problem, and identify and define the computing requirements appropriate to its solution Q.3, Q.5, Q.6 c) Design, implement and evaluate a computer-based system, process, component, or program to meet desired needs; Q.2, Q.7, Q.8, Q.9 Cover % X d) Function effectively on teams to accomplish a common goal; e) Understanding of professional, ethical, legal, security, and social issues and responsibilities; f) Communicate effectively with a range of audiences; g) Analyze the local and global impact of computing on individuals, organizations and society; h) Recognition of the need for, and an ability to engage in, continuing professional development; i) Use current techniques, skills, and tools necessary for computing practices. j) Apply mathematical foundations, algorithmic principles, and computer science theory in the modeling and design of computer-based systems in a way that demonstrates comprehension of the tradeoffs involved in design choices; k) Apply design and development principles in the construction of software systems of varying complexity; CSC227 Final Exam. Fall 2016-2017 Page 1 of 14

Question 1. (10 marks) Select ONLY ONE ANSWER (the best answer). Copy your answer for question 1-1 to 1-20 in the table on page4. ONLY THAT TABLE WILL BE GRADED. (your answer should be one of the letters A, B, C or D) 1. Handheld computers are 2. No boss processor and each processor performs all tasks Resource poor, optimized for usability and A. battery life. A. Asymmetric Multiprocessing Resource poor optimized for high performance B. computing. B. Symmetric Multiprocessing Resource rich, optimized for usability and battery C. life C. Multitasking D. All of the above D. Multiprogramming 3. Graphical Processing Unit (GPU) 4. System call pass parameters by A. Renders advanced graphics. A. Simplest: Register Parameters stored in a block, or table, in memory, B. Used for general numerical processing B. and address of block passed as a parameter in a register Parameters pushed, onto the stack by the program C. Physics simulations for games. C. and popped off the stack by the OS. D. All of the above D. All of the above the designers of MS-DOS had no choice but to State of a process that is not currently running, but 5. 6. leave the base hardware accessible expected to use I/O in a while Because hardware architecture for which it was A. written provides no dual mode and no hardware A. Waiting protection Because hardware architecture for which it was B. B. Ready written provides provide dual mode. C. MSDOS was based on multi-mode hardware. C. Running D. None of the above D. New 7. When a process is running and its time slice has been expired, which of the following would happen E. The process terminates. E. Zombie process F. Waits for an Interrupt F. Orphan process G. Process will be inserted to I/O queue. G. Aborted process 8. A process that has terminated, but whose parent has not yet called wait(), is known as a CSC227 Final Exam. Fall 2016-2017 Page 2 of 14

H. The process will be inserted to Ready queue. H. New process 9. E. Bounded waiting implies that there exists a bound on the number of times a process is allowed to enter its critical section : after a process has made a request to enter its critical section and before the request is granted 10. Mutual exclusion implies that : if a process is executing in its critical section, then no other process must be executing in their critical E. sections F. when another process is in its critical section F. sections before a process has made a request to enter its G. critical section H. after a process leaves its critical section H. if a process is executing in its critical section, then other processes must be executing in their critical if a process is executing in its critical section, G. then all the resources of the system must be blocked until it finishes execution Two processes are executing in their critical section. 11. In priority scheduling algorithm, when a process arrives at the ready queue, its priority is compared with the priority of: 12. Mutual exclusion can be provided by the: E. all process E. mutex locks F. currently running process F. binary semaphores G. parent process G. both (a) and (b) H. initial process H. none of the mentioned 13. When several processes access the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place, is called: 14. Which one of the following is a synchronization tool? I. dynamic condition I. Thread J. race condition J. Pipe K. essential condition K. Semaphore L. critical condition L. Socket 15. Which organization system does not allow sharing of memory areas between processes 16. Associative memory is : I. Hashed page table Is a cache memory used to store data close to the I. CPU J. Inverted page table Is a cache memory used the DMA to accelerate J. data transfer CSC227 Final Exam. Fall 2016-2017 Page 3 of 14

K. Hierarchical page table Is cache memory used by the memory K. management unit L. Segment table Is a cache memory used by device controllers to L. accelerate access to external devices 17. In segmentation, each address is specified by: 18. Which of the following components of a program state IS NOT shared across threads in a multithreaded process? I. segment number and offset I. Register values J. page number and offset J. Heap memory K. frame number K. Global variables L. DMA address L. Files 19. In deferred thread cancellation, 20. Which system will provide the fastest memory access: M. Thread is allowed to wait until the time is over M. Compile time binding Thread is allowed to wait until the parent N. terminates N. Load time binding Thread will decide when to check if it should be O. cancelled O. I/O time binding P. The system will kill the thread immediately P. Execution time binding Your Answer should be written in the following table: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. A A D D A C C C B A 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. A A D D A C C C B A CSC227 Final Exam. Fall 2016-2017 Page 4 of 14

Question 2. [2.5 Marks] 2.1 Explain the concept of caching? How does it work? Why modern operating systems apply caching? (1.5 marks). at many levels in a computer (in hardware, operating system, software) Information in use copied from slower to faster storage temporarily Faster storage (cache) checked first to determine if information is there If it is, information used directly from the cache (fast) If not, data copied to cache and used there Caching lead to higher performance and CPU utilization. CSC227 Final Exam. Fall 2016-2017 Page 5 of 14

2.2 (a) Many modern solutions and applications rely on clustered systems e.g. search engines, social media (Twitter, Facebook, Instagram. etc.). Explain the concept of clustering? [0.5 mark] Answer: multiple systems working together (loosely coupled) Usually sharing storage via a storage-area network (SAN) Provides a high-availability service which survives failures (b) Show the differences between asymmetric clustering and symmetric clustering? [0.5 mark] Answer: Asymmetric clustering has one machine in hot-standby mode (replacing the active server in case of fails, otherwise waits) Symmetric clustering has multiple nodes running applications, monitoring each other CSC227 Final Exam. Fall 2016-2017 Page 6 of 14

Question 3. [2.5 Marks] (a) There are various ways for structuring an operating system including but not limited to (Layered approach, Modular Approach, and Microkernel), explain one approach of your choice? (1 mark) Layered Approach: The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers This approach simplifies debugging and system verification. A layer does not need to know how operations at a lower layer are implemented; it needs to know only what these operations do. Once the first layer is debugged, its correct functioning can be assumed while the second layer is debugged, and so on. If an error is found during the debugging of a particular layer, the error must be on that layer, because the layers below it are already debugged. The result is a smaller kernel. The kernel provides communication between the client program and the various services that are also running in user space. Communication is provided through message passing. The client program and service never interact directly. Rather, they communicate indirectly by exchanging messages with the microkernel. Modular Approach: Many modern operating systems implement loadable kernel modules The kernel provides core services l -oriented approach CSC227 Final Exam. Fall 2016-2017 Page 7 of 14

(b) What are the benefits of using a Microkernel approach (at least two benefits)? [0.75 marks] *Easier to extend a microkernel (All new services are added to user space and consequently do not require modification of the kernel) *Easier to port the operating system to new architectures ( a few modifications) *More reliable (less code is running in kernel mode) *More secure (c) If you had the option to choose between modular approach or Layered approach, which approach would you choose and why? [0.75marks] Open answer CSC227 Final Exam. Fall 2016-2017 Page 8 of 14

Question 4. [4 Marks] 4.1 Each process in the operating system is represented by Process Control Block (PCB). What information are contained in PCS associated to each process (at least three)? [1.5 marks] Process state Program counter CPU registers CPU scheduling information Memory-management informationtus information 4.2 (a) what is the difference between short-term scheduler and long-term scheduler in term of purpose? [1 mark] Long-term (or job scheduler) selects which processes should be brought into the ready queue Short-term (or CPU scheduler) selects which process should be executed next and allocates CPU (b) What is the difference between short-term scheduler and long-term scheduler in term of frequency? [0.5 mark] Short-term scheduler is invoked very frequently Long-term scheduler is invoked very infrequently 4.3 Why a Medium term scheduler might be required? [1 mark] Reduce the degree of multiprogramming Balance I/O bound and CPU bound processes. CSC227 Final Exam. Fall 2016-2017 Page 9 of 14

Question 5. [3 Marks]: a) Having a program composed we would like to know if it should use multithreading or not. If the serial portion of the program is 30%, and we have a multi-core system, what will be the speedup if the parallel section of the program is divided into 4 different threads? Justify your answer. [2 marks] Speedup will be 2.1 b) If we have only one processor, is there any interest in dividing the process into 4 threads? Explain. [1 mark] Yes, because if one thread is blocked waiting for a resource, the others can continue execution without waiting. CSC227 Final Exam. Fall 2016-2017 Page 10 of 14

Question 6. [3 Marks] Explain the use of Peterson's algorithm (or Peterson's solution) as a concurrent programming algorithm for mutual exclusion that allows two processes P0 and P1 to share a single-use resource without conflict, using only shared memory for communication by answering the followings: Give the types, names, and initializations of the variables used by Peterson's algorithm as shared memory for communication: (1 Mark). Write the generic codes of the processes P0 and P1 using Peterson s algorithm. (2 Marks). CSC227 Final Exam. Fall 2016-2017 Page 11 of 14

Question 7. [7 Marks] Suppose that the following processes arrive for execution at the times indicated below. Each process will run for the amount of the time listed as burst time. In answering the questions, use non-preemptive scheduling, and base all decisions on the information you have at the time the decision must be made. Process Arrival Time Burst Time P1 0.0 8 P2 0.4 4 P3 1.0 1 7.1 Draw the Gantt chart for these processes with the FCFS scheduling algorithm [1 mark]. 7.2 Calculate the average turnaround time for these processes with the FCFS scheduling algorithm? [2.5marks] 10.53 7.3 Draw the Gantt chart for these processes with the SJF scheduling algorithm. [1marks] 7.4 Calculate the average turnaround time for these processes with the SJF scheduling algorithm? [2.5 marks]. CSC227 Final Exam. Fall 2016-2017 Page 12 of 14

Question 8. [3.5 marks] (a) Consider a Memory Management System that is uses 8 bits to address the memory and a memory allocation based on segmentation. Using the below segmentation table, convert the given local addresses into physical addresses. [2.5 marks]: Segment Segment Base Segment Limit 0 33 10 1 180 45 2 11 18 3 231 19 Find the physical address corresponding to each of the following logical addresses: 1. Address 2, 6. Physical address is:.... 2. Address 1, 25. Physical address is:.... 3. Address 0, 13. Physical address is:.... 4. Address 3, 6. Physical address is:.... 5. Address 5, 9. Physical address is:.... b) Consider a 32-bit system using Two-Level hierarchical paging architecture, as follows: [1.0 marks]: Outer page number Inner page number page offset p1 d 10 bits 12 bits 10 bits The outer page table and the inner page table are stored in physical memory and that this system uses Associative Memory. If the access time to physical memory is 100ns and the access time to associative memory is 20ns. If the hit ratio is 80%, what is the effective access time (EAT)? CSC227 Final Exam. Fall 2016-2017 Page 13 of 14

Question. 9 [4.5 Marks]: Consider the following memory representation, where free areas are indicated with their sizes. The filled areas are indicated with their sizes and the process number. Draw the final memory state after executing the following events in sequence. Use memory maps given below to answer the question. 1. P7 Arrives (requires 14KB), 2. P8 Arrives (requires 10KB), 3. P9 Arrives (requires 7KB), 4. P6 TERMINATED 5. P10 Arrives (requires 16KB) 6. P11 Arrives (requires 11KB) a) Use First-Fit Allocation technique: [1.5 marks] P1 P2 P3 P4 P5 P6 10K 10K 8K 20K 6K 18K 4K 7K 9K 12K 12K 15K b) Use Best-Fit Allocation technique: [1.5 marks] P1 P2 P3 P4 P5 P6 10K 10K 8K 20K 6K 18K 4K 7K 9K 12K 12K 15K c) Use Worst-Fit Allocation technique: [1.5 marks] P1 P2 P3 P4 P5 P6 10K 10K 8K 20K 6K 18K 4K 7K 9K 12K 12K 15K End of the exam. CSC227 Final Exam. Fall 2016-2017 Page 14 of 14