AK - Wase 2016 - RTOS - Mid Makeup
AK - Wase 2016 - RTOS - Mid Makeup
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:
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 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]
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:
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
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.
System: Event driven or activity oriented. It is hard real time system and closed loop model.
Hyper-period – 20.
Maximum Flow – 13.