0% found this document useful (0 votes)
12 views

ICS 2202 - Operating systems concepts - December 2023

Uploaded by

p.githinji.atl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

ICS 2202 - Operating systems concepts - December 2023

Uploaded by

p.githinji.atl
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SCHOOL COMPUTING AND ENGINEERING SCIENCES

INFORMATICS AND COMPUTER SCIENCE (ICS)


END OF SEMESTER EXAMINATION
ICS 2202: OPERATING SYSTEMS CONCEPTS
DATE: 15th December 2023 Time: 13:00-15:00 Hours

Instructions
1. This examination consists of FIVE questions.
2. Answer Question ONE (COMPULSORY) and any other TWO questions.
Question 1 (30 Marks)
i. Under what circumstances would a user be better off using a time-sharing system, rather
than a personal computer or single-user workstation? (2 Marks)
ii. Describe the differences between symmetric and asymmetric multiprocessing. What are
three advantages and one disadvantage of multiprocessor systems? (4 Marks)
iii. When are caches useful? What problems do they solve? What problems do they cause? If
a cache can be made as large as the device for which it is caching (for instance, a cache as
large as a disk), why not make it that large and eliminate the device? (4 Marks)
iv. How can we prevent users from accessing other users’ programs and data? (2 Marks)
v. What are the five major activities of an operating system in regard to process management?
(5 Marks)
vi. Describe the differences among short-term, medium-term, and long-term scheduling.
(6 Marks)
vii. What two advantages do threads have over multiple processes? What major disadvantage
do they have? Suggest one application that would benefit from the use of threads, and one
that would not. (4 Marks)
viii. Explain the differences in the degree to which the following scheduling algorithms
discriminate in favor of short processes: (3 Marks)
a. FCFS
b. RR
c. Multilevel feedback queues
Question 2 (15 Marks)
i) Consider the following preemptive priority-scheduling algorithm based on dynamically
changing priorities. Larger priority numbers imply higher priority. When a process is
waiting for the CPU (in the ready queue, but not running), its priority changes at a rate
α; when it is running, its priority changes at a rate β. All processes are given a priority
of 0 when they enter the ready queue. The parameters α and β can be set to give many
different scheduling algorithms.
a. Determine the algorithm that results from β > α>0? (4 Marks)
b. Determine the algorithm that results from α < β <0? (4 Marks)

ii) Consider three process, all arriving at time zero, with total execution time of 10, 20
and 30 units respectively. Each process spends the first 20% of execution time doing
I/O, the next 70% of time doing computation, and the last 10% of time doing I/O again.
The operating system uses a shortest remaining compute time first scheduling
algorithm and schedules a new process either when the running process gets blocked
on I/O or when the running process finishes its compute burst. Assume that all I/O
operations can be overlapped as much as possible. For what percentage does the CPU
remain idle? (7 Marks)

Processes Total Burst I/O Burst CPU Burst I/O Burst


Time
P1 10 2 7 1
P2 20 4 14 2
P3 30 6 21 3

Question 3 (15 Marks)


i) Consider the following segment table: (Each 2 Marks)
Segment Base Length
0 219 600
1 2300 14
2 90 100
3 1327 580
4 1952 96
What are the physical addresses for the following logical addresses?
a. 0,430
b. 1,10
c. 2,500
d. 3,400
e. 4,112

ii) Consider a paging system with the page table stored in memory.
a. If a memory reference takes 200 nanoseconds, how long does a paged memory reference
take? (2 Marks)
b. If we add associative registers, and 75 percent of all page-table references are found in
the associative registers, what is the effective memory reference time? (Assume that
finding a page-table entry in the associative registers takes zero time, if the entry is there.)
(3 Marks)

Question 4(15 Marks)


i) Consider a computer system that runs 5000 jobs per month with no deadlock-
prevention or deadlock-avoidance scheme. Deadlocks occur about twice per month,
and the operator must terminate and rerun about 10 jobs per deadlock. Each job is worth
about $2 (in CPU time), and the jobs terminated tend to be about half-done when they
are aborted. A systems programmer has estimated that a deadlock-avoidance algorithm
(such as the banker’s algorithm) could be installed in the system with an increase in the
average execution time per job of about 10 percent. Since the machine currently has
30-percent idle time, all 5000 jobs per month could still be run, although turnaround
time would increase by about 20 percent on average.
a. What are the arguments for installing the deadlock-avoidance algorithm? (3 Marks)
b. What are the arguments against installing the deadlock-avoidance algorithm?
(3 Marks)
ii) A resource allocation system that uses the Banker’s algorithm for 3 resource types (A,
B, C) and 5 users (P0, P1, P2, P3 P4) is currently in the following state. (Alloc:
resources held by each user. Max: max need of each user. Avail: free resources.)
Allocation Max Required Available
A B C A B C A B C
P0 0 1 0 7 5 3 3 3 2
P1 2 0 0 3 2 2
P2 3 0 2 9 0 2
P3 2 1 1 2 2 2
P4 0 0 2 4 3 3

a) Determine the contents of the Need Matrix of the Bankers Snapshot above (3 Marks)
b) Comment whether the state of the snapshot is safe or unsafe. If you answer yes, give a
sequence of process ids that leads to all processes completed. If you answer no, give a
sequence of activities that results in a deadlocked state. (6 Marks)

Question 5 (15 Marks)


i) A certain computer provides its users with a virtual-memory space of 232 bytes. The
computer has 218 bytes of physical memory. The virtual memory is implemented by
paging, and the page size is 4096 bytes. A user process generates the virtual address
11123456.
Explain how the system establishes the corresponding physical location. Distinguish
between software and hardware operations. (4 Marks)
ii) An operating system supports a paged virtual memory, using a central processor with
a cycle time of 1 microsecond. It costs an additional 1 microsecond to access a page
other than the current one. Pages have 1000 words, and the paging device is a drum
that rotates at 3000 revolutions per minute, and transfers 1 million words per second.
The following statistical measurements were obtained from the system:
 1 percent of all instructions executed accessed a page other than the current page.
 Of the instructions that accessed another page, 80 percent accessed a page already
in memory.
 When a new page was required, the replaced page was modified 50 percent of the
time.
Calculate the effective instruction time on this system, assuming that the system is
running one process only, and that the processor is idle during drum transfers. (5 Marks)

iii) Consider the following page reference string:


1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6.
How many page faults would occur for the following replacement algorithms,
assuming one, two, three, four, five, six, or seven frames? Remember all frames are initially
empty, so your first unique pages will all cost one fault each.
o LRU replacement (3 Marks)
o FIFO replacement (3 Marks)
o Optimal replacement (3 Marks)

You might also like