You are on page 1of 10

1. INTRODUCTION TO REAL-TIME OPERATING SYSTEMS.

1.1 What is a Real-Time Operating System (RTOS)?


A Real time operating system is an operating system that handles processes in real time by processing data with minimum latency this allows greater use of systems with multiple processors. These operating systems are commercially available but are often created in house for a specific purpose for example. A process within a real time operating system will have a deadline associated with it as the deadline runs closer the priority of the process will increase so that the deadline is achieved [3]. There are a number challenges to be overcome when a real time operating system is being created that time sharing does not have. Scheduling in a RTOS can be more problematic as the operating system will have to respond to events real time with minimum latency[2]. Since this can increase the likelihood of an error RTOSs contain two types of time system hard time system and soft time system. hard time systems are used for critically important processes, for example an auto-pilot system for an aircraft would use a hard time system because if a deadline is missed the program will not work and can have a fatal effect. soft time management is used for processes that are desired but the deadline can be missed. A Real time operating system also contains aperiodic tasks and aperiodic tasks. a task that has a deadline for when it will start or stop is an aperiodic task and a task that will be run regularly per period or per time from last it was processed will be a periodic task[13]. Often real time operating systems are used in systems where there are multiple processors as an rtos can get better performance compared to a general purpose operating system.

1.2 Do I need a Real-Time Operating System (RTOS)?


An RTOS should be used in cases where processes need to be processed quickly and in cases where multitasking need to be achieved by threads. a RTOS should be used if the user wishes precise timing for how long a

Daryl Johnston

B00535063

process takes to process as the system is not allowed to delay hard-time process. processes can be given a worst-case time which states how long the process can be delayed before it must be completed a hard process will be given a worst case time of very little more than the average time it takes to complete a process where as a soft process will be given a much larger worst-case time since the process is not essential and will be allowed to exceed its deadline[4].

1.3 How do RTOSs differ from General Purpose Operating Systems (GPOSs)?
in a general purpose operating system processes are given more flexibility to be completed as there can be many more process to be completed than there is processors for example there may be a web browser, word document and the GUI elements running on the one processor, a process could be interrupted by another process for example an antivirus may interrupt a running process to perform a scan. in a real time operating system there is a much larger emphasis on the timing of all of the processes. in a general purpose operating system there is no control or measurement over how long a process will take only the ability to prioritise the processes in the amount of time a process is given access to the processor but all of the processors can be interrupted by another process for example an antivirus program. for systems that need to run a certain rate without interruption this delay can cause system failure[4]. this is why a general purpose operating system should not be used in safety-critical software such as auto-pilot software. in cases where the timing is important a RTOS is used as in most cases the system will handle only one purpose[5] removing the problem of processes being interrupted.

Daryl Johnston

B00535063

a real time system is deterministic in that it will use algorithms to predetermine when a task will be processed, in a general purpose operating system the tasks will more likely to be treated more fairly by using algorithms that use time slicing which gives each task that is to be completed a fair and even amount of cpu time. a real time operating system allows for much more user control. in a general purpose operating system the user would only be able to provide very general guidance by being able to change priorities of groups or no guidance at all on how the system would be scheduled. In a real time operating system it is much more important to give the user control over scheduling to maintain good performance. for example the user may be able to set a task as a hard task or a soft task and make changes to the priorities within a class. it is much more important in a real time operating system that it is reliable compared to a general purpose operating system as GPOSs can in most cases be resolved by a system reboot. a problem in a RTOS can result in the loss of performance until the problem is fixed but since the system is responding to events in real time this loss of performance can have a catastrophic effect if the system is used in a safety critical device. Real time operating systems can also have a Fail-Soft operation which is a characteristic that refers to the system being able to fail and preserve as much of the capability and performance as possible.[13]

2.0 EXAMPLE APPLICATIONS.


2.1 The Butterfly System
The butterfly is a multiprocessor system that was developed by BBN Advanced Computers to be used with real time operating systems and the hardware could contain up to 512 processors. It differs in many other systems in the way that each CPU can access memory, each CPU has access to memory from other operating systems[5]. An operating system that was commonly used with the butterfly

system was PSOS. PSOS is a real time operating system for supporting real time applications that was initially released in 1982. The PSOS allowed process to be scheduled with 255 priority levels.

2.2 Partos11

Daryl Johnston

B00535063

The Partos11 (Periodic and Aperiodic Real Time Operating System for the 68HC11) is a very small operating system to be used with micro-controllers that are very slow and very little memory available. The Operating system can run Hard and Soft task at the same time. This operating system implements the slack sharing server (SSS) to set the priorities of the processes in the schedule. The SSS is one of the Hard Tasks that will be running in the system because if it fails the system will no longer be able to schedule processes. The SSS Task has no deadline as it will be running in the background at all times. [7]

2.3 SPOS (Smart Phone Operating System)


SPOS is a multiprocessing operating system designed to be used in mobile phone hardware where there are a lot of memory constraints, processing constraints and requirements for processes that need to be running in the background for systems such as 3g connectivity and power management. The operating system supports two types of scheduling pre-emptive and round robin scheduling. When pre-emptive scheduling is used each process is given a priority. Another choice is the round robin scheduling among processes with the same priority. It makes use of time slicing to ensure the same processing time for these processes with the same priority [8]. Round Robin is a scheduling method that is usually not associated with real time operating systems that use hard tasks as it uses time slicing which cannot be used with hard processes as it can cause instability. I can only assume that the system critical processes such as 3g and Wi-Fi are always running in pre-emptive scheduling and soft processes such as a camera app would use robin scheduling.

2.4 QNX
QNX is a commercial real time operating system and can be adapted to run on a variety of different hardware such as Blackberry mobile phones, robotics and desktop PCs. The most popular version of QNX is the QNX Neutrino [18]

2.5 Windows CE

Daryl Johnston

B00535063

Windows CE is a popular real time operating system used within the business area and uses fixed priority scheduling. [9] However applications that are running and the windows CE control programs must coexist together. In order for this to happen the operating system uses a real-time class prioritising schedule. The scheduling system has 32 different priorities and from this the system can allocate the process to being a variable priority class or to being a real time class. if a process is given a priority of 0-16 the process will be set to variable priority and if the priority is 16-31 it will be set to real-time priority. However the real time capability for applications are not guaranteed since there is always an applications that has to execute periodically. To guarantee the real time processing of applications there are third party companies who make modifications to some parts of the operating system. The most successful way to solve this problem is to modify the hardware Abstraction Layer (HAL) and the kernel. [10]

3.0 MAJOR COMPONENTS MAKING UP A RTOS.


3.1 Hardware
The most common use of a real time operating system is in embedded systems and systems where there is a large array of processing components, the butterfly system could have 512 processors running at the same time [5]. The hardware does not need to be as strict as in a general purpose operating system; in that it does not need a CPU to function the operating system could just have access to some of the components that would be in an average multifunctional CPU. The Memory management is much more important in a real time operating system in comparison to a general purpose operating system

3.2 software
A very important piece of software that most real time operating systems have is a short-term task scheduler. The short term task scheduler differs from most schedulers in that it does not focus on processing the tasks fairly or keeping the average response time to a minimum. Instead they are made to be as responsive to real time processes as possible so that if a hard time process has a deadline coming up the task will quickly be scheduled [11].

Daryl Johnston

B00535063

4.0 CHARACTERISTICS AND DESIGN REQUIREMENTS OF A RTOS.


4.1 Scheduling
Because of the hard tasks that are available in a real time operating system conventional scheduling that is found in most general operating systems such as round robin is not usable in most cases. The scheduler in a real time operating system is often thought of as the most important component. There are two types of broad types of scheduling available, dynamic scheduling and static scheduling. Dynamic scheduling is calculated at the time of the task being processed. Static scheduling is calculated before the task is being processed, usually during the compile time [16] Real time scheduling Some examples of algorithms used to schedule tasks that are used in real time operating systems are: Static table driven approaches perform a static analysis of schedules of dispatching Static priority-driven pre-emptive approaches is much like the previous but instead of drawing up a schedule the analysis is used to assign priorities to all of the tasks. After tasks have been assigned a priority a priority-driven pre-emptive scheduler can be used to execute the processes in order of largest priority first. Dynamic planning based approaches determining the feasibility of a task a runtime rather than determining prior to the start of execution. This algorithm makes use of knowledge of the time constraints that are enforced in that it checks which of the task can be processed within the time constraint. Dynamic best effort approaches does not do any analysis on the feasibility of a process. The system will try to meet all of its deadlines and will abort a process that could not be completed within the deadline. Deadline scheduling this scheduling in deadline scheduling task come in sporadically, with each task given a prescribed processing time, deadline and value and then are

Daryl Johnston

B00535063

queued. Then an online scheduler schedules the tasks in the order they are to be processed. Rate Monotonic Scheduling Rate Monotonic Scheduling is a fixed-priority pre-emptive scheduling algorithm. The scheduler prioritises the tasks in the order of how long the task will take to process. The task with the shortest period will be processed first [15]

4.2 Priority inversion


A problem that can occur in any of these priority based pre-emptive scheduling scheme is priority inversion. It occurs whenever a high priority task is forced to wait for a low priority task to finish

4.3 Error Handling


Since real time operating systems run on a strict schedules this can lead to small errors in the software causing catastrophic effects within such as a loss in performance or failure of the system. This can be especially problematic if the system is reliant of a persons safety. RTOSs are very prone to errors in the software called soft-errors. There exist some RTOSs that can detect if a fault has occurred and rectify it accordingly [17]

4.4 Threads
There is a greater ability to make use of threads in a real time operating system since the user has greater control over the priorities in the schedule in comparison to a general purpose operating system. This means that a user can have a CPU dedicated in running a task. Optimisation of the threads in a multi-core system can give the user a lot more performance.

5.0 COMPARATIVE ASSESSMENT OF COMMERCIALLY AVAILABLE RTOSs.


Since real time operating systems are so customisable they can be used for all sorts of different systems, from large scale multi-processor systems like the butterfly system to smaller mobile system like the smart phone operating system. Each of the operating systems that I looked at had their own trait about them. Some operating systems like the PSOS where made to

Daryl Johnston

B00535063

be run in hardware consisting of many processors with the unique ability to access the memory available to other processors it is able to be much more efficient when running simultaneous threads. however the Smart phone operating system was made to be efficient when restrictive hardware is used as as there will not be so many processors or speed available while also having real time tasks. This operating system used a mixture of pre-emptive prioritisation and round robin scheduling to achieve this. partos 11 was made to run under some of the most restictive hardware being bound to using a micro controller. this operating system uses slack sharing server to make sure that tasks that are important are always running in the system. Windows CE is the most dexterous of the real time operating system allowing for easy deployment in a variety of different hardware specifications. however there are concerns on the ability to schedule tasks in real time without the tasks being interrupted requiring third party software to make the applications run in truly real time performance.

6.0 CONCLUSION
There is much more to consider in using a real time system rather than a general purpose operating system than one would think. There is a much deeper complexity in prioritising task with the ability to yield greater performance from the hardware available.

Daryl Johnston

B00535063

[1]Mizuhashi, Y. & Teramoto, M. 1989, "Real-Time UNIX Operating System: RX-UX 832", Journal of Systems Architecture, vol. 27, no. 1-5, pp . 533-533. [2]Subhashis Banerjee. (). Real Time Operating Systems for Networked Embedded Systems. Available: www.cse.iitd.ernet.in/~suban/csl373/rtos.ppt. Last accessed 20-03-2012. [3] Jose M. Garrido, Richard Schlesinger, Kenneth Hoganson. Principles of modern operating systems second edition. pp 117 [4] Do I Need a Real-Time System. Available: http://zone.ni.com/devzone/cda/tut/p/id/10342#toc2. Last accessed: 04/04/2012 [5]Abraham Silberschatz, 2009. Operating System Concepts. 8th International student edition. Wiley publishing. pp 760-761 [6]Harvey M. Deitel, 1990. Operating System. Second Edition.Addison-Wesley Publishing Company pp 335 [7]Yao Li; Wilson, P. ; , "PARTOS-11: an efficient real-time operating system for low-cost microcontrollers," Electronic Design, Test and Applications, 2002. Proceedings. The First IEEE International Workshop on , vol., no., pp .235-239, 2002 doi: 10.1109/DELTA.2002.994621 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=994621&isnumber=21449 [8]Jigang Wang; Guochang Gu; Shibo Xie; Lifeng Xu; , "Design of Smart Phone-Oriented Embedded Real-time Operating System," Computer and Computational Sciences, 2006. IMSCCS '06. First International Multi-Symposiums on , vol.2, no., pp. 758-763, 20-24 June 2006 doi: 10.1109/IMSCCS.2006.210 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4673799&isnumber=4673661 [9]Netter, C.M.; Baceller, L.F.; , "Assessing the real-time properties of Windows CE 3.0," ObjectOriented Real-Time Distributed Computing, 2001. ISORC - 2001. Proceedings. Fourth IEEE International Symposium on , vol., no., pp. 179-184, 2001 doi: 10.1109/ISORC.2001.922835 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=922835&isnumber=19938 [10]Kawakami, I.; Nimura, Y.; Hamada, K.; , "Real-time extension for Windows NT/CE used for control systems," SICE 2000. Proceedings of the 39th SICE Annual Conference. International Session Papers , vol., no., pp.319-324, 2000 doi: 10.1109/SICE.2000.889702 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=889702&isnumber=19236 [11]Harvey M. Deitel, 1990. Operating System. Second Edition. Addison-Wesley Publishing Company pp469 [12]Harvey M. Deitel, 1990. Operating System. Second Edition. Addison-Wesley Publishing Company pp471 [13]Harvey M. Deitel, 1990. Operating System. Second Edition.Addison-Wesley Publishing Company pp467-468 [14]Shiyao Chen; Lang Tong; Ting He; , "Optimal deadline scheduling with commitment," Communication, Control, and Computing (Allerton), 2011 49th Annual Allerton Conference on , vol., no., pp.111-118, 28-30 Sept. 2011 doi: 10.1109/Allerton.2011.6120157 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6120157&isnumber=6120135 [15]Manabe, Y.; Aoyagi, S.; , "A feasibility decision algorithm for rate monotonic scheduling of periodic real-tim12e tasks," Real-Time Technology and Applications Symposium, 1995. Proceedings , vol., no., pp.212-218, 15-17 May 1995 doi: 10.1109/RTTAS.1995.516218 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=516218&isnumber=11332 [16] Guanpi Lai;, Real Time Scheduling Power Point Presentation, 03 May 2003 [17] Neishaburi, M.H.; Daneshtalab, M.; Kakoee, M.R.; Safari, S.; , "Improving Robustness of RealTime Operating Systems (RTOS) Services Related to Soft-Errors," Computer Systems and

Daryl Johnston

B00535063

Applications, 2007. AICCSA '07. IEEE/ACS International Conference on , vol., no., pp.528-534, 13-16 May 2007 doi: 10.1109/AICCSA.2007.370932 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4231007&isnumber=4230921 [18] Jang Yeol Kim; Young Jun Lee; Se Woo Cheon; Jang Soo Lee; Kee Choon Kwon; , "A Commercial-Off-the-Shelf(COTS) dedication of a QNX real time operating system (RTOS)," Reliability, Safety and Hazard (ICRESH), 2010 2nd International Conference on , vol., no., pp.123-126, 14-16 Dec. 2010 doi: 10.1109/ICRESH.2010.5779528 URL: http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=5779528&isnumber=5779525 [19] Harvey M. Deitel, 1990. Operating System. Second Edition.Addison-Wesley Publishing Company pp 478

Daryl Johnston

B00535063

You might also like