Professional Documents
Culture Documents
IBRAHIMBAGH, HYDERABAD-31
Department of Computer Science and Engineering
Name of the Course: Operating Systems
Assignment – 1
Set -1 (1602-21-733-096,102,121,100,084,090,076,073,119,128)
Q. No. Description of the question Marks BTL Mapped
(1/2/3/4/5/6) CO PO
Add a new system call which helps applications to know
1 schedule of a given process. This task requires to understand 1 3 1 1,2,3
system call invocation mechanism as well as steps of compil-
ing and installing Linux kernel. Submit the Executable code
with proper documentation.
Original versions of Apple’s mobile iOS operating system 2 3 1 1,2,3
provided no means of concurrent processing. Discuss three
2
major complications that concurrent processing adds to an
operating system
Consider the 7-state transition diagram. Suppose that it is 1 3 1 1,2,3
time for the OS to dispatch a process and there are processes
in both the Ready state and the Suspend-Ready state, and that
at least one process in the Suspend Ready state has higher
scheduling priority than any of the processes in the Ready
3 state. Two extreme policies are as follows: 1. Always dis-
patch from a process in the Ready state, to minimize swap-
ping and 2. Always give preference to highest-priority pro-
cess, even though that may mean swapping when swapping
is not necessary. Suggest an intermediate policy that tries to
balance the concerns of priority and performance.
Given a system using the SJF algorithm for short term 1 3 1 1,2,3
scheduling and exponential averaging with α=0.5, what
4 would be next-expected burst time for a process with
burst times of 5,8,3 and 5 and an initial value of T1=10?
Set-4 (1602-21-733-082,83,86,87,88,89,310)
Q. No. Description of the question Marks BTL Mapped
(1/2/3/4/5 CO PO
/6)
Suppose that the following processes arrive for exe- 1 3 1 1,2
cution at the times indicated. Each process will run
for the amount of time listed. In answering the ques-
tions, use nonpreemptive 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?
1
b. What is the average turnaround time for these
processes with the SJF scheduling algorithm?
c. The SJF algorithm is supposed to improve per-
formance, but notice that we chose to run process P1
at time 0 because we did not know CPU Scheduling
that two shorter processes would arrive soon. Com-
pute 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.
What is the output of the following program for any 1 3 1 1,2
value of a
int main()
{
int a, pid;
pid = fork();
if(pid == 0)
{
a=a+5;
2
printf("u = %d\n",a);
}
else
{
a=a-5;
printf("x = %d\n",a);
}
Set-5 (1602-21-733-091,92,93,94,95,97,311)
Q. Description of the question Marks BTL Mapped
No. (1/2/3/4/5/6) CO PO
Estimate the largest possible value of context switch 2 3 1 1,2
time an OS can support in order for multiprogram-
1 ming to be useful. Justify your estimate.
Set-6 (1602-21-733-098,99,101,103,104,105,312)
----------------------------------------------
----------------------------------------------
P1 0 5
4
P2 1 7
P3 3 4
----------------------------------------------
Set-7(1602-21-733-106,107,108,109,110,111,313)
(3) printf(“%s”,str)
fork();
4 fork();
what is the total number of child processes
created?Justify.
Set-8 (1602-21-733-112,113,114,115,116,117,314)
Q. No. Description of the question Marks BTL Mapped
(1/2/3/4/5/6) CO PO
Determine the scheduling policy is most suitable for 1 3 1 1,2,3
time sharing operating systems? Justify your answer
1 with an example.
P2 10 8
P3 8 9
P4 4 0
Set-9 (1602-21-733-118,120,122,123,124,125,315)
Q. Description of the question Mark BTL Mapped
No. s (1/2/3/4/5/6) CO PO
Once the operating system decides, for whatever reason, 1 3 1 1,2,3
1 to create a new process, it proceeds the steps:
a. Process : Contains
code+data+heap+stack+process state
Explain the role of the init process on UNIX and Linux 1 3 1 1,2,3
4 systems in regard to process termination.
Set-10 (1602-21-733-126,127,129,130,131,132,133,134)
Q. Description of the question Mark BTL Mapped
No. s (1/2/3/4/5/6) CO PO
Many CPU-scheduling algorithms are parameterized. For 1 3 1 1,2,3
example, the RR algorithm requires a parameter to indi-
1
cate the time slice. Multilevel feedback queues require
parameters to define the number of queues, the schedul-
ing algorithms for each queue, the criteria used to move
processes between queues, and so on. These algorithms
are thus really sets of algorithms (for example, the set of
RR algorithms for all time slices, and so on). One set of
algorithms may include another (for example, the FCFS
algorithm is the RR algorithm with an infinite time quan-
tum). What (if any) relation holds between the following
pairs of algorithm sets? a. Priority and SJF b. Multilevel
feedback queues and FCFS c. Priority and FCFS d. RR
and SJF
Suppose that a scheduling algorithm (at the level of short- 2 3 1 1,2,3
term CPU scheduling) favors those processes that have
2 used the least processor time in the recent past. Why will
this algorithm favor I/O-bound programs and yet not
permanently starve CPU-bound programs?
The traditional UNIX scheduler enforces an inverse rela- 1 3 1 1,2,3
tionship between priority numbers and priorities: the
higher the number, the lower the priority. The scheduler
recalculates process priorities once per second using the
following function: Priority = (recent CPU usage / 2) +
base where base = 60 and recent CPU usage refers to a
value indicating how often a process has used the CPU
3
since priorities were last recalculated. Assume that recent
CPU usage for process P1 is 40, for process P2 is 18, and
for process P3 is 10. What will be the new priorities for
these three processes when priorities are recalculated?
Based on this information, does the traditional UNIX
scheduler raise or lower the relative priority of a CPU-
bound process?
Suppose that the following processes arrive for execution 1 3 1 1,2,3
at the times indicated. Each process will run for the
amount of time listed. In answering the questions, use
nonpreemptive scheduling, and base all decisions on the
4 information you have at the time the decision must be
made.
Process Arrival Time Burst Time
P1 0.0 10
P2 0.4 4
P3 1.0 2
a. What is the average turnaround time for these process-
es with the FCFS scheduling algorithm?
b. What is the average turnaround time for these process-
es with the SJF scheduling algorithm?
c. The SJF algorithm is supposed to improve perfor-
mance, but notice that we chose to run process P1 at time
0 because we did not know CPU Scheduling 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. Remem-
ber 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.