You are on page 1of 9

COMP3101

Operating Systems
December 2015 Past Paper

Question 1 [20 marks]

a) i) In general terms what are the four distinct actions that a machine instruction can
specify? [3 marks]
● Processor- Memory: Data may be transferred from processor to memory or from
memory to processor.
● Processor – I/O: Data may be to or from a peripheral device by transferring
between the processor and an I/O module.
● Data processing: The processor may perform some arithmetic or logical operation
on data.
● Control: An instruction may specify that the sequence of execution be altered.

ii) Compare and contrast Cache and Virtual Memory. [2 marks]


● Cache: Is a way of fooling the CPU into believing it has access to a very large,
very fast main memory when main memory might be slow. We do this by
interposing a small, fast memory between the CPU and main memory.
● Virtual Memory: is a way of fooling the CPU into viewing main memory as being
much bigger than the physical memory. This is done by using the disk as a
backing store for main memory. We interpose memory between CPU and disk,
which is called the page table. A cache miss occurs, when a data block cannot be
located with the cache. Therefore the block must be pattern from the main
memory. Page fault occurs when a data block cannot be located in the page table
so it must be retrieved from disk.

iii) What is an Instruction Trace? What events lead to the creation of a process?
[2marks]
An instruction trace for a program is the sequence of instructions that execute for that
process.
Events that lead to the creation of a process:
✔ New batch job.

✔ Interactive logon.

✔ Created by operating system to provide a service.

✔ Spawned existing process.

b) i) Describe the Round – Robin scheduling technique. [2 marks]


Round-Robin scheduling technique is a scheduling algorithm in which processes are
activated in a fixed cyclic order; and processes are in a circular queue.

Note: No starvation; all processes have equal time slice in a round-robin.


COMP3101
Operating Systems
December 2015 Past Paper

ii) Give an example of Reusable and Consumable resources. [2 marks]


● Examples of reusable resources: Processor, I/O channel, main and secondary
memory, devices, and data structures such as files, databases and semaphores.
● Examples of consumable resources: Interrupts, signals, messages and information
in I/O buffer.

iii) What are the fundamental requirements addressed by the computer security? [2
marks]
● Confidentiality: This has to do with unauthorized disclosure of information.
Therefore the maintenance of privacy.
● Integrity: This has to do with the system and data being accurate.
● Availability: the system should work promptly and services should not be denied.

c) i) What is a file management system? [2 marks]


A file management system is that set of system software that provides service to
users and applications in the use of files.

ii) List and briefly define three techniques for performing I/O. [2 marks]
● Programmed I/O: The processor issues an I/O module; that process busy-waits for
the operation to be completed before proceeding.
● Interrupt Driven I/O: The processor issues I/O command on behalf of a processor,
continues to execute subsequent instructions, and is interrupted by the I/O module
when the latter has completed its work.
● Direct Memory Access (DMA): It controls the exchange of data between the
main memory and an I/O module.

iii) What is a model? Differentiate between Continuous and Discrete Model/ [3


marks]
A model is a representation of some phenomenon. Mathematical model is a
mathematical expression of some phenomenon. If a variable can take on any
value between two specified values it is called continuous otherwise it is called
discrete.
✔ Continuous: If the state is defined all the time.

✔ Discrete: If the state is defined only at instances.

Question 2 [10 marks]

a) i) List and briefly define four classes of real – time scheduling algorithms. [2 marks]
COMP3101
Operating Systems
December 2015 Past Paper

● Static Table – Driven Approach: These perform a static analysis of feasible


schedules of dispatching the result of the analysis at run time determines when a
task must begin execution.
● Static Priority – Driven Approach: A static analysis is performed, but no schedule
is drawn up. The analysis is used to assign priority to tasks.
● Dynamic – Planning Based Approach: The feasibility is determined at runtime
rather than offline prior to the start of execution (Statically).
● Dynamic Best Approach: No feasibility analysis is performed; but the system
tries to meet all the deadlines.

ii) What is the difference between Soft and Hard real – time tasks? [1 mark]
● A hard real-time task is one that must meet its deadline; otherwise it will cause
undesirable damage to the system.
● A soft real-time task has an associated deadline that is desirable but not
mandatory, it still makes sense to schedule and complete the task even if it has
passed its deadline.

iii) List and briefly define three version of load sharing. [2 marks]
● FCFS (FIFO): when jobs arrive, each of its threads is placed consecutively at the
end of the share queue.
● Smallest number of threads first (SJF): The queue is organized as a priority queue
with highest priority given to threads with the smallest number of unscheduled
threads.
● Preemptive smallest number of threads first (PSJF): The highest priority is given
to jobs with the smallest number of unscheduled threads. An arriving job with a
smaller number of threads will preempt threads belonging to the scheduled job.

NOTE: Scheduling policy and load sharing is the same thing.

b) i) What are the distinctions between logical, relative and physical addresses? [2
marks]
● A logical address is a reference to a memory location. A translation must be made
to a physical address before the memory can be achieved.
● A relative address is a particular example of logical address, in which the address
is expressed as a location relative to some known point, usually the beginning of
the program.
● A physical address or absolute address is the actual location in main memory.

ii) What is the difference between the active and the passive security threat? [1
mark]
COMP3101
Operating Systems
December 2015 Past Paper

● Passive attacks have to do with eavesdropping on, monitoring, or transmission.


Electronic mail, file transfers, and client/ server exchanges are examples of
transmission that can be monitored.
● Active attacks include the modification of transmitted data and attempts to gain
unauthorized access to computer systems.

iii) List and briefly define three classes of intruders. [2 marks]


● Masquerader: An individual who is not authorized to use the computer and who
penetrates a system’s access controls to exploit a legitimate user’s account.
● Misfeasor: A legitimate user who accesses data, programs, or resources for which
such access is not authorized, or who is authorized for such access but misuses his
or her privileges.
● Clandestine User: An individual who seizes supervisory control of the system and
uses this control to evade auditing and access controls or to suppress audit
collection.

Question 3 [10 marks]

a) i) What does it mean to preempt a process, and why are two modes needed? [2
marks]

Process preemption occurs when an executing process is interrupted by the processor o that
another process can be executed.

● The User Mode: Has restrictions on the instructions that can be executed and the
memory areas that can be accessed. This is to protect the O.S from damage or
alteration.
● The Kernel Mode: The O.S does not have these restrictions, so that it can perform its
task.

ii) Distinguish between a competing process and a cooperating process. Hence, list
the control problems associated with competing process. [2 marks]
● Competing processes need access to the same resources at the same time, such as
a disk, file or printer.
● Cooperating processes either share access to a common object such as a memory
buffer or able to communicate with each other to perform some activities.
● Problems with competing process:
✔ Mutual Exclusion.

✔ Deadlock.

✔ Starvation.
COMP3101
Operating Systems
December 2015 Past Paper

iii) Differentiate between reusable resources and consumable resources. [1 marks]


● Reusable resources are resources that are able to be multiple times. E.g. processor,
I/O channel, main and secondary memory, devices, and data structures such as
files, databases and semaphores.
● Consumable resources are resources that are depleted when used by a process.
E.g. Interrupts, signals, messages and information in I/O buffer.

b) i) What are the typical access rights that may be granted or denied to a particular
user for a particular file? [2 marks]
● None
● Knowledge of
● Read
● Write
● Execute
● Change protection
● Delete

ii) List and briefly define three file allocation methods. [2 marks]
● Contiguous Allocation: A single contiguous set of blocks is allocated to a file at
the time of file creation.
● Chained Allocation: This type of file allocation is on an individual block basis.
Each block contains a pointer to the next block in the chain.
● Indexed Allocation: The file allocation table contains a separate one level index
for each file. The index has one entry for each portion allocated to the file.

iii) What are the advantages of using directorate? [1 mark]


Directories enable files to be organized and clearly separated on the basis of
ownership, application or some other criterion. This improves the security,
integrity and avoid problem of name clashes.

Question 4 [10 marks]

a) i) Explain any scenarios where interrupts are useful. [2 marks]


● Scenario A: Suppose you have data bytes coming to the computer via the serial
port.
✔ Suppose that there are occasional pauses of unpredictable duration
in the data.
✔ You have a routine that does nothing but continually check the
serial port. This is called polling the port.
COMP3101
Operating Systems
December 2015 Past Paper

● Scenario B: Suppose your computer needs to do a particular job every


microsecond and it is rather critical that the timing be kept accurate.

ii) Mention two tasks performed by the kernel? [1 mark]


● Memory Management.
● Process Management.
● Disk and File System Management
● Networking
● Security.
● Device Drives Management.

iii) Differentiate between Micro and Monolithic kernels. [2 marks]


● Mono is everything in the kernel space. Monolithic kernels perform process
management, memory management, file I/O.
● Micro kernels performs minimal process management and others.

b) i) Explain the difference between block object-oriented devices and stream-oriented


devices? [2 marks]
● Block – Oriented Devices: These devices stores information in blocks that are
usually of fixed size, and transfers are made one block at a time. E.g. Disk and
tapes.
● Stream – Oriented Devices: These devices transfer data in and out as a stream of
bytes with no block structure. E.g. Terminals, printers, communication ports,
mouse and other printing devices.

ii) How is the logical I/O different from the device I/O? [2 marks]
● Logical I/O: Deals with the device as a logical resource and is not
concerned with the details of actually controlling the device. The logical
I/O module is concerned with managing general I/O functions on behalf of
user processes e.g. Open, close, read and write.
● Device I/O: The requested operations and data are converted into
appropriate sequences of I/O instructions, channel commands and
controller orders.

iii) How does DMA increase system concurrency? [1 mark]


DMA increases system concurrency by allowing the CPU to perform tasks while
the DMA system transfers data via the system and memory buses.

Question 5 [10 marks]


a) i) Describe the four generations of computing and how Operating Systems
developed as a result. [2 marks]
COMP3101
Operating Systems
December 2015 Past Paper

● First Generation:
✔ 1945 – 1955.

✔ No operating systems.

✔ Based on Vacuum tubes.


● Second Generation:
✔ 1955 – 1965.

✔ Had an operating system.

✔ Batch job introduced.

✔ Based on transistors.
● Third Generation:
✔ 1965 – 1980

✔ Multiprogramming and time sharing possible.

✔ Spooling possible.

✔ Based on integrated circuits.


● Fourth Generation:
✔ 1980 – Present.

✔ Start of P.C revolution, such as; ms-dos, UNIX, etc., were


developed.
✔ Based on VLST (very large system integration).

ii) List and briefly define four main elements of a computer. [2 marks]
● Processor – It controls the operations of the computer and performs its
data processing functions.
● Main Memory – It stores both data and instructions.
● I/O Modules – Moves data between the computer and its external
environment.
● System Bus – It provides for communication among processor, memory
and the I/O modules.

iii) Give the distinction between Spatial Locality and Temporal Locality. [1 mark]
COMP3101
Operating Systems
December 2015 Past Paper

● Spatial Locality: is generally exploited by using larger cache blocks and


by incorporating prefetching mechanism into the control logic.
● Temporal Locality: is exploited by keeping recently used instruction and
data values in cache memory.

b) i) What are the steps involved in a modelling process? [1 mark]


● Diagnose the problem.
● Select the relevant aspects of reality.
● Organize your facts, identify the objectives and decisions to be made.
● Select the methodology.
● Construct the model.
● Solve the model.
● Validate the model.
● Implement the solutions.
● Monitor results.

ii) Differentiate between the Deterministic and Probabilistic System. [2 marks]


● A deterministic system is one in which the occurrence of all events is known with
certainty. If the description of the system state at a particular point of time is given
the next state can be perfectly predicted.
● A probabilistic system is one in which the occurrence of events cannot be
perfectly predicted. A certain degree of error is always attached to the prediction.

iii) What is a Page Fault? A page fault is a virtual address miss which occurs when a
process makes reference to a logical page that is not in physical memory.
Or
This is when a data block cannot be located in the page table so it must be retrieved from
the disk.

b. Explain any two types of Computer Simulation. [2 marks]


● Emulation: Simulation that runs on a computer to make it appear to be something
else. Examples: JVM, NIST Net.
● Monte Carlo Simulation: This is a static simulation that has no parameter which
will continue to run until a state of equilibrium is reached. This is used to model
physical phenomena, evaluate probabilistic system and numerically estimate
complex mathematical expression.
● Trace-Driven Simulation: This uses time ordered record of events on real system
as an input.
● Discrete- Event Simulations: Continuous events are simulations like weather or
chemical reactions, while computers usually discrete events.
COMP3101
Operating Systems
December 2015 Past Paper

END OF QUESTION PAPER

You might also like