Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 5

FACULTY OF COMPUTING, INFORMATION SYSTEMS AND

MATHEMATICS

CSU 7205: OPERATING SYSTEMS I

TUTORIAL I
SEM I 2020/21
INSTRUCTIONS:
1. Organize yourself into subgroups of not more than 5 students from the same
tutorial group and attempt all the questions in this tutorial sheet and prepare the
solution
2. During tutorial sessions, each group will be required to present before the class and
the marks may be awarded accordingly
3. After each presentation, the tutor may demand a copy of the solution from each
group for future reference
4. The subgroups must be formed by from members of the same tutorial group
5. No solution from more than one group is expected to be similar
6. While explaining concepts, DON’T COPY the lecture notes. Other sources such as
books and online sources may be used by should be indicated. You should indicate the
source of the material.

QUESTION ONE
a) What abstracts the hardware? Why? Give an example of such abstraction.
b) What is DMA? How does it operate?
c) Explain in detail what is a dual mode operation

d) What are the three main purposes of an operating system?


e) How is dual mode implemented?

f) What is a privileged instruction? Give examples

g) What is a system call? Briefly describe the categories of system calls giving three
examples from each category give examples

h) What is the difference between a program and a process? Give an example

i) What is the difference between a process and a thread? What is the significance
of threads?

j) What is the difference between a synchronous event and asynchronous event?


Give example.

k) Summarize the evolution of operating systems from as early as 1940.

l) What is the difference between multiprogramming and multiprocessing?

1
m) What is the difference between hard real time and soft real time systems?

n) Categorize the operating systems based on hardware machine they run.

QUESTION TWO

In a multiprogramming and time-sharing environment, several users share the system


simultaneously. This situation can result in various security problems.
a) What are two such problems?

b) Can we ensure the same degree of security in time-shared machines in a dedicated


machine? Explain your answer.

QUESTION THREE

What is the purpose of interrupts? What are the differences between a trap and an
interrupt? Can traps be generated intentionally by a user program? If so, for what purpose?
What is the difference between an interrupt and polling?
Explain these concepts in your own words. dont copy from the lecture notes.

QUESTION FOUR
Direct memory access is used for high-speed I/O devices in order to avoid increasing the
CPU´s execution load.
a) How does the CPU interface with the device to coordinate the transfer?
b) How does the CPU know when the memory operations are complete?
c) The CPU is allowed to execute other programs while the DMA controller is
transferring data. Does this process interfere with the execution of the user
programs? If so, describe what forms of interference are caused.

QUESTION FIVE

a) What is the purpose of system calls?


b) What are the five major activities of an operating system in regard to process
management?
c) What are the three major activities of an operating system in regard to memory
management?
d) What are the three major activities of an operating system in regard to secondary-
storage management?
e) What is the purpose of the command interpreter? Why is it usually separate from the
kernel?

2
f) Multiprocessing and multiprogramming are two concepts that are sometimes
confused by people who haven't taken CSU 07205. Describe the difference.
g) Define the essential properties of the following types of operating systems:

i. Batch
ii. Time sharing
iii. Real time
iv. Network
v. Distributed
vi. Clustered
vii. Handheld

h) Which of the following instructions should be privileged?

i. Set value of timer


ii. Read the clock
iii. Clear memory
iv. Turn off interrupts
v. Modify entries in device-status table
vi. Switch from user to kernel mode
vii. Access I/O device

QUESTION SIX

The following table shows the difference transitions between states of a process, fill in the
event that causes the change in state: The first event is shown as example.

From State Event To state

New Accepted Ready

Ready Running
Running Waiting
Running Ready

Running Terminated
Waiting Ready

3
QUESTION SEVEN

Define the difference between preemptive and non-preemptive scheduling. State why strict
non-preemptive scheduling is unlikely to be used in a computer center.

QUESTION EIGTH

Consider the following set of processes, with the length of the CPU-burst time given in
milliseconds:
Process Burst Time Priority
P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2
The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
a) Draw four Gantt charts illustrating the execution of these processes using FCFS,
SJF, a non-preemptive priority (a smaller priority number implies a higher priority),
and RR (quantum = 1) scheduling
b) What is the turnaround time of each process for each of the scheduling algorithms in
part a?
c) What is the waiting time of each process for each of the scheduling algorithms in part
a?
d) Which of the schedules in part a results in the minimal average waiting time (over all
processes)?

QUESTION NINE

Suppose that the following processes arrive for execution at the times indicated. Each
process will run the listed amount of time. In answering the questions, use non-preemptive
4
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

a) What is the average turnaround time for these processes with the FCFS scheduling
algorithm?
b) What is the average turnaround time for these processes with the SJF scheduling
algorithm?
c) The SJF algorithm is supposed to improve performance, but notice that we chose to
run process P1 at time 0 because we did not know that two shorter processes would
arrive soon. Compute what the average turnaround time will be if the CPU is left idle
for the First 1 unit and then SJF scheduling is used. Remember that processes P1
and P2 are waiting during this idle time, so their waiting time may increase. This
algorithm could be known as future-knowledge scheduling.

You might also like