real time operating systems
play

Real-Time Operating Systems VxWorks in particular T.B. Skaali, - PowerPoint PPT Presentation

FYS 4220/9220 2012 / #3 Real Time and Embedded Data Systems and Computing Real-Time Operating Systems VxWorks in particular T.B. Skaali, Department of Physics, University of Oslo) What is a Real-Time Operating System (RTOS)? In


  1. FYS 4220/9220 – 2012 / #3 Real Time and Embedded Data Systems and Computing Real-Time Operating Systems VxWorks in particular T.B. Skaali, Department of Physics, University of Oslo)

  2. What is a Real-Time Operating System (RTOS)? • In general, an operating system (OS) is responsible for managing the hardware resources of a computer and hosting applications that run on the computer. An RTOS performs these tasks, but is also specially designed to run applications with very precise timing and a high degree of reliability. This can be especially important in measurement and automation systems where downtime is costly or a program delay could cause a safety hazard. • To be considered "real-time", an operating system must have a known maximum time for each of the critical operations that it performs (or at least be able to guarantee that maximum most of the time). Some of these operations include OS calls and interrupt handling. Operating systems that can absolutely guarantee a maximum time for these operations are commonly referred to as "hard real-time", while operating systems that can only guarantee a maximum most of the time are referred to as "soft real-time ”. Text borrowed from http://www.ni.com/white-paper/3938/en . Full white paper on file «2012-3_National_Instrument_RTOS_white_paper.pdf» FYS4220/9220 - 2012 - Lecture #3 2 T.B. Skaali, Department of Physics, University of Oslo

  3. The holy grail of RTOS’s: correct timing: • If programmed correctly (!!), an RTOS can guarantee that a program will run with very consistent timing. Real-time operating systems do this by providing programmers with a high degree of control over how tasks are prioritized, and typically also allow checking to make sure that important deadlines are met. An example: the release of a car’s airbag • In contrast to real-time operating systems, the most popular operating systems for personal computer use (such as Windows) are called general-purpose operating systems. While more in-depth technical information on how real-time operating systems differ from general- purpose operating systems is given in a section below, it is important to remember that there are advantages and disadvantages to both types of OS. Operating systems like Windows are designed to maintain user responsiveness with many programs and services running (ensuring "fairness"), while real-time operating systems are designed to run critical applications reliably and with precise timing (paying attention to the programmer's priorities). FYS4220/9220 - 2012 - Lecture #3 3 T.B. Skaali, Department of Physics, University of Oslo

  4. RTOS: Important Terminology and Concepts • Determinism: An application (or critical piece of an application) that runs on a hard real-time operating system is referred to as deterministic if its timing can be guaranteed within a certain margin of error. • Soft vs Hard Real-Time: An OS that can absolutely guarantee a maximum time for the operations it performs is referred to as hard real- time. In contrast, an OS that can usually perform operations in a certain time is referred to as soft real-time. • Jitter: The amount of error in the timing of a task over subsequent iterations of a program or loop is referred to as jitter. Real-time operating systems are optimized to provide a low amount of jitter when programmed correctly; a task will take very close to the same amount of time to execute each time it is run. FYS4220/9220 - 2012 - Lecture #3 4 T.B. Skaali, Department of Physics, University of Oslo

  5. RTOS: Jitter in a control loop FYS4220/9220 - 2012 - Lecture #3 5 T.B. Skaali, Department of Physics, University of Oslo

  6. RTOS: setting Priorities (1) • When programming an application, most operating systems (of any type) allow the programmer to specify a priority for the overall application and even for different tasks within the application (threads). These priorities serve as a signal to the OS, dictating which operations the designer feels are most important. The goal is that if two or more tasks are ready to run at the same time, the OS will run the task with the higher priority. • In practice, general-purpose operating systems do not always follow these programmed priorities strictly. Because general-purpose operating systems are optimized to run a variety of applications and processes simultaneously, they typically work to make sure that all tasks receive at least some processing time. As a result, low-priority tasks may in some cases have their priority boosted above other higher priority tasks. This ensures some amount of run-time for each task, but means that the designer's wishes are not always followed. FYS4220/9220 - 2012 - Lecture #3 6 T.B. Skaali, Department of Physics, University of Oslo

  7. RTOS: setting Priorities (2) • In contrast to (GPOS), real-time operating systems follow the programmer's priorities much more strictly. On most real-time operating systems, if a high priority task is using 100% of the processor, no other lower priority tasks will run until the high priority task finishes. Therefore, real-time system designers must program their applications carefully with priorities in mind. • In a typical real-time application, a designer will place time-critical code (e.g. event response or control code) in one section with a very high priority. Other less-important code such as logging to disk or network communication may be combined in a section with a lower priority. FYS4220/9220 - 2012 - Lecture #3 7 T.B. Skaali, Department of Physics, University of Oslo

  8. RTOS: Interrupt Latency • Interrupt latency is measured as the amount of time between when a device generates an interrupt and when that device is serviced. While general-purpose operating systems may take a variable amount of time to respond to a given interrupt, real-time operating systems must guarantee that all interrupts will be serviced within a certain maximum amount of time. In other words, the interrupt latency of real-time operating systems must be bounded. • The latency comprises two deterministic components and at least two non-deterministic: • Deterministic: – Hardware switching and entering the Interrupt handler – Execution of handler code. While the execution time depends on the number of instructions, the time in a specific handler is constant (if it is not interrupted!) • Non-deterministic – An interrupt will not be served is i) the interrupt system is disabled (permitted by a RTOS) or ii) during servicing of an interrupt with higher hardware priority. FYS4220/9220 - 2012 - Lecture #3 8 T.B. Skaali, Department of Physics, University of Oslo

  9. RTOS: Performance • One common misconception is that real-time operating systems have better performance than other general-purpose operating systems. While real-time operating systems may provide better performance in some cases due to less multitasking between applications and services, this is not a rule. Actual application performance will depend on CPU speed, memory architecture, program characteristics, and more. • Though real-time operating systems may or may not increase the speed of execution, they can provide much more precise and predictable timing characteristics than general-purpose operating systems. FYS4220/9220 - 2012 - Lecture #3 9 T.B. Skaali, Department of Physics, University of Oslo

  10. School of Informatics, University of Edinburgh. Prof. Michael O’Boyle, director of Institute for Computing Systems 10 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  11. 11 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  12. 12 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  13. 13 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  14. 14 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  15. 15 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  16. 16 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  17. Additional wish-list for RTOS’s • The possibility of building user specific RT kernels to match the wide range of processing machines for RT/Embedded, from microcontrollers and soft core processors to large distributed systems • Quality assured • An excellent Development Environment • Debugging and test tools • RTOS support of that particular computer architecture you want to use – See following pages • Portability, that is, POSIX compliant • And of course, ”at the end of the day”, the price is important! FYS4220/9220 - 2012 - Lecture #3 17 T.B. Skaali, Department of Physics, University of Oslo

  18. 18 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

  19. Real-Time OS for the ARM architecture 19 FYS4220/9220 - 2012 - Lecture #3 T.B. Skaali, Department of Physics, University of Oslo

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend