0% found this document useful (0 votes)
120 views

Overview of RTOS and VxWorks

This document provides an overview of real-time operating systems (RTOS) and VxWorks. It discusses the objectives of understanding the necessity of embedded OS, issues related to real-time systems, important RTOS features, cross-platform development environments, POSIX compliance, multiprocessor support, fault tolerance, and an introduction to VxWorks and its features. The topics covered include embedded systems, programming languages, RTOS issues, scheduling and interrupts, POSIX, multiprocessor support, fault tolerance, and an introduction to VxWorks and the Tornado development tool.

Uploaded by

Grow Live
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views

Overview of RTOS and VxWorks

This document provides an overview of real-time operating systems (RTOS) and VxWorks. It discusses the objectives of understanding the necessity of embedded OS, issues related to real-time systems, important RTOS features, cross-platform development environments, POSIX compliance, multiprocessor support, fault tolerance, and an introduction to VxWorks and its features. The topics covered include embedded systems, programming languages, RTOS issues, scheduling and interrupts, POSIX, multiprocessor support, fault tolerance, and an introduction to VxWorks and the Tornado development tool.

Uploaded by

Grow Live
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

PEMP ESD2531

Overview of RTOS and VxWorks

Session Speaker
Deepak V.

 M.S Ramaiah School of Advanced Studies - Bengaluru 1


Session Objectives PEMP ESD2531

• To understand the necessity of embedded OS


• To understand the issues related to real time systems
• To study the important features of RTOS’s
• To know the reason for using the Cross-Platform Development
Environment
• To study the multiprocessor support for RTOS
• To study the POSIX compliance of the RTOS
• To define fault tolerance of a real time system
• To study the VxWorks and its Features
• To understand the Tornado Development tool

 M.S Ramaiah School of Advanced Studies - Bengaluru 2


Session Topics PEMP ESD2531

• Embedded systems
• Languages for Programming Embedded Systems
• Issues related to RTOS
• Scheduling and Interrupts
• Cross development environment
• POSIX
• Multiprocessor support
• Fault tolerance
• Introduction to VxWorks and its features, applications
• Tornado tool introduction

 M.S Ramaiah School of Advanced Studies - Bengaluru 3


What is an Embedded System? PEMP ESD2531

• Most embedded systems perform specific tasks. The simplest embedded system
contains input and output capability as well as control logic stored in system
firmware
• Embedded systems are everywhere in our lives, from mobile phones to medical
equipment, including air navigation systems, automated bank tellers, MP3
players, printers, cars, and a slew of other devices about which we are often
unaware
• Embedded system: “A microprocessor based system that does not look like a
computer”
• Embedded systems (ES) = information processing systems embedded into a
larger product

Embedded system
Single/simple task Multiple/complex task
Directly implemented Implemented using OS
as hardwired which is Embedded OS
Eg. Traffic light Eg. Mobile phone

 M.S Ramaiah School of Advanced Studies - Bengaluru 4


Application Areas PEMP ESD2531

 M.S Ramaiah School of Advanced Studies - Bengaluru 5


Embedded Systems from Real Life PEMP ESD2531

1. Mobile Phones and Base Stations


• Multiprocessor
– 8-bit/32-bit for UI; DSP for signals
– 32-bit in IR port; 32-bit in Bluetooth
• 8-100 MB of memory
• All custom chips

• Massive signal processing


– Several processing tasks per connected call
• Based on DSPs
– Standard or custom
– 100s of processors

 M.S Ramaiah School of Advanced Studies - Bengaluru 6


Embedded Systems from Real Life PEMP ESD2531

2. Sewing Machine
• User interface
– Embroidery patterns
– Touch-screen control
• “Smart”
– Sets pressure of foot depending on task
– Raise foot when stopped
• New functions added by upgrading
the software

 M.S Ramaiah School of Advanced Studies - Bengaluru 7


Embedded Systems from Real Life PEMP ESD2531

3. Cars • Multiple networks


– Body, engine, telematics,
• Multiple processors media, safety
– Up to 100 • Functions by embedded
– Networked together processing:
– ABS: Anti-lock braking
• Large diversity in processor types: systems
– 8-bit – door locks, lights, etc. – ESP: Electronic stability
– 16-bit – most functions control
– 32-bit – engine control, airbags – Airbags
– Efficient automatic gearboxes
– Theft prevention with smart
keys
– Blind-angle alert systems
– ... etc ...

 M.S Ramaiah School of Advanced Studies - Bengaluru 8


Embedded Systems from Real Life PEMP ESD2531

4. Extremely Large

• Functions requiring
computers:
– Radar
– Weapons
– Damage control
– Navigation
– basically everything
• Computers:
– Large servers
– 1000s of processors

 M.S Ramaiah School of Advanced Studies - Bengaluru 9


Embedded Systems from Real Life PEMP ESD2531

5. Inside Your PC
• Custom processors
– Graphics, sound
• 32-bit processors
– IR, Bluetooth
– Network, WLAN
– Harddisk
– RAID controllers
• 8-bit processors
– USB
– Keyboard, mouse

 M.S Ramaiah School of Advanced Studies - Bengaluru 10


Challenges for Embedded Systems PEMP ESD2531

• Limited OS support for programming: OS is part of application


code and it closely co-ordinate with the OS to support a majority
of the features that a desktop OS may provide
• Limited secondary memory: many embedded systems depends
on ROM/FLASH memory instead of secondary memory devices
• Limited RAM: No swapping. Virtual memory. While
programming the embedded system we must be very careful
about memory leaks because these programs tends to run forever
• Limited processing power: choose microprocessor that clock 10-
100 MHZ or microcontroller with less powerful configuration
• Interaction with hardware: embedded programmer cannot afford
hardware independence since his code directly interact with the
underlying hardware
• Absence of standard input/output devices: The programmer have
no direct way of knowing what is happening within the system

 M.S Ramaiah School of Advanced Studies - Bengaluru 11


Soft Parameters of Embedded System PEMP ESD2531

• Cost – requires the designer to be extremely conscious about


memory, peripherals etc
• Reliability – may require the designer to opt for some level of
redundancy
• Lifetime – longer lifetime product must be built with robust and
proven components
• Power consumption – should be as minimum as possible. Some
of part of the system can be shut down whenever not required.
Power saving features must be implemented in programming
platform (peripherals and processors)

 M.S Ramaiah School of Advanced Studies - Bengaluru 12


Languages for Programming Embedded Systems
PEMP ESD2531

• Lingua franca: assembly language use till recently


• C, C++, java with its new avatar J2ME, Ada (45% in C)
• Tools to model software (UML,SDL) – indicate the maturity of
embedded software programming
• C is very close to assembly programming and it allows very easy
access to underlying hardware. A huge number of high quality
and debugging tools are available for C.
• C++ compilers are buggy due to huge size of the language which
may create a buggy executable in some situation
• Some features of C++ cause a lot of code to bloat
• There is ongoing effort to identify a subset of C++ that can be
used in embedded system called as embedded C++

 M.S Ramaiah School of Advanced Studies - Bengaluru 13


What is an Embedded OS? PEMP ESD2531

• An embedded OS is an operating system which runs on any embedded


platform
• An Embedded OS can be defined as an OS with a small footprint
• Embedded platforms are generally required to function without human
intervention
• A typical embedded system consists of a single-board microcomputer with an
OS and some software loaded in ROM
• Embedded applications start running some special purpose program as soon as
it is turned on and will not stop until it is turned off (if ever)
• It will not usually have any of the normal peripherals such as a keyboard,
monitor, serial connections, mass storage, etc. or any kind of user interface
software unless these are required by the overall system of which it is a part
• Often an embedded OS must provide real-time response to perform its
requirements
• Linux running as embedded OS is embedded Linux

 M.S Ramaiah School of Advanced Studies - Bengaluru 14


What makes a Good Embedded OS? PEMP ESD2531

• Modular
• Scalable
• Configurable
• Small footprint
• CPU support
• Device drivers
• etc, etc, etc...
Generation of embedded OS – need cross development
environment

 M.S Ramaiah School of Advanced Studies - Bengaluru 15


Defining a Real-time System PEMP ESD2531

• A real-time system is a system whose specification includes both logical and


temporal correctness requirements
Logical:produce correct outputs
temporal:produce correct outputs at right time
• Any system where the timely response by the computer to external stimuli is
vital
• Hard real time systems • Soft real time system
– Guaranteed execution of tasks – Execution of tasks may not be
guaranteed
– Absolute deadline
– Approximate deadline
– Catastrophic failure if a deadline
is missed – Nothing catastrophic happens if a
deadline is missed
– Entire system failure resulting
serious harm – Repeated miss of deadlines results
in gradual degradation of system
– System design is based on strict
Performance
policies and rules

 M.S Ramaiah School of Advanced Studies - Bengaluru 16


PEMP ESD2531
What Makes OS that are Real-time so Important?

Nuclear Plant Example

• Lets say there is a power plant


• And lets say that the temperature is
rising
• And that there is 10 seconds to cool it
down before it is too late
• But…..

Source: Stephen Ferzetti

 M.S Ramaiah School of Advanced Studies - Bengaluru 17


Nuclear Plant PEMP ESD2531

• Since the plant was running its anti-


virus program at the time it missed its
window
• Meltdown

Source: Stephen Ferzetti

 M.S Ramaiah School of Advanced Studies - Bengaluru 18


The main reasons for having a RTOS PEMP ESD2531

• Meeting deadlines
• Being able to break out of lower priority processes so that more
important tasks can be accomplished
• When you break out of these processes, the data collected
remains intact

 M.S Ramaiah School of Advanced Studies - Bengaluru 19


Issues Related to Real-Time Systems PEMP ESD2531

• Architecture
– Processor architecture
– Network architecture
– Architectures for clock synchronization
– Fault tolerance and reliability evaluation
• Operating system
• Programming languages: Ada 95, Esterel, PEARL (Process and
Experiment Automation Real-time Language), Java, C, C++
• Databases: Databases are a structured and convenient way to
manage the sharing of large quantities of data among multiple
tasks
• Performance measures: Conventional measures like throughput
and reliability are not sufficient for real time systems

 M.S Ramaiah School of Advanced Studies - Bengaluru 20


Operating System Issues PEMP ESD2531

• Task assignment and scheduling


• Communication protocols
• Failure management and recovery
• A real-time operating system focus on deterministic response and
data/program corruption prevention
• Scalability, scheduling and support for embedded system are
required
• RTOS must support
– multi-threading/multitasking with multiple thread/task
priority
– Preemption
– predictable thread / task synchronization mechanisms
– scheduling must support priority inheritance

 M.S Ramaiah School of Advanced Studies - Bengaluru 21


What makes an OS an RTOS PEMP ESD2531

• Pre-emptive Kernel
• Short Interrupt Latency
• Short Dispatch Latency (Fast Context Switch)
• Proper Scheduling algorithms
• Control of Memory Management
– Task, thread or process are OS object which needs some memory space for
the object definition
– more complex the object, the more attributes it will have and bigger the
definition space will be
– If MMU exists, mapping tables are extra attributes for the task which require
more memory
• Fine Granularity Time Services
• Rich Set of API's
– More system calls, more complex they are, the fewer lines of codes the
application will have
– Code executed in the OS is certainly more efficiently executed (and better
debugged) in the OS than the same code in the application
• Small Size
 M.S Ramaiah School of Advanced Studies - Bengaluru 22
Scheduling PEMP ESD2531

• If more than one thread wants to use the processor simultaneously,


an algorithm is needed to decide which thread will run first
• For hard real time response it is essential to make the system
predictable under all circumstances
• Deadline-driven scheduling mechanism would be ideal. (current
state of technology does not allow this). Pre-emptive priority
scheduling offers a substitute
• Pre-emption - used all the time to ensure that a high priority event
can be dealt with before any other lower priority event. This should
be supported with interrupt based preemptive scheduling
• Good RTS Design:
– The list is organized taking into account the thread priorities
– The new element added to the list (task or thread) is always put
in a proper place
– when a dispatch occurs, the first thread in the list can be taken
 M.S Ramaiah School of Advanced Studies - Bengaluru 23
PEMP ESD2531
Interrupts
• Each OS needs to disable the interrupts from time to time to
execute critical code that should not be interrupted
• Number of lines of code executed should be limited to a
minimum to have minimum interrupt latency,
• Should be bound under all circumstances
• Problems with Interrupts
– Possibility of blocking tasks with blocking system calls
– Using stack of task/process which lead to stack overflow
– Generating errors during task execution, which are difficult to
diagnose

 M.S Ramaiah School of Advanced Studies - Bengaluru 24


Features of RTOS’ PEMP ESD2531

• Predictability: Meet its timing constraints


• Reliability: Probability that the system will not undergo failure
over any part of a prescribed interval
• Fault tolerance: The failure rates of a real time system must be
extraordinarily small, since failure may lead to loss of life. Be
able to continue operate despite the failure of a limited subset of
their software or hardware
• Availability: Is the fraction of time for which the system is up
• Throughput: Average number of instructions per unit time the
system can process
• High degree of concurrency: Support multitasking
• Responsiveness: Close connections to real world entities
• Distribution: processing is often distributed across several
processors
 M.S Ramaiah School of Advanced Studies - Bengaluru 25
Cross Development PEMP ESD2531

• Cross-development is defined as a development paradigm where


the applications are developed and debugged on a host other than
the target where they are deployed
• Cross development is required in situations where targets do not
have the necessary development resources
• The building and debugging of the applications is conducted on a
host, connected to a target via a network or serial port

• Bootloader
Cross-platform Host Serial/Ethernet Target • Kernel
development
• Root Filesystem
environment

 M.S Ramaiah School of Advanced Studies - Bengaluru 26


PEMP ESD2531
Cross-Platform Development Environment
• A cross-compiler runs on a processor but generates executable code for a
different processor. Eg ARM cross-compiler (arm-linux-gcc) running on an
x86 processor generates code for an ARM processor and PowerPC cross-
compiler (powerpc-linux-gcc) generates codes for a PowerPC

• Why cross-compiler? – Typically embedded systems don’t have the RAM or


storage resources to compile their own executables. So a host processor can
cross-compile code to create an executable which then transferred and
executed on the target board

• Eg. BlueCat Linux / Platform creation suite is a cross development product. It


allows for software development on a host and provides the necessary tools
for transferring software on the target board

 M.S Ramaiah School of Advanced Studies - Bengaluru 27


POSIX PEMP ESD2531

• An acronym for Portable Operating System Interface


• POSIX is a family of standards developed by the Portable
Applications Standards Committee (PASC) of the IEEE
Computer Society
• POSIX is a set of books specifying APIs
• It is neither a piece of code nor an operating system
• What is an API?
– Application Program Interface
– A written contract between system developers and application developers
– It is not a piece of code, it is a piece of paper defining what the two sets of
developers are guaranteed to receive and are in turn responsible for
providing

 M.S Ramaiah School of Advanced Studies - Bengaluru 28


PEMP ESD2531
Motivation for the Profiles Standard
• The POSIX 1003.1 Standard:
– Allows writing portable real-time applications
– Very large: inappropriate for embedded real-time systems
• POSIX 1003.13:
• Defines four real-time system subsets (profiles)
– Minimal: Small embedded systems
– Controller: Industrial controllers
– Dedicated: Large embedded systems
– Multi-Purpose: Large general-purpose systems with realtime requirements
• C and Ada language options

 M.S Ramaiah School of Advanced Studies - Bengaluru 29


Real-time System Subsets PEMP ESD2531

• Minimal: Small embedded systems


– Platform: Small embedded system
– no MMU, no disk, no terminal
– Model: controller of a “Toaster”

• Controller: Industrial controllers


– Platform: Special purpose controller
– No MMU, but with a disk containing a simplified file system
– Model: industrial robot controller

 M.S Ramaiah School of Advanced Studies - Bengaluru 30


Real-time System Subsets PEMP ESD2531

• Dedicated: Large embedded systems


– Platform: Large embedded system with file system on disk
– an MMU
– software is complex and requires memory protection and network communications
– Models: avionics controller, cellular phone cell node

• Multi-Purpose: Large general-purpose systems with realtime


requirements
– Platform: Large real-time system with all the features
– including a development environment
– network communications
– file system on disk
– terminal and graphical user interfaces, etc.
– Model: workstation with realtime requirements:
• air traffic control systems
• telemetry systems for Formula One racing cars

 M.S Ramaiah School of Advanced Studies - Bengaluru 31


POSIX 1003.13 Profiles PEMP ESD2531

 M.S Ramaiah School of Advanced Studies - Bengaluru 32


Multiprocessor Support PEMP ESD2531

• A multiprocessor operating system is typically large and complex


• Its maintainability, expandability, adaptability and portability
strongly depend on its internal structure
• Operating system kernel is the basic operating system
functionality permitting use of the processors, the main memory,
the interconnection network and the other devices of the parallel
machine

 M.S Ramaiah School of Advanced Studies - Bengaluru 33


Fault Tolerant System PEMP ESD2531

• Definition: Ability of a system to continue operating despite the


failure of a limited subset of its hardware and software
• Failure rates of real time systems must be very small ; smaller
than the failure rates of components from which they are built

 M.S Ramaiah School of Advanced Studies - Bengaluru 34


Performance Characteristics PEMP ESD2531

• Performance of real time systems must be gracefully degradable -


as the size of faulty set increases, the system must not suddenly
collapse but continue executing part of its work load
• As the extent of failure increases, the operating system must
begin shedding the less critical tasks first and still be able to
carryout the critical core tasks
• The goal of the system designer is to ensure that probability of
system failure is acceptably small

 M.S Ramaiah School of Advanced Studies - Bengaluru 35


Performance Degradation of a Fault Tolerant System PEMP ESD2531

Catastrophic failure region


Failure Extent

 M.S Ramaiah School of Advanced Studies - Bengaluru 36


PEMP ESD2531

VxWorks

 M.S Ramaiah School of Advanced Studies - Bengaluru 37


Introduction to VxWorks PEMP ESD2531

• VxWorks is the high performance real time operating system


(RTOS) unlike other operating systems like Windows, Linux etc.
• Most widely used RTOS is the VxWorks
• Here the operating system performs the proceeding in the real
time instead of latter time with storing it in some memory
• Development environment for this OS is Tornado, Wind River
Systems Inc, Alameda, CA, USA
• The main advantage of RTOS is less context switching time,
accuracy and the predictable response of the system
• VxWorks is generally compliant with the IEEE’s POSIX
(Portable Operating System Interface)

 M.S Ramaiah School of Advanced Studies - Bengaluru 38


Introduction to VxWorks PEMP ESD2531

• VxWorks requires a host workstation for the program


development
• Unlike systems such as UNIX and QNX, VxWorks development
is done on a “host” machine running UNIX or Windows,
crossing-compiling target software to run on various target CPU
architectures
• It includes integrated networking facilities and a complete
software development environment for Windows and UNIX
hosts
• It is the popular multitasking and single user operating system
and the RTOS is response even for external events

 M.S Ramaiah School of Advanced Studies - Bengaluru 39


Layered Structured PEMP ESD2531

Real-Time Embedded Application

Graphics Multiprocessing Internet

Java Support POSIX Library File System

WindNet Networking

Core OS:
Wind Microkernel

The diagram shows the different layers of the system

 M.S Ramaiah School of Advanced Studies - Bengaluru 40


Features of VxWorks PEMP ESD2531

• A fast, multitasking kernel with pre-emptive scheduling and fast


interrupt response
• It has extensive intertask communications and synchronization
facilities
• Efficient UNIX-compatible memory management
• Various Multiprocessor facilities
• A shell for user interface
• Symbolic and source level debugging capabilities
• Performance monitoring and an I/O file system

 M.S Ramaiah School of Advanced Studies - Bengaluru 41


Applications of Vxworks PEMP ESD2531

Some usage of RTOS

• Flight simulators • Printers

• Radio and optical telescopes • Digital Cameras

• Navigation systems • Hand-held Computing


devices
• Deep sea instrumentation
• Routers, Switches and other
• Traffic control systems
Network devices
• Modems
… any systems where rigid time requirement have been placed
on the operation of a processor or the flow of the data.

 M.S Ramaiah School of Advanced Studies - Bengaluru 42


PEMP ESD2531

TORNADO

 M.S Ramaiah School of Advanced Studies - Bengaluru 43


What is TORNADO? PEMP ESD2531

• Tornado is an integrated environment for software cross-


development
• It can provide an efficient way to develop real-time and
embedded applications with minimal intrusion on the target
system
• Tornado comprises:
-VxWorks, a high-performance real-time operating system
- Application-building tools (compilers and associated
programs)
- An integrated development environment (IDE) that facilitates
managing and building projects, establishing and managing host-
target communication, and running, debugging, and monitoring
VxWorks applications

 M.S Ramaiah School of Advanced Studies - Bengaluru 44


Key Features of the Tornado IDE PEMP ESD2531

• An integrated source-code editor


• A project management facility
• Integrated C and C++ compilers and make
• The browser, a collection of visualization aids to monitor the
target system
• CrossWind, a graphically enhanced source-level debugger
• WindSh, a C-language command shell that controls the target
• An integrated version of the VxWorks target simulator, VxSim
• Customization options for many features, including integration of
alternate editors and configuration management tools, as well as
the entire Tornado GUI itself

 M.S Ramaiah School of Advanced Studies - Bengaluru 45


Tornado Development Environment PEMP ESD2531

• The tornado environment is


designed to provide this full range
of features regardless of whether
the target is resource-rich or
resource-constrained
• Tornado facilities execute
primarily on a host system, with
shared access to a host-based
dynamic linker and symbol table
for a remote target system
• The following figures above
illustrates the relationships
between the principal interactive
host components of Tornado and
the target system. Communication
between the host tools and
VxWorks is mediated by the target
server and target agent
 M.S Ramaiah School of Advanced Studies - Bengaluru 46
Summary PEMP ESD2531

• Most embedded systems perform specific tasks. The simplest


embedded system contains input and output capability as well as
control logic stored in system firmware
• A real-time system is a system whose specification includes both
logical and temporal correctness requirements
• Pre-emptive kernel, short interrupt latency, short dispatch latency
and proper Scheduling algorithms are some of the requirements of
a good RTOS
• Each OS needs to disable the interrupts from time to time to
execute critical code that should not be interrupted
• Cross-development is defined as a development paradigm where
the applications are developed and debugged on a host other than
the target where they are deployed

 M.S Ramaiah School of Advanced Studies - Bengaluru 47


Summary PEMP ESD2531

• Operating system kernel is the basic OS functionality permitting


use of the processors, the main memory, the interconnection
network and the other devices of the parallel machine
• The ability of a system to continue operating, despite the failure
of a limited subset of its hardware and software is known as Fault
Tolerant system
• Vxworks is the real-time operating systems (RTOS) unlike other
operating systems like Windows, Linux etc.
• Most widely used RTOS is the VxWorks and the development
environment for this OS is Tornado
• It performs the proceeding in the real time instead of latter time
with storing it in some memory
• Tornado is an integrated environment for software cross-
development
 M.S Ramaiah School of Advanced Studies - Bengaluru 48

You might also like