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

AK - Wase 2016 - RTOS - Mid Makeup

This document contains an answer key for a mid-semester examination on real-time operating systems. It includes solutions to 7 questions about real-time concepts and scheduling algorithms. Question 1 involves designing a Raspberry Pi robot system for smart irrigation and identifying critical, non-critical, and exceptional tasks. Question 2 explains frame size constraints for scheduling periodic tasks and generates a schedule. Question 3 defines release time, response time, completion time, relative deadline, and absolute deadline. The remaining questions involve scheduling problems, designing a smart hospital system, and calculating hyper-period and maximum flow for a set of periodic tasks.

Uploaded by

neetika gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

AK - Wase 2016 - RTOS - Mid Makeup

This document contains an answer key for a mid-semester examination on real-time operating systems. It includes solutions to 7 questions about real-time concepts and scheduling algorithms. Question 1 involves designing a Raspberry Pi robot system for smart irrigation and identifying critical, non-critical, and exceptional tasks. Question 2 explains frame size constraints for scheduling periodic tasks and generates a schedule. Question 3 defines release time, response time, completion time, relative deadline, and absolute deadline. The remaining questions involve scheduling problems, designing a smart hospital system, and calculating hyper-period and maximum flow for a set of periodic tasks.

Uploaded by

neetika gupta
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Birla Institute of Technology & Science, Pilani

Work Integrated Learning Programmes Division


M. Tech. Software Engineering at Wipro Technologies (WASE)
Second Semester 2018– 2019
Mid Semester Examination (Makeup)_Answer Key
Course Number : SEWP ZG524
Course Title : Real Time Operating Systems No. of Pages: 5
Type of Exam : Closed Book No. of Questions: 7
Weightage : 30 %
Duration : 90 minutes
Date of Exam : 21/09/2019 Session: FN

1. Construct a Raspberry Pi Model Robot System for smart irrigation management


system. It should handle all exceptions for smart water management. Identify the tasks
and subtasks in the above process (Critical / non-critical / exceptional). Develop the
python script for the same. Draw a block diagram of the model illustrating the
components that would be used. Identify the scheduling algorithm which would be
effective in tasks modelling and schedule the tasks. 5M

Solution:

Critical Task :
sensor signal for soil, moisture and water level monitoring, switching the pump on to irrigate,
Power supply to the device, Alert signals to concern person,Performance monitoring
Non Critical Task: log files

Major Functions:

Design for the sensors,


Designing the sensor node
Design of the remote server

Clock driven scheduling algorithm.

Sensor and Wireless


Actuatore Communicati
unit Processing and memory unit on unit

Power
management
unit
2. Explain Frame Size Constraints? The systems of periodic tasks is scheduled and executed
according to a cyclic schedule. For each system, choose an appropriate frame size.
Preemptions are allowed, but the number of preemptions should be kept small. Generate
a graphical representation of tasks (7, 5, 1, 5), (9, 1), (12, 3), and (0.5, 23, 7, 21). 5M
Frame Size Constraints:
The frame size f larger than the execution time ei of every task Ti
f ≥ 1 ≤imax
≤n( i )
e
The frame size f should be chosen so that it divides H, the length of the hyperperiod of
the system. This condition is met when f divides the period pi of at least one task Ti
⌊ p i /f ⌋− pi / f =0

The suitable range of f for a task Ti = (pi, ei, Di).


2 f −gcd ( pi , f ) ≤ D i
to choose a frame size that is equal to or smaller than Di. The condition f ≤ Di is satisfied
for all values of f.
These three equations are called the frame-size constraints.

The frame size has to meet all three criteria discussed in the chapter.
1.f ≥ max(ei), 1 ≤ i ≤ n
f≥7
The smallest period is 5, which is less than the longest execution time. We cannot have a
frame size larger than the period, so at this point we know we have to split the (0.5, 23, 7,
21) task. Splitting it into two tasks does not work (try it, to see). Split the long task into
three (0.5, 23, 3, 21), (0.5, 23, 3, 21), and (0.5, 23, 2, 21)
f≥ 3
2.f divides at least one of the periods evenly:
f ∈ {1, 2, 3, 4, 5, 6, 9, 12, 23}
3.2f - gdc(f, pi) ≤ Di, 1 ≤ i ≤ n
f=3
2 × 3 - gcd(3, 5) = 6 - 1 = 5 ≤ 5
2 × 3 - gcd(3, 9) = 6 - 3 = 3 ≤ 9
2 × 3 - gcd(3, 12) = 6 - 3 = 3 ≤ 12
2 × 3 - gcd(3, 23) = 6 - 1 = 5 ≤ 21
f=4
2 × 4 - gcd(4, 5) = 8 - 1 = 7 > 5
f=5
2 × 5 - gcd(5, 5) = 10 - 5 = 5 ≤ 5
2 × 5 - gcd(5, 9) = 10 - 1 = 9 ≤ 9
2 × 5 - gcd(5, 12) = 10 - 1 = 9 ≤ 12
2 × 5 - gcd(5, 23) = 10 - 1 = 9 ≤ 21
Either f = 3 or f = 5 may work, assuming the last two tasks are split as described above. We need
to make a schedule to verify the tasks can be scheduled with those frame sizes.
3. Define the following terms: 5M
a) Release time
b) Response time
c) Completion time
d) Relative deadline
e) Absolute deadline
• 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 after, its release time, provided its resource
dependency 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]

4. Consider the precedence graph.

a) Find the EDF Solution for the jobs with given (Ri, Di) if the execution time is considered
as 1 for all jobs. 2M
Sol:

b) Find the effective release time of Job JF 1M

Sol: The E.R.T of Job JF is 4

5. Using stack stealing approach, schedule the given Aperiodic jobs along with period jobs:
jobs release execution
A1 2.8 1.7
A2 5.5 2.5 2M

jobs release execution deadline


Sol:
T1 2.0 1.5 3.5
T2 0 0.5 6.5

6. Design a Raspberry Pi based system for a smart hospital in the absence of doctors to
carry out surgeries. Highlight the tasks associated. Identify the nature and type of real
time system. Which algorithm would be suitable in such a scenario and explain the same
with an example. 5M

Solution:
Tasks:
Critical: Oxygen supply, Anaesthesia level, Power supply, Ventilator operation.

Exceptional: Action when BP is high, Seizure attack etc.

System: Event driven or activity oriented. It is hard real time system and closed loop model.

Algorithm:IRIS( Increased Reward with Increased Service)


7. Let us consider a real time system has three periodic Task (T1, T2, and T3). The first task
T1 is appearing in the system with a periodicity(p) 20 and every time it required 3 unit of
execution time(e). The second task T2 have phase (ø)value 4 and periodicity (p) 8. This
task T2 have execution time (e) 1. The last task T3 have a relative deadline (D) 7. The T3
also has a periodicity (p) 5and execution time (e) 2. Draw a Network Flow Graph and
calculate the Hyper-period and the Maximum Flow of the network. 5M

Hyper-period – 20.
Maximum Flow – 13.

You might also like