Tentamen vid Institutionen för Datavetenskap, Linköpings universitet TENTAMEN TDDB47 Realtidssystem (Real-time Systems) Date: 13th of December 2007 Time: 14-18 Room: TER1 Contact Teachers: Mikael Asplund (Tel: 282668, 0707-481462) Material: English-Swedish-English dictionary Calculator Total: 40 points Assessment: F, 3, 4 and 5: Fail: 3: 4: 5: 20 27 34 - 19 p 26p 33 p 40 p INSTRUCTIONS: Write your name, class and personal number (personnummer) on each sheet of paper that you hand in. Further, pages should only contain one answer per page (answers to sub-questions can be on the same page). You are asked to only answer on the front page of the paper. Sort all the sheets that you hand in with respect to the number of the question. Make sure your answers are presented clearly and precisely. Points will not be given to answers that cannot be read due to bad handwriting. Your answers may be in Swedish or English. Your answers shall clearly show the method for the solution. A correct answer without any explanation will not be given any credits (figures can be of help when describing but should be accompanied by a text description). In those cases where you are in doubt about the question, write down your interpretation and assumptions, and answer the question based on the interpretation. Note, a correct answer embedded in errors may give reduction in points, so make sure your answers are to the point. Good luck!!! Mikael Asplund Examiner for TDDB47 Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Q1: Scheduling (15p) Suppose that you are given the task of designing the software for an unmanned aerial vehicle (UAV) which is to be controlled from the ground. There are four periodic tasks in your particular part of the system: 1) a process to collect radar data, 2) a control loop to regulate the airplane, 3) a communication process to interact with the rest of the system 3) a sensor process to collect data such as air speed, altitude etc. The tasks have the following timeliness specifications: Task Radar (R) Flight control (F) Communication (C) Sensor (S) a) Period (ms) 40 60 120 60 WCET (ms) 5 20 30 5 Assuming you want to construct a cyclic scheduler, compute the minor and major cycle of this task set. What are the major and minor cycles and why are they computed like this? (3 points) b) Assuming rate monotonic (RM) scheduling, will this task set be schedulable according to the utilization schedulability test? What are the assumptions on the task set that the schedulability analysis for RM requires? (3 points) c) Take the same task set and do a response time analysis. Will the set be schedulable according to this test? (3 points) d) During the design of the system it is realized that the system must be able to respond to requests from other airplanes regarding its position. These requests are sporadic, they must be replied to within 30ms and it takes 3ms to complete the request. Provide a solution and find the minimum arrival time that can be tolerated using your solution. (3 points) e) Compare the benefits and drawbacks of using priority inheritance, OCPP and ICPP respectively to avoid priority inversion. (3 points) Q2: Dependability and fault tolerance (6p) a) Explain the difference between availability and reliability. (2 points) b) Explain what a fault model is and why it is needed. State three different fault models and describe them shortly. (3 points) c) Explain the concept of triple modular redundancy (TMR). (1 point) Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Q3: Design (5p) a) Name three techniques that can be done during the design phase to ensure that the non-functional properties of a system are according to specification? (2 points) b) Argue (shortly) for or against the following statements: 1. The best way to get the worst case execution time of a task is to actually measure it. 2. Design of real-time systems is no different from normal system design. 3. Formal verification can be very time-consuming. (3 points) Q4: Distributed systems & Real-time communication (8p) a) Compare the synchronous and asynchronous system models. What are their respective definitions and what are their benefits and drawbacks? (3 points) b) How many clocks are needed to maintain internal synchronization provided that there are 2 malicious clocks? (1 point) c) Is it a good idea to use time-stamps from physical clocks to order messages in a distributed system? Is there an alternative? (2 points) d) What is the approach that TTA uses to cope with byzantine node failures? (2 points) Q5: Operating systems and real-time databases (6p) a) What are the two main ways of interacting with hardware devices? What are the consequences for real-time systems? (2 points) b) In what way is memory management different in a real-time OS compared to a standard general purpose OS? (2 points) c) Compare optimistic and pessimistic concurrency control in databases (don't forget the real-time perspective). (2 points) Tentamen vid Institutionen för Datavetenskap, Linköpings universitet Notation for Tasks/Processes • C - Worst-case-execution time of the task • B - Worst-case blocking time • n - Number of tasks in the system • T - Minimum inter-arrival time (period) of task • R - Worst-case response time of the task Utilisation-based schedulability test for Rate Monotonic: n ∑ i=1 n 1 2 3 4 5 Ci Ti ≤n 21/n−1 . Utilisation bound 100% 82.8% 78.0% 75.7% 74.3% Response time analysis Ri =C i Bi • • w n1 i ∑ ∀ j ∈hp i ⌈ ⌉ Ri Cj Tj Where hp(i) contains the tasks that have a higher priority than task i Solved using recurring equations: =C i Bi ∑ ∀ j ∈hp i ⌈ ⌉ w ni Cj Tj