CS ZG524ES ZG524MEL ZG524 - Real Time Operating System - Comprehensive -Make Up -Answer Keys
CS ZG524ES ZG524MEL ZG524 - Real Time Operating System - Comprehensive -Make Up -Answer Keys
Note to Students:
1. Please follow all the Instructions to Candidates given on the cover page of the answer
book.
2. All parts of a question should be answered consecutively. Each answer should start
from a fresh page.
3. Assumptions made if any, should be stated clearly at the beginning of your answer.
Q.1 Draw the Finite State Machine of a telephone system. Also provide the 10
various steps and assumptions made. Marks
Steps:
1. The phone is idle and waiting for something to do.
2. You start to phone someone
3. You dial a number and start waiting for someone to answer the
remote phone 3 Marks
4. Someone answers the phone and you have a chat
5. You finish your conversation and hang up
6. If nobody answers the phone, you hang up and phone becomes idle
again
7. If there is an incoming call, then the phone starts to ring.
8. If you answer the phone, then you talk to the remote person
9. After finish talking, you hang up and the phone goes to idle state
Assumptions:
Step 1 assumes that you live alone and no one else could be on the
phone.
The algorithm assumes the existence of a working phone and active 2 Marks
service.
The algorithm assumes you are not deaf or mute.
The algorithm assumes a normal corded phone
Q.2 What is RM Scheduling? Check if the following tasks are schedulable 5 Marks
by RM scheduling algorithm T(e,d) { T1(8,4), T2(12,4) , T3(20,4)}
Solution RM scheduling is a static uniprocessor scheduling algorithm. Processor 2 Marks
utilisation increases in a monotonic manner.
RM Schedulability constraint is
∑U(tas=1 to n)< = (n* (2(1/n)-1)) 2 Marks
0.50+0.33+0.20=1.03
(3*(2(1/3)-1))= 0.77
1 Mark
Hence the task set is not schedulable by RM Algorithm.
Q.3 Determine whether the following set of periodic real time tasks is 10
schedulable on a uniprocessor using RMA. Perform all necessary tests Marks
and check the conditions and provide the conclusion.
7 Marks
Q.4 Explain Priority Ceiling Protocol with an example. 10
Marks
Example
Explanation with an Example :7
Marks
Solution Release time – the instant in time when a job becomes available for
execution
– May not be exact: Release time jitter so ri is in the interval [ri-,
ri+] – A job can be scheduled and executed at any time at, or 1*5 =5
after, its release time, provided its resource dependency Marks
conditions are met
• Response time – the length of time from the release time of the job to
the time instant when it completes
– Not the same as execution time, since may not execute
continually
• Completion time – the instant at which a job completes execution
• Relative deadline – the maximum allowable job response time
• Absolute deadline – the instant of time by which a job is required to be
completed (often called simply the deadline)
– absolute deadline = release time + relative deadline
– Feasible interval for a job Ji is the interval (ri, di]
Q.6 The feasible interval of each job in the precedence graph in Figure.The 10
execution times of all jobs is equal to 1. Marks
a. Find the effective release times and deadlines of the jobs in the
precedence graph
b. Find an EDF schedule of the jobs
Solution
7 Marks
3 Marks