Вы находитесь на странице: 1из 11

RTOS INTRODUCTION

Module 1

RTOS is an operating system that supports real-time applications and embedded systems by providing logically correct result within the deadline required.

Embedded System: An embedded system is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. E mbedded systems are portable devices and complex systems e.g. digital watches,MP3players, traffic lights, factory controllers, vehicles, MRI, and avionics.

hybrid

Complexity varies from low, with a single microcontroller chip, to very high with multiple units, peripherals and networks mounted inside a large chassis or enclosure.

Architecture:
An RTOS generally avoids implementing the kernel as a large monolithic program. The kernel is developed instead as a micro-kernel with added configurable functionalities. This implementation gives resulting benefit in increase system configurability, as each embedded application requires a specific set of system services with respect to its characteristics. The kernel of an RTOS provides an abstraction layer between the application software and hardware. This abstraction layer comprises of six main types of common services provided by the kernel to the application software.

Features of RTOS The design of an RTOS is essentially a balance between providing a reasonably rich feature set for application development and deployment and, not sacrificing predictability and timeliness. A basic RTOS will be equipped with the following features: i. Multitasking and Preemptibility An RTOS must be multi-tasked and preemptible to support multiple tasks in real-time applications. The scheduler should be able to preempt any task in the system and allocate the resource to the task that needs it most even at peak load. ii. Task Priority Preemption defines the capability to identify the task that needs a resource the most and allocates it the control to obtain the resource. In RTOS, such capability is achieved by assigning individual task with the appropriate priority level. Thus, it is important for RTOS to be equipped with this feature. iii. Reliable and Sufficient Inter Task Communication Mechanism For multiple tasks to communicate in a timely manner and to ensure data integrity among each other, reliable andsufficient inter-task communication and synchronization mechanisms are required.

iv. Priority Inheritance To allow applications with stringent priority requirements to be implemented, RTOS must have a sufficient number of priority levels when using priority scheduling. v. Predefined Short Latencies An RTOS needs to have accurately defined short timing of its system calls. The behavior metrics are: Task switching latency: The time needed to save the context of a currently executing task and switching to another task is desirable to be short. Interrupt latency: The time elapsed between execution of the last instruction of the interrupted task and the first instruction in the interrupt handler. Interrupt dispatch latency. The time from the last instruction in the interrupt handler to the next task scheduled torun. vi. Control of Memory Management To ensure predictable response to an interrupt, an RTOS should provide way for task to lock its code and data into real memory.

Algorithms An RTOS has an advanced algorithm for scheduling.Some commonly used RTOS scheduling algorithms are: Cooperative scheduling Preemptive- scheduling
Rate-monotonic scheduling Round-robin scheduling Fixed priority pre-emptive scheduling, Fixed-Priority Scheduling with Deferred Preemption Fixed-Priority Non-preemptive Scheduling Critical section preemptive scheduling Static time scheduling

Earliest Deadline First approach


Stochastic digraphs with multi-threaded graph traversal

Classification of RTOS
RTOSs are broadly classified: Hard real-time: degree of tolerance for missed deadlines is extremely small or zero. A missed deadline has catastrophic results for the system Firm real-time: missing a deadline might result in an unacceptable quality reduction Soft real-time: deadlines may be missed and can be recovered from. Reduction in system quality is acceptable

Examples
There are over 30 RTOSs which can be classified as open source versus commercial. VxWorks: Is a commercial RTOS from Wind River is the most widely adopted in the embedded industry (e.g., it is used on the International Space Station). VxWorks is available for all popular CPU platforms: x86, PowerPC, ARM, MIPS, 68K, CPU 32, ColdFire, MCORE, Pentium, i960, SH, SPARC, NEC V8xx, M32 R/D, RAD6000, ST 20, and TriCore

The kernel supports preemptive priority scheduling with 256 priority levels and round-robin scheduling. VxWorks is a multithreading RTOS that provides deterministic context switching and supports semaphores and mutual exclusion with inheritance. This RTOS also provides message queues and Openstandard Transparent IPC for high-speed communications between threads.

The Windows CE RTOS is a commercial RTOS developed in the late 1990s by Microsoft. Windows CE has a small footprint and can run in under a megabyte of memory. Three main development platforms (Windows Mobile, SmartPhone, and Portable Media Center) that allow developers to use feature-rich tools to develop applications for 86 and other architectures. Windows CE can have up to 32 processes active with multiple threads in each process. The scheduler supports round-robin or priority-based pre-emptive scheduling with 256 priority levels, and uses the priority inheritance protocol for dealing with priority inversion. Windows CE supports OS synchronization primitives such as critical sections, mutexes, semaphores, events, and message queues to allow thread to control access to share resources. A unique feature of Windows CE is the concept of fibers. A fiber is a unit of execution that must be manually scheduled by the application. A fiber is an execution unit that runs within the context of the thread that schedules it. A thread can schedule multiple fibers but they are not preemptively scheduled. The thread schedules a fiber by switching to it from another fiber. The running fiber assumes the identity of the thread. Fibers are useful in situations where the application needs to schedule its own threads.

Вам также может понравиться