Sie sind auf Seite 1von 57

QNX Neutrino RTOS

Architecture Makes the Difference

March 18, 2014

Flat Architecture VxWorks


All software components reside in single address space Efficient for simple, singlepurpose systems Scalability & upgradeablilty limited Difficult to isolate errors in complex systems A failure in any component can cause the entire system to fail if you are lucky! Still in use today because:
OS cant handle overhead of MMU - developers trade memory protection for performance Migrating thousands of lines of spaghetti code perceived as too difficult or time-consuming

Application Device Drivers

Application TCP/IP Stack

Kernel space
Filesystem

Wind River's VxWorks uses the flat single-address-space model, evolving out of a traditional set of applications in which the environment was closed and only one or two basic operations had to be performed. - Bernard Cole, EE Times

March 18, 2014

All content copyright QNX Software Systems Ltd.

Monolithic Architecture - Linux


UNIX architecture developed in 1960s Widely used for desktop applications Provides memory protection for applications Still open to system faults from errors in drivers, stacks, and OS services Not suitable for applications requiring realtime performance
No priority inheritance Realtime extensions provide only limited realtime capability

Application

Application

User Space Kernel space


Filesystem

Device Drivers

TCP/IP Stack

The Linux community clearly states that


Linux is not meant to be used in real-time environments."

Linux is not an RTOS!


- Dedicated Systems Experts

March 18, 2014

All content copyright QNX Software Systems Ltd.

Modular Microkernel QNX Neutrino

ALL components reside in separate address spaces, isolated from each other and the kernel Difficult to cause system crashes Easier to isolate source of system errors Preferred technology for todays systems because:
Reliable Modular design - scalable and upgradeable Easily build complex systems Streamlined development and standards support decreases time to market

User Space
Application Filesystem

Kernel
Device Drivers TCP/IP Stack

The QNX [Neutrino] RTOS is the only RTOS that has a true message-based client-server architecture well equipped to handle todays requirements concerning distributed processing, high availability - Dedicated Systems Experts

March 18, 2014

All content copyright QNX Software Systems Ltd.

Microkernel Architecture

COOL

SuperH
ENGINE

Process Manager

io-block

io-net

io-graphics

io-audio

io-char

Microkernel
Application

Message Bus

Microkernel + Process Manager


are the only trusted components
March 18, 2014

Applications and Drivers


Are processes which plug into a message bus Reside in their own memory-protected address space Cannot corrupt other software components Can be started, stopped and upgraded on the fly

All content copyright QNX Software Systems Ltd.

Proven Performance

Independent tests show QNX performs


Dedicated Systems (http://www.omimo.be/encyc/) MPC7410 (333 Mhz)
Sandpoint Eval board 64M DRAM2M L2 Cache 32K Processor I/D cache 83 MHz bus

Thread switch (2 threads) Interrupt Latency Interrupt Dispatch Maximum Sustainable Interrupt Frequency with zero loss

0.6 s avg (range: 0.6 s 11.5 s) 0.4 s avg (range: 0.0 s 2.6 s) 0.7 s avg (range: 0.7 s 1.8 s) 10,000 interrupts 11.0 s 1,000,000,000 interrupts 11.0 s

Why was QNX tested on a 333 MHz PPC and OSE on a 400 MHz PPC? The issue was that with QNX, some events were that fast, that we could not measure them with enough precision. That's the reason why we digged (sic) into this. In general it means that QNX is highly efficient and ultra fast on a PPC platform. Martin Timmerman
March 18, 2014
All content copyright QNX Software Systems Ltd.

Hard Realtime Performance

Prioritized pre-emptable threads


256 priority levels Fully pre-emptable and deterministic kernel

Thread C Thread B Thread A

Priority 50 Priority 18 Priority 12

Multiple concurrent scheduling algorithms


FIFO, Round Robin, Sporadic

Prioritized and nested interrupts


Interrupt handlers can schedule a user thread or run custom interrupt code

Thread B Thread A
IRQ x

Handler x
IRQ y (higher)

Priority Inheritance
Threads take priority of requestor Prevents priority inversion

Handler y

Thread B scheduled
8

March 18, 2014

All content copyright QNX Software Systems Ltd.

Tools: QNX Momentics


The Most Productive Tools

March 18, 2014

Languages

C/C++
GCC 2.9.53, 3.3.5 compiler (all platforms) GCC 4 in beta, 2.53 being deprecated Dinkum C++ libraries (standard, embedded)

Java
IBM OTI J2ME certified (coffee cup logo) Custom embeddable J2SE subsets, with smart linking ability customized subset with unused code removal Java threads map onto native POSIX threads, so C, C++ and Java threads compete as equals Just-in-time (JIT) and ahead-of-time (AOT) compilation

Assembler

March 18, 2014

All content copyright QNX Software Systems Ltd.

10

QNX Momentics at a Glance


Choose your host
Windows, Linux, Solaris, QNX Neutrino

Choose your target


ARM, MIPS, PowerPC, SH4, XScale, x86

Choose your language


C, C++, Embedded C++

Choose your BSPs


BSPs for many popular boards and reference platforms

Choose command line or IDE


IDE and command line tools interoperate

Choose 3rd party tools


Growing ecosystem of tools vendors supporting Eclipse

March 18, 2014

All content copyright QNX Software Systems Ltd.

12

Tools Demo

DEMO!!!!

March 18, 2014

All content copyright QNX Software Systems Ltd.

28

QNX Neutrino RTOS


Scalability

March 18, 2014

Massive Scalability

From tiny embedded single board computers

To massive high performance, systems combining Neutrinos unique multi-core and Distributed capabilities
March 18, 2014
All content copyright QNX Software Systems Ltd.

30

Inter-Process Communication
Process communicate by sending messages

/dev/tcpip Process Manager

/dev/ser1

io-block

io-net

io-graphics

io-audio

io-char

K Microkernel
Application Application

Message Bus

Using Messages: Cleanly decouples processes POSIX calls built on messages


fd = open( /dev/tcpip, ,,, ) read, write, stat, devctl, close

Other POSIX calls as well

Shared memory
large data sets and hardware All content copyright QNX access Software Systems Ltd.

realtime signals pipes and POSIX mqueues mutexs, condvars, semaphores barriers, sleepon reader/writer locks
31

March 18, 2014

Multicore (including SMP)


PowerPC Pentium MIPS

Process Manager K

io-block

~~~

~~~~

io-net

io-graphics

~~~

io-audio

~~

io-char

~~

Microkernel
Application

Message Bus

Increase processing power by adding additional CPUs memory and peripherals are all shared Automatic thread (~) scheduling across all CPUs
the highest-priority thread will be running on an available processor threads can be locked to one or more CPUs via a processor affinity mask

Transparent to application software and drivers


March 18, 2014
All content copyright QNX Software Systems Ltd.

32

Distributed Processing
Message Bridge
Process Manager K io-block

internet
io-net io-graphics io-audio io-char

Microkernel
Application Process Manager K io-net

Message Bus

Applications and Servers become network distributed without any special code.
You gain unified access to all remote hardware and software resources

Application

Bridging the kernel allows messages to flow transparently from one message bus to another over a variety of transports
March 18, 2014

(Ethernet, RapidIO, custom switching fabric, internet, ) Multiple networkAll links will QNX redirect traffic on network failures content copyright Software Systems Ltd.

33

Networking

Standard NetBSD TCP/IP Stack


IP, UDP, TCP

Enhanced NetBSD TCP/IP Stack


Standard stack plus

Private, Secure Networking & IPv6


TCP/IPv6, IPsec,

PPP, PPOE ARP, IGMP, DHCP, DNS Forwarding, broadcast, multi-cast, routing sockets

IPV6 IPsec VPNs over Ipsec tunnels

IKE2 Utilities SNMPv2 MIB-II TCP/IP management agent (SNMP)

Easily create multiple virtual networks by running multiple instances of a TCP/IP stack on a physical interface

March 18, 2014

All content copyright QNX Software Systems Ltd.

34

Multiple Instances of Stacks


TCP/IP Instance TCP/IP Instance

TCP/IP

OSPF

Telnetd

TCP/IP

OSPF

Other Applications

Custom Stack

Custom Driver

Multiple TCP/IP stacks can run in one system


Isolation and security Virtual routers Redundancy Stacks can be bound to a port or VLAN Capability just falls out of architecture

March 18, 2014

All content copyright QNX Software Systems Ltd.

35

QNX Provides Comprehensive Protocol support

March 18, 2014

All content copyright QNX Software Systems Ltd.

36

QNX Neutrino RTOS


Reliability

March 18, 2014

Critical Process Monitoring

Process Memory Violation


State Machine

HMI App

io-net (TCP/IP)

Kernel notifies HA Manager

Microkernel
Application HA Manager

Dump file for post-mortem analysis

io-net

HA Manager restarts service


March 18, 2014
All content copyright QNX Software Systems Ltd.

38

Notification and Recovery

HAM Checkpointed State

HAM

HAM Guardian

TCP/IP Stack

HA Manager (HAM) monitors components, sends notification of component failure


Heart-beat services detect component hangs Core file on crash can be created for debugging and analysis

Driver

Standby Driver

App

Checkpointing permits recovering current state

Checkpointed State

March 18, 2014

All content copyright QNX Software Systems Ltd.

39

Adaptive Partitioning
File System Core Application

Add-On Application

OS

Device Driver

Core Application

Core Application

Add-on Application

10%

70%

20%

Adaptive partitioning provides secure partitions and guaranteed CPU time


A collection of processes and threads make up a partition A partition is assigned a percentage of CPU time, averaged over a time window Overlays on existing thread scheduling

March 18, 2014

All content copyright QNX Software Systems Ltd.

40

Realtime Performance
10% I/O Partition 70% Application Partition
Core Application Core Application

20% Untrusted Partition


Add-On

OS

File System

Device Drivers

Networking

Core Application

Add-On

CPU Guarantees for partitions at full system load Dynamic allocation of CPU use while under loaded

Partitions Enforced

No idle time

Free time use idle cycles

Idle time available

0%
March 18, 2014

50%

100%
41

CPU Utilization
All content copyright QNX Software Systems Ltd.

Example GPS

QNX Neutrino Microkernel

User Interface

Route Calculation

Diagnostics

Data Acquisition

30%

40%

30%

Fixed Partitioning
30% 40% 20% 10%

Adaptive Partitioning
Reroute
35% 45%
20%

20%

10% 10%

30%

20%

10%

Drive

20%

10%

20%

50%

10%

20%

40%

10%

20%

Stopped

10% 10%

80%

10%

20%

40%

30%

Power On

10%

90%

0%

20%

40%

60%

80%

100%

0%

20%

40%

60%

80%

100%
42

March 18, 2014

All content copyright QNX Software Systems Ltd.

QNX Neutrino RTOS


Human Machine Interface

March 18, 2014

QNX Photon microGUI

From tiny handhelds

To full desktops

Alpha blending, memory planes, live video, video overlay, direct draw Unicode allows display of multiple languages simultaneously Scaleable fonts - True type and small size Asian Stroke Fonts Extensive set of customizable widgets buttons, menus, lists, panes,
46

March 18, 2014

All content copyright QNX Software Systems Ltd.

Look and Feel

March 18, 2014

All content copyright QNX Software Systems Ltd.

47

Photon Graphical Runtime : 2D primitives

images: bmp, gif, jpg, png, tiff, pcx, xbm, tga lines, circles, polygons, points thick and thin 256 raster operations filled rectangles, circles, polygons Bezier curves, arcs

March 18, 2014

All content copyright QNX Software Systems Ltd.

49

Photon : Widgets

Widgets are smart objects handle own expose and redraw Extendable and customizable e.g. provide your OWN button

Buttons: image, radio, toggle, ON/OFF Sliders, meters, scrollbars, graphs, trends Panes, panels, scroll areas Text boxes, HTML, Web panes Lists, selection trees, file selectors
March 18, 2014

Menus, Combo boxes Terminals Input boxes: numeric and text

All content copyright QNX Software Systems Ltd.

50

Photon : Fonts
Without anti-aliasing With anti-aliasing

March 18, 2014

Unicode UTF-8 scalable fonts (smaller font files) anti-aliasing Multiple font types: TrueType Bitstream FontFusion TrueDoc bitmap Internationalization
51

All content copyright QNX Software Systems Ltd.

Multi-Language Support

QNX Photon microGUI windowing system supports standard encoding mechanism (UTF8) and translation facility
Adapt products to different geographies Over 20 language variants supported

Supported Language
US ASCII Western European

Encoding Standards
ISO 8859-1 Windows 1252

Central European
Maltese Latvian Cyrillic

ISO 8859-2, Windows 1250


ISO 8859-3 ISO 8859-4 ISO 8859-5 KO18-R IBM866 Windows 1251 ISO 8859-7 ISO 8859-9 JIS, ISO-2022-JP Shift JIS EUC EUC UTF-8 IBM 437 HZ, Big 5, GB 2312-80

Specialized Asian font and input method support Chinese character encoding GB18030
Mandatory import requirement in China Applicable for OEMs who want to adapt products to sell in China

Greek Turkish Japanese

Korean Unicode US Latin

Chinese
March 18, 2014
All content copyright QNX Software Systems Ltd.

GB 18030
52

Photon Application Builder


Simply click to align, duplicate, group, resize, or split any number of widgets.

Use builtin resource editors to quickly modify a widgets look and behaviour

Translate your UI into multiple languages, with full Unicode support.

Click to add any widget to your application

Attach callbacks that will automatically open windows, dialogs, and menus no need to write the glue that ties your interface together
March 18, 2014
All content copyright QNX Software Systems Ltd.

53

QNX Advanced Graphics Framework

Coral, Carmine, Intel Extreme, Radian 9700, [PowerVR]

March 18, 2014

All content copyright QNX Software Systems Ltd.

54

Look and Feel

March 18, 2014

All content copyright QNX Software Systems Ltd.

55

Graphics Framework

Core Graphics library Display and Video surface management 2D rendering primitives with hardware acceleration and software fallbacks
Blitting Alpha and Chroma Rectangles, Lines, polygons

Video Capture API

March 18, 2014

All content copyright QNX Software Systems Ltd.

56

3D Rendering and Vector Graphics

3D Rendering
OpenGL ES 1.0 Hardware accelerated if available Software fallbacks for unaccelerated functions Certified by the Khronos Group

2D Vector Graphics
OpenVG 1.0 Software renderer Investigating hardware possibilities

March 18, 2014

All content copyright QNX Software Systems Ltd.

57

Fonts and Images

Font support through FontFusion API


True Type font support Anti Aliasing and Outline characters Scalable font support

Image library
Decode and Encode support BMP JPEG GIF PNG TGA Resize and Rotation

March 18, 2014

All content copyright QNX Software Systems Ltd.

58

Adobe FlashLite 3

System integrator can quickly jump from prototype to product High level tools, millions of developers and designers Mountains of Flash content (components, movies (YouTube), source code, etc.) Strong industry standard
Adobe certifies Flashplayers with their Acceptance Test Suite Same look and feel for all flash content on all players

Adobe has been pushing in to embedded systems for several years


Almost all phones support FlashLite 2 Footprint is decreasing

Most embedded hardware can support the 100 to 200 CPU MIPS needed for a pleasing Flash experience ( 20 frames per second on QVGA or VGA screens)

March 18, 2014

All content copyright QNX Software Systems Ltd.

59

Why QNX and Flash ?

QNX is working with Flash technology in three key ways:


Incorporate Flash in to QNX application frameworks How to launch and control Flash content? How to co-exist Flash content with other graphics? With operating system services? QNX is creating polished demonstrations of production-ready Flash content and application integration Add QNX embedded values to Flashplayer and its environment Reliability Performance Scalability Sub-license the Adobe Flashplayer (FlashLite 3.X) Standalone player and browser plugin Adobe certified (passes all test suites)

March 18, 2014

All content copyright QNX Software Systems Ltd.

60

Flash + non-Flash

Adobe Flashplayer runs Flash swf content Menu buttons on bottom of screen DVD controls and status

DVD movie appears on video capture layer behind the Flashplayer Using Chromakey

March 18, 2014

All content copyright QNX Software Systems Ltd.

61

Flash + Flash

Adobe Flashplayer runs Flash swf content: Menu buttons on bottom of screen Touchscreen for panning left/right, zoom etc. Flash-based navigation application is managed by main Flash content

March 18, 2014

All content copyright QNX Software Systems Ltd.

62

Browsers

Voyager Mozilla Firefox (in progress) Netfront available from vendor

March 18, 2014

All content copyright QNX Software Systems Ltd.

63

QNX Neutrino RTOS


Other Features

March 18, 2014

Slinger Web Server

Internet

TCP/IP

HTTP

Slinger

Tag Get

Data Server
Tag Set

Small

Web Server (96K)


File System
HTML SHTML

HTTP 1.1 CGI 1.1 Basic Authentication

Control Apps

Dynamic

HTML Support Via Server Side Includes (SSI) and Data Server Also Available

Hardware

Apache

WEB Pages

File Systems

Disk
QNX
POSIX

Embedded
Image
ROM/RAM/Flash Execute-in-place

Network
CIFS
Microsoft connectivity

Special
Package
Field updates and rollbacks

DOS
Fat 12, 16, 32

RAM
Temporary files

NFS
Unix connectivity

Compression
Decompression on the fly 30 to 55% on executables

Linux
EXT2

NAND
Paged flash

CDROM
ISO9660, Rock Ridge, Joliet, DVD-RAM

NOR
Linear flash

Background erase and reclaim with


pre-emption Fault tolerant POSIX semantics

hierarchical directory structure,


symbolic links, permissions
66

March 18, 2014

All content copyright QNX Software Systems Ltd.

Flash Layout
BOOT BOOT BOOT IMAGE 1 IMAGE 2 IMAGE

FLASH FLASH FILESYSTEM FILESYSTEM

IPL IPL

Boot Image
Contains Kernel Requires only Flash Filesystem to be in Image

Flash Filesystem
Fault Tolerant POSIX Compliant Filesystem Once Filesystem is Loaded Everything Else Can be Loaded from the Filesystem, Even Drivers

IPL (Initial Program Loader)


Sets Up Board and Loads Boot Image Sits at Reset Vector

March 18, 2014

All content copyright QNX Software Systems Ltd.

67

Customized Power Management


Main Components:

Power monitoring application Power sensitive application

Client Library:
Device Drivers Applications

Server Library:
Power Manager

Client library

Power Callout:
CPU Control Power manager User applications

RTOS Provides:

Client/Server Libraries Power Managed Device Drivers CPU Power Callout

Server library

OS microkernel

End Users Write:


Power Manager Application (policy) Power Aware Applications Custom Power Managed Drivers Custom CPU Power Callout

Power-managed BSP
Power callout Device driver Device driver

OS, BSP components

CPU
March 18, 2014
All content copyright QNX Software Systems Ltd.

Peripherals
68

QNX Neutrino RTOS


Drivers

March 18, 2014

Drivers (supplied and available)

Serial Parallel Audio Graphics Input Network USB 2.0 Disk Flash

Platform Independent Drivers

Drivers are written in C Drivers are coded to be endian and alignment safe (gulliver.h) Drivers are IO architecture independent (io.h) Drivers are not unique to a board (BSP) Need Proof?
devc-ser8250 is src code identical on X86 PC, PPC 403 eval board, MIPS 4102 eval board devb-aha2 is src code identical on X86 PC, MIPS 4300 eval board

Resource Manager Structure

Resource Managers are simply application which handle some resource, typically hardware Standard user application Debug with standard debugger Can be single or multi-threaded QNX has resource manager model, however you dont have to use it Advantage of resource manager model is that it lets clients use standard open/read/write calls

initialize the resource manager register the name with the process manager Create thread pool (if multi-threaded) DO forever { receive a message SWITCH on the type of message CASE _IO_CONNECT: call io_open handler ENDCASE CASE _IO_READ: call io_read handler ENDCASE CASE _IO_WRITE: call io_write handler ENDCASE /* etc. handle all other messages */ /* that may occur, performing */ /* processing as appropriate */ ENDSWITCH ENDDO

Accessing Hardware

Must be superuser and issue ThreadCtl() Ports are accessed using in() and out() instructions (after mapping in device registers Memory is mapped using POSIX mmap() calls, though QNX extensions are preferred
/* map in the physical memory, 0xb8000 is text mode VGA video memory */ ptr = mmap_device_memory( 0, len, PROT_READ|PROT_WRITE|PROT_NOCACHE, 0, 0xb8000 ); if ( ptr == MAP_FAILED ) { perror( "mmap_device_memory for physical address 0xb8000 failed" ); exit( EXIT_FAILURE ); }

Handling Interrupts
ISR Processing Chain
INT ISR 1 ISR 2

...

ISR n

main () { ... pthread_create (NULL, NULL, int_thread, NULL); ... } // this thread is dedicated to handling and managing interrupts void * int_thread (void *arg) { ThreadCtl (_NTO_TCTL_IO, NULL); InterruptAttach (IRQ3, isr_handler, NULL, 0, 0); ... while (1) { InterruptWait (NULL, NULL); ... } } // This is the actual interrupt service routine const struct sigevent * isr_handler (void *arg, int id) { ... return (&event); }

Hardware Interrupt

Interrupt Redirector

Scheduler .

Kernel

Summary

Were there every step of the way!


Product Design Product Development
Choice of Host and Target Faster Development with intuitive IDE Standard or Priority Support Plan Custom Engineering

Product Deployment
Fault Resistant Field Upgradeable Clean IP Long term support for old versions Escrow

Modular Client/Server Architecture Training Design Reviews Follow POSIX Standards

Source Code
Board Support Pkgs System Reviews

March 18, 2014

All content copyright QNX Software Systems Ltd.

75

Is there really a choice other than QNX if the damn things gotta work?

Don Fotsch VP/GM Information Appliance Division 3Com

March 18, 2014

All content copyright QNX Software Systems Ltd.

76

2001, QNX Software Systems Ltd. QNX is a registered trademark, and Build a more reliable world is a trademark, of QNX Sof tware Systems Ltd. All other trademarks belong to their respective owners.

Das könnte Ihnen auch gefallen