Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Login

Register Now

Welcome to All Test Answers

Midterm -Winter 2018-Operating System – Solutions


 

 

Download  file with the answers

Not a member!
Create a FREE account here to get access and download this file with answers


 

MIDTERM EXAMINATION
OPERATING SYSTEM CONCEPTS
03-60-330-01 Tuesday February 27 Winter 2018
UNIVERSITY OF WINDSOR
SCHOOL OF COMPUTER SCIENCE
1. This is a CLOSED book test; no notes, textbooks, calculators or computer aids are allowed.
2. PRINT your name legibly and clearly with your Student ID in the spaces indicated on the Scantron sheet.
3. There are 17 pages in this exam. Part I is on Page-2 and Part II is on Page-11.
4. In each Multiple Choice question, 2-4 responses are provided – you are to choose only one response which best answers the question. Use the Scantron sheet provided to indicate your answers. Circle the letter A, B, C or D (one only).
5. For True/False types of questions, circle either A or B.
6. Place all responses on the approved Scantron marking sheet using PENCIL.
7. If an error is made you must carefully erase the error and then fill in the circle you intend to choose.
8. You are not allowed to give or receive unauthorized help with your test. Any misconduct, as outlined by the Senate bylaw 31 article I, will be reported accordingly.
9. You have 75 minutes to complete this test.
The total mark is 100.
Last Name :
First Name :
Student Number :
2
Part I (50 marks — 1 mark/question) – Multiple Choice Questions
USE PENCIL ONLY ON THE SCANTRON SHEET
1.
In what way is an operating system like a government?
A) It seldom functions correctly
B) It creates an environment within which other programs can do useful work
C) It performs most useful functions by itself
D) It is always concerned primarily with the individual’s needs
2.
A _____ is an example of a systems program.
A) command interpreter
B) Web browser
C) text formatter
D) database system
3.
The ____ of a process contains temporary data such as function parameters, return
addresses, and local variables.
A) text section
B) data section
C) program counter
D) stack
4.
____ is a thread library for Solaris that maps many user-level threads to one kernel thread.
A) Pthreads
B) Green threads
C) Sthreads
D) Java threads
5.
A race condition ____.
A) results when several threads try to access the same data concurrently
B) results when several threads try to access and modify the same data concurrently
C) will result only if the outcome of execution does not depend on the order in
which instructions are executed
D) None of the above
3
6.
Which of the following is true of cooperative scheduling?
A) It requires a timer
B) A process keeps the CPU until it releases the CPU either by terminating or by
switching to the waiting state
C) It incurs a cost associated with access to shared data
D) A process switches from the running state to the ready state when an interrupt occurs
7.
Absolute code can be generated for ____.
A) compile-time binding
B) load-time binding
C) execution-time binding
D) interrupt binding
8.
The operating system kernel consists of all system and application programs in a
computer.
A) True
B) False
9.
KDE and GNOME desktops are available under open-source licenses.
A) True
B) False
10.
All processes in UNIX first translate to a zombie process upon termination.
A) True
B) False
11.
A traditional (or heavyweight) process has a single thread of control.
A) True
B) False
12.
Race conditions are prevented by requiring that critical regions be protected by locks.
A) True
B) False
4
13.
In preemptive scheduling, the sections of code affected by interrupts must be
guarded from simultaneous use.
A) True
B) False
14.
A relocation register is used to check for invalid memory addresses generated by a CPU.
A) True
B) False
15.
____ operating systems are designed primarily to maximize resource utilization.
A) PC
B) Handheld computer
C) Mainframe
D) Network
15.
If a program terminates abnormally, a dump of memory may be examined by
a ____ to determine the cause of the problem.
A) module
B) debugger
C) shell
D) control card
17.
A process control block ____.
A) includes information on the process’s state
B) stores the address of the next instruction to be processed by a different process
C) determines which process is to be executed next
D) is an example of a process queue
18.
Pthreads refers to ____.
A) the POSIX standard
B) an implementation for thread behavior
C) a specification for thread behavior
D) an API for process creation and synchronization
5
19.
An instruction that executes atomically ____.
A) must consist of only one machine instruction
B) executes as a single, uninterruptible unit
C) cannot be used to solve the critical section problem
D) All of the above
20.
____ is the number of processes that are completed per time unit.
A) CPU utilization
B) Response time
C) Turnaround time
D) Throughput
21.
_____ is the method of binding instructions and data to memory performed by most
general-purpose operating systems.
A) Interrupt binding
B) Compile time binding
C) Execution time binding
D) Load-time binding
22.
A system call is triggered by hardware.
A) True
B) False
23.
Many operating system merge I/O devices and files into a combined file because of the similarity of system calls for each.
A) True
B) False
24.
The difference between a program and a process is that a program is an active
entity while a process is a passive entity.
A) True
B) False
6
25.
A thread is composed of a thread ID, program counter, register set, and heap.
A) True
B) False
26.
The value of a counting semaphore can range only between 0 and 1.
A) True
B) False
27.
In RR scheduling, the time quantum should be small with respect to the context-switch time.
A) True
B) False
28.
Reentrant code cannot be shared.
A) True
B) False
29.
Which of the following would lead you to believe that a given system is an SMP-type system?
A) Each processor is assigned a specific task
B) There is a boss–worker relationship between the processors
C) Each processor performs all tasks within the operating system
D) None of the above
30.
A message-passing model is ____.
A) easier to implement than a shared memory model for inter-computer communication
B) faster than the shared memory model
C) a network protocol, and does not apply to operating systems
D) only useful for small simple operating systems
7
31.
The list of processes waiting for a particular I/O device is called a(n) ____.
A) standby queue
B) device queue
C) ready queue
D) interrupt queue
32.
The ____ multithreading model multiplexes many user-level threads to a smaller or equal number of kernel threads.
A) many-to-one model
B) one-to-one model
C) many-to-many model
D) many-to-some model
33.
A counting semaphore ____.
A) is essentially an integer variable
B) is accessed through only one standard operation
C) can be modified simultaneously by multiple threads
D) cannot be used to control access to a thread’s critical sections
34.
____ scheduling is approximated by predicting the next CPU burst with an exponential average of the measured lengths of previous CPU bursts.
A) Multilevel queue
B) RR
C) FCFS
D) SJF
35.
An address generated by a CPU is referred to as a ____.
A) physical address
B) logical address
C) post relocation register address
D) Memory-Management Unit (MMU) generated address
8
36.
UNIX does not allow users to escalate privileges to gain extra permissions for a restricted activity.
A) True
B) False
37.
System calls can be run in either user mode or kernel mode.
A) True
B) False
38.
The exec() system call creates a new process.
A) True
B) False
39.
Virtually all contemporary operating systems support kernel threads.
A) True
B) False
40.
A deadlock-free solution eliminates the possibility of starvation.
A) True
B) False
41.
The most complex scheduling algorithm is the multilevel feedback-queue algorithm.
A) True
B) False
42.
There is a 1:1 correspondence between the number of entries in the TLB and the
number of entries in the page table.
A) True
B) False
9
43.
A ____ can be used to prevent a user program from never returning control to the
operating system.
A) portal
B) program counter
C) firewall
D) timer
44.
The major difficulty in designing a layered operating system approach is ____.
A) appropriately defining the various layers
B) making sure that each layer hides certain data structures, hardware, and operations from
higher-level layers
C) debugging a particular layer
D) making sure each layer is easily converted to modules
45.
The _____________ refers to the number of processes in memory.
A) process count
B) long-term scheduler
C) degree of multiprogramming
D) CPU scheduler
46.
Windows uses the ____.
A) one-to-one model
B) many-to-one model
C) one-to many-model
D) many-to-many model
47.
A mutex lock ____.
A) is exactly like a counting semaphore
B) is essentially a boolean variable
C) is not guaranteed to be atomic
D) can be used to eliminate busy waiting
10
48.
The ____ scheduling algorithm is designed especially for time-sharing systems.
A) SJF
B) FCFS
C) RR
D) Multilevel queue
49.
Suppose a program is operating with execution-time binding and the physical address
generated is 300. The relocation register is set to 100. What is the corresponding
logical address?
A) 199
B) 201
C) 200
D) 300
50.
Processors for most mobile devices run at a slower speed than a processor in a desktop
PC.
A) True
B) False
11
Part II (50 marks) – Essay and Short Answer Questions
51. [7 marks] What is the advantage of using dynamic loading?
Ans: With dynamic loading a program does not have to be stored, in its entirety, in main memory. This allows the system to obtain better memory-space utilization. This also allows unused routines to stay out of main memory so that memory can be used more effectively. For example, code used to handle an obscure error would not always use up main memory.
Answer:
12
52. [7 marks] Explain the concept of a CPU–I/O burst cycle.
Ans: The lifecycle of a process can be considered to consist of a number of bursts belonging to two different states. All processes consist of CPU cycles and I/O operations. Therefore, a process can be modeled as switching between bursts of CPU execution and I/O wait.
Answer:
13
53. [7 marks] What three conditions must be satisfied in order to solve the critical section problem?
Ans: In a solution to the critical section problem, no thread may be executing in its critical section if a thread is currently executing in its critical section. Furthermore, only those threads that are not executing in their critical sections can participate in the decision on which process will enter its critical section next. Finally, a bound must exist on the number of times that other threads are allowed to enter their critical state after a thread has made a request to enter its critical state.
Answer:
14
54. [7 marks] Why should a web server not run as a single-threaded process?
Ans: For a web server that runs as a single-threaded process, only one client can be serviced at a time. This could result in potentially enormous wait times for a busy server.
Answer:
15
55. [7 marks] Name and describe the different states that a process can exist in at any given time.
Ans: The possible states of a process are: new, running, waiting, ready, and terminated. The process is created while in the new state. In the running or waiting state, the process is executing or waiting for an event to occur, respectively. The ready state occurs when the process is ready and waiting to be assigned to a processor and should not be confused with the waiting state mentioned earlier. After the process is finished executing its code, it enters the termination state.
Answer:
16
56. [8 marks] There are two different ways that commands can be processed by a command interpreter. One way is to allow the command interpreter to contain the code needed to execute the command. The other way is to implement the commands through system programs. Compare and contrast the two approaches.
Ans: In the first approach, upon the user issuing a command, the interpreter jumps to the appropriate section of code, executes the command, and returns control back to the user. In the second approach, the interpreter loads the appropriate program into memory along with the appropriate arguments. The advantage of the first method is speed and overall simplicity. The disadvantage to this technique is that new commands require rewriting the interpreter program which, after a number of modifications, may get complicated, messy, or too large. The advantage to the second method is that new commands can be added without altering the command interpreter. The disadvantage is reduced speed and the clumsiness of passing parameters from the interpreter to the system program.
Answer:
17
57. [7 marks] Explain why an operating system can be viewed as a resource allocator.
Ans: A computer system has many resources that may be required to solve a problem: CPU time, memory space, file-storage space, I/O devices, and so on. The operating system acts as the manager of these resources. Facing numerous and possibly conflicting requests for resources, the operating system must decide how to allocate them to specific programs and users so that it can operate the computer system efficiently and fairly.
Answer:

About

Leave a reply

Captcha Click on image to update the captcha .

error: Content is protected !!