Docsity

King Saud University Exam: Operating Systems (CSC 227) - Spring 2015-16, Study notes of Operating Systems

Toggle sidebar
bg1
Page 1 of 10
K i n g S a u d U n i v e r s i t y
College of Computer and Information Sciences
Computer Science Department
Course Code:
CSC 227
Course Title:
Operating Systems
Semester:
Spring 2015
Exercises Cover Sheet:
Final Exam
Duration: 3hours (081 min)
Student Name:
Student ID:
Student Section No.
Tick the
Relevant
Computer Science B.Sc. Program ABET Student Outcomes
Question No.
Relevant Is
Hyperlinked
Covering
%
a) Apply knowledge of computing and mathematics appropriate to
the discipline;
b) Analyze a problem, and identify and define the computing
requirements appropriate to its solution
c) Design, implement and evaluate a computer-based system,
process, component, or program to meet desired needs;
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;
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download King Saud University Exam: Operating Systems (CSC 227) - Spring 2015-16 and more Study notes Operating Systems in PDF only on Docsity!

K i n g S a u d U n i v e r s i t y College of Computer and Information Sciences Computer Science Department

Course Code: CSC 227 Course Title: Operating Systems Semester: Spring 2015 Exercises Cover Sheet: Final Exam Duration: 3 hours ( 081 min) Student Name:

Student ID:

Student Section No.

Tick the Relevant Computer Science B.Sc. Program ABET Student Outcomes

Question No. Relevant Is Hyperlinked

Covering %

a) Apply knowledge of computing and mathematics appropriate to the discipline;

b) Analyze a problem, and identify and define the computing requirements appropriate to its solution

c) Design, implement and evaluate a computer-based system, process, component, or program to meet desired needs;

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;

King Saud University College Of Computer and Information Sciences Computer Science Department CSC 227: Operating Systems Total Marks: 40 Time: 08:00am – 10:00am (120 minutes) Spring 2015- 16 Name: ……………………………………….…………………………… Final Exam ID#: ……………………………………………………………………… Date: 19-May- 2016 Section#: …………………… or Teacher Name : ……………………… Instructions:  This exam has 11 pages (including title page) and has 6 questions.  Do not use pencil.  Write clearly and neatly.

Question 1. [10 marks] Circle your answer and copy it to the table ONLY ONE ANSWER (the best answer). Copy your answer for question 1-1 to 1-15 in the table on page2. ONLY THAT TABLE WILL BE GRADED.

If a thread attempts a wait() operation when a counting semaphore has been decremented to zero, the thread

A process is a program in execution, it exists in main memory and it may be:

a. must wait until a resource is returned to the pool by a signal() operation a. Either OS process or User process

b. obtains a resource from the pool and the semaphore remains equal to 0 b. Either I/O bound process or CPU bound process

c. returns a resource to the pool and increments the semaphore to 1 c. Either Independent process or Cooperating process d. obtains^ a^ resource^ from^ the^ pool^ and decrements the semaphore to 1 d. (^) All the above

  1. Which^ of^ the^ following^ statements^ about semaphores is true? 4. (^) A critical section is a program segment

a.

If several threads attempt a wait(S) operation simultaneously, only one thread should be allowed to proceed.

a. which should run in a certain specified amount of time.

b. wait()^ and^ signal()^ operations^ should^ be indivisible operations.

b. (^) which avoids deadlocks.

c.

A semaphore implementation should guarantee that threads do not suffer indefinite postponement.

c. (^) where shared resources are accessed

d. (^) all of the above d. which must be enclosed by a pair of semaphore operations, P and V.

A scheduling method in which a processes can be interrupted whether they have completed their current task or not is

  1. A frame is a portion of

a. (^) dynamic a. (^) registers memory b. preemptive b. virtual Memory c. (^) non-preemptive c. (^) logical Memory d. static d. physical memory

  1. Which of the following instructions should be privileged?
    1. (^) Dynamic linking is the linking method done at:

a. Set value of timer a. (^) Compilation time

b. Switch from user to kernel mode b. Loading time c. Read the clock c. (^) Execution time d. Create a new thread d. (^) Proper time

  1. (^) Process execution consists of a cycle of: 20. CPU scheduling decisions may take place when a process a. IO burst then CPU burst a. (^) Switches from running to waiting state

b. CPU burst then I/O burst b. Switches from running to ready state c. CPU burst then CPU burst then IO burst c. Switches from waiting to ready d. None of the above d. (^) All of the above

    a d d c b d d a c c
          1. 16 17 18 19 20 b a b c b c b c b d

Question 2. [5 marks] 2 -a) [1 mark] How does aging solve the starvation problem in priority based scheduling system?

It works by increasing the priority of a process as time passes and will eventually be the highest priority request (after it has waited long enough)

2 -b) [1 mark] Assuming special hardware is available to support swapping, when is it appropriate to use execution-time binding?

If the process can be moved during its execution from one memory segment to another, then binding must be delayed until execution time.

2 -c) [1 mark] How do base register and limit register help in protecting against illegal memory access?

Any access to memory is checked against these two registers. The address should be greater or equal than the base address and smaller than (Base register + limit register).

2 -d) [1 mark] How does shared-pages help in saving memory?

By having only one copy of the code in physical memory.

2 -e) [1 mark] What is the use of Translation Look-aside Buffer (TLB)?

With standard paging scheme two memory accesses are needed to access a byte (one for the page-table entry, one for the byte). TLB is small, fast lookup hardware cache that stores recent translations of virtual memory to physical addresses for faster retrieval.

S--;

The classical definitions of signal in pseudocode is signal(S){ S++; }

A binary semaphore is one that only takes the values 0 and 1. These semaphores are used to implement mutual exclusion.

3 -e) [1 mark] Mention at least two parameters needed to define a multilevel-feedback-queue scheduler.

Number of queues Scheduling algorithms for each queue

Method used to determine when to upgrade a process

Method used to determine when to demote a process

Method used to determine which queue a process will enter when that process needs service

Question 4. [8 marks]

4 -a) Consider the following set of processes, with the length of the CPU burst given in milliseconds: i) [2 marks] Find out turnaround time for each process using the Non-Preemptive Priority Scheduling (a smaller priority number implies a higher priority)? Two possible answers. ii) [2 marks] Find out turnaround time for each process using Preemptive Priority Scheduling (a smaller priority number implies a higher priority)? Two possible answers. iv) [2 marks] Find out turnaround time for each processes using Preemptive Shortest Job First Time (or

 - P1 Process Burst Priority Arrival Time - P2 - P3 - P4 - P5 
  • TT1 iii) [2 marks] Find out turnaround time for each process using Non-Preemptive Shortest Job First Time?
  • TT2
  • TT3
  • TT4
  • TT5
    • TT1 Shortest-Remaining-Time-First)? Two possible answers.
    • TT2
    • TT3
    • TT4
    • TT5 - TT1 - TT2 - TT - TT - TT5
  • TT1
  • TT2
  • TT3
  • TT4
  • TT5 - TT1 - TT2 - TT3 - TT4 - TT5
  • TT1
  • TT2
  • TT3
  • TT4
  • TT5 - TT1 - TT2 - TT3 - TT4 - TT5

Question 6. [ 4 marks] 6 -a) [1 mark] List two different definitions of the operating system.

i) OS is a resource allocator a) Manages all resources b) Decides between conflicting requests for efficient and fair resource use ii) OS is a control program a) Controls execution of programs to prevent errors and improper use of the computer iii) “Everything a vendor ships when you order an operating system” is good approximation 6 -b) [1 mark] What is Direct Memory Access (DMA)? A hardware device controller that can transfer a block of data data to/from any device buffer its own buffer storage without the intervention of the CPU. Only one interrupt is generated when the block transfer is finished rather than one interrupt by byte generated for low-speed devices.

6 -c) [1 mark] Micro-kernel moves most of the kernel into user space. List three advantages of Micro-kernels: Easier to extend a microkernel Easier to port the operating system to new architectures More reliable (less code is running in kernel mode) More secure

6 -d) [1 mark] Security and Protection are some of the major roles of an operating system. What is the difference between Security and protection?  Protection involves ensuring that all access to system resources is controlledSecurity of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts