Beruflich Dokumente
Kultur Dokumente
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
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
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
Device Drivers
TCP/IP Stack
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
Microkernel Architecture
COOL
SuperH
ENGINE
Process Manager
io-block
io-net
io-graphics
io-audio
io-char
Microkernel
Application
Message Bus
Proven Performance
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.
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
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
10
12
Tools Demo
DEMO!!!!
28
Massive Scalability
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/ser1
io-block
io-net
io-graphics
io-audio
io-char
K Microkernel
Application Application
Message Bus
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
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
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
PPP, PPOE ARP, IGMP, DHCP, DNS Forwarding, broadcast, multi-cast, routing sockets
Easily create multiple virtual networks by running multiple instances of a TCP/IP stack on a physical interface
34
TCP/IP
OSPF
Telnetd
TCP/IP
OSPF
Other Applications
Custom Stack
Custom Driver
35
36
HMI App
io-net (TCP/IP)
Microkernel
Application HA Manager
io-net
38
HAM
HAM Guardian
TCP/IP Stack
Driver
Standby Driver
App
Checkpointed State
39
Adaptive Partitioning
File System Core Application
Add-On Application
OS
Device Driver
Core Application
Core Application
Add-on Application
10%
70%
20%
40
Realtime Performance
10% I/O Partition 70% Application Partition
Core Application Core Application
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
0%
March 18, 2014
50%
100%
41
CPU Utilization
All content copyright QNX Software Systems Ltd.
Example GPS
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
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
47
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
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
50
Photon : Fonts
Without anti-aliasing With anti-aliasing
Unicode UTF-8 scalable fonts (smaller font files) anti-aliasing Multiple font types: TrueType Bitstream FontFusion TrueDoc bitmap Internationalization
51
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
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
Chinese
March 18, 2014
All content copyright QNX Software Systems Ltd.
GB 18030
52
Use builtin resource editors to quickly modify a widgets look and behaviour
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
54
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
56
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
57
Image library
Decode and Encode support BMP JPEG GIF PNG TGA Resize and Rotation
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
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)
59
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
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
62
Browsers
63
Internet
TCP/IP
HTTP
Slinger
Tag Get
Data Server
Tag Set
Small
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
Flash Layout
BOOT BOOT BOOT IMAGE 1 IMAGE 2 IMAGE
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
67
Client Library:
Device Drivers Applications
Server Library:
Power Manager
Client library
Power Callout:
CPU Control Power manager User applications
RTOS Provides:
Server library
OS microkernel
Power Manager Application (policy) Power Aware Applications Custom Power Managed Drivers Custom CPU Power Callout
Power-managed BSP
Power callout Device driver Device driver
CPU
March 18, 2014
All content copyright QNX Software Systems Ltd.
Peripherals
68
Serial Parallel Audio Graphics Input Network USB 2.0 Disk Flash
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 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
Product Deployment
Fault Resistant Field Upgradeable Clean IP Long term support for old versions Escrow
Source Code
Board Support Pkgs System Reviews
75
Is there really a choice other than QNX if the damn things gotta work?
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.