Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Department of Computer Science CSC-320:Operating System

Bahria University Karachi Campus Semester 04 (FALL 2021)

ASSIGNMENT 01
Marks: 05
(CLO1=3+CLO2=2)

NAME: ______________________________________________
REG. NO. ____________________________________________

Read Carefully:
• The deadline for this assignment is before Thursday 07/11/2021.

WARNING: This is an individual assignment; you must solve it by yourself. Any form of
plagiarism will result in receiving zero in the assignment.

WARNING: Late submission will not be accepted. Any assignment submitted after the cutoff
time will receive zero.

• Submit SOFTCOPY on LMS in pdf format


Department of Computer Science CSC-320:Operating System
Bahria University Karachi Campus Semester 04 (FALL 2021)

Q1. Consider that initially no system resources are being used except for the processor. Now
consider the following events on given time stamps: (CLO2: Marks 2)
Time 5: P1 executes a command to read from disk unit 3.
Time 15: P5’s time slice expires.
Time 18: P7 executes a command to write to disk unit 3.
Time 20: P3 executes a command to read from disk unit 2.
Time 24: P5 executes a command to write to disk unit 3.
Time 28: P5 is swapped out.
Time 33: An interrupt occurs from disk unit 2: P3’s read is complete.
Time 36: An interrupt occurs from disk unit 3: P1’s read is complete.
Time 38: P8 terminates.
Time 40: An interrupt occurs from disk unit 3: P5’s write is complete.
Time 44: P5 is swapped back in.
Time 48: An interrupt occurs from disk unit 3: P7’s write is complete.
For each time 20, 36, and 48, Identify which state each process is in. If a process is
blocked, further identify the event on which it is blocked.

At time 20: P1, P7, P3 is blocked, P5 in ready state, P8 may be running


At time 36: P5 blocked suspend, P3 and P1 ready state, P7 blocked, P8 may be running
At time 48: P8 exit, P5 ready, P3, P1, P7 are in ready state.

Q2. Explain the structure of Android operating system. (CLO1: Marks 1)


Q3. Explain under what circumstances would a user be better off using a time-sharing system
than a PC or a single-user workstation? (CLO1: Marks 1)

When there are few other users, the task is large, and the hardware is fast, time-sharing makes
sense. The full power of the system can be brought to bear on the user’s problem. The problem
can be solved faster than on a personal computer. Another case occurs when lots of other users
need resources at the same time. A personal computer is best when the job is small enough to be
executed reasonably on it and when performance is sufficient to execute the program to the
user’s satisfaction.

Q4. Compare the given figures and explain which have better CPU utilization. Also explain the
role of interrupts in CPU utilization. (CLO1: Marks 1)
Department of Computer Science CSC-320:Operating System
Bahria University Karachi Campus Semester 04 (FALL 2021)

Ans: The uni-programming approach means executing each process one by one. It
results in time wasted by the processor since the processor waits until Program A is fully
complete before moving on to Program B.
Multiprogramming, on the other hand, is incredibly efficient when it comes to utilizing
time and eliminating processor idling. This is possible since in multiprogramming, the
processes are being executed simultaneously. As a result of this characteristic, no time is
being wasted by the processor in being idle or waiting for other processes to be
completed.

You might also like