54
Qt on Real Time OSs ... or how to get your Qt app on QNX and friends 10/09/09

Qt on Real Time Operating Systems

Embed Size (px)

DESCRIPTION

Presentation by Harald Fernengel held during Qt Developer Days 2009. http://qt.nokia.com/developer/learning/elearning

Citation preview

Page 1: Qt on Real Time Operating Systems

Qt on Real Time OSs... or how to get your Qt app on QNX and friends 10/09/09

Page 2: Qt on Real Time Operating Systems

Contents

• Some Basics

– CPU, Operating System, Windowing System

• Hardware Acceleration

• Deeper look into...

– QNX

– VxWorks

– INTEGRITY

2

Page 3: Qt on Real Time Operating Systems

Contents

Some Basics

3

Page 4: Qt on Real Time Operating Systems

Qt for RTOS

• Qt for RTOS ports are Community Supported

• Not all Qt modules available

• Qt APIs available unmodified (code once...)(with few exceptions that are documented in platform notes)

6

Page 5: Qt on Real Time Operating Systems

Embedded vs. Desktop

• Qt Embedded can be fine-tuned for size

– configure options, e.g. -no-script

– feature macros, e.g. QT_NO_FILEDIALOG

4

Page 6: Qt on Real Time Operating Systems

Integration

• Before we can start developing, the following must be considered:

– CPU Architecture

– Operating System

– Windowing System

6

Page 7: Qt on Real Time Operating Systems

Contents

CPU Architecture

7

Page 8: Qt on Real Time Operating Systems

Classic layer diagram

8

CPU

Opera)ng  System

QtCore

Page 9: Qt on Real Time Operating Systems

Classic layer diagram + atomics

9

CPU

Opera)ng  System

QtCore

AtomicOperations

Page 10: Qt on Real Time Operating Systems

Classic layer diagram + atomics II

10

CPU

INTEGRITY

QtCoreAtomics

Page 11: Qt on Real Time Operating Systems

Summary CPU Architecture

• Qt is CPU agnostic on operating systems that feature atomic operations– INTEGRITY, Windows CE

• Otherwise, Qt has built-in support for...– x86_64, i386, ARM, MIPS, PowerPC, SuperH, ...

• Optional: Blend and Blit optimizations (using iwMMXt, SSE, ...)

11

Page 12: Qt on Real Time Operating Systems

Contents

Operating Systems

12

Page 13: Qt on Real Time Operating Systems

Classic layer diagram (again)

13

Hardware

Opera)ng  System

QtCore

Page 14: Qt on Real Time Operating Systems

OS dependencies

• Qt Embedded is self-contained

– Build system is bootstrapped

– Requires libc, pthread, some math functions

– No other external library dependencies (like STL)

14

Page 15: Qt on Real Time Operating Systems

Classic OS diagram

15

Hardware

Linux

QtCore

Windows Solaris Mac  OS  X Symbian RTOS...

Page 16: Qt on Real Time Operating Systems

Classic OS diagram (simplified)

16

Hardware

POSIX

QtCore

Win32

Page 17: Qt on Real Time Operating Systems

Operating System

• Qt supports

– Win32 (*_win.cpp files)

– POSIX (*_unix.cpp files)

• Exception: Some native calls instead of POSIX for optimization or deeper integration(for example on Symbian, Mac OS X)

17

Page 18: Qt on Real Time Operating Systems

Operating System - Summary

• QtCore runs well on a POSIX compliant OS/RTOS

• Amount of required POSIX functionality varies (e.g. QT_NO_FILESYSTEM)

• Subsystems (e.g. file system) can be replaced by native calls if necessary

18

Page 19: Qt on Real Time Operating Systems

Contents

Windowing Systems

19

Page 20: Qt on Real Time Operating Systems

Classic layer diagram with GUI

20

Hardware

Opera)ng  System

Windowing  System

QtGui

QtCore

Page 21: Qt on Real Time Operating Systems

Windowing Systems

21

X11

QtGui

S60 Windows Mac  OS  X

Hardware

Linux WindowsSolaris Mac  OS  XSymbian RTOS...

???

Page 22: Qt on Real Time Operating Systems

Introducing QWS

• Qt contains it's own Windowing System:“Qt Windowing System” (QWS)

• Contains a compositing window manager

• Requires direct access to graphics card and input devices (mouse/touchscreen, keyboard/keypad)

22

Page 23: Qt on Real Time Operating Systems

Classic layer diagram with GUI

23

Hardware

Opera)ng  System

QWS

QtGui

QtCore

Screen  DriversInput  Drivers

Page 24: Qt on Real Time Operating Systems

QWS vs. OS

24

Hardware

Opera)ng  System

QWS

Drivers???

Page 25: Qt on Real Time Operating Systems

QWS diagram with gfx output

25

Hardware

Opera)ng  System

QWS

DirectFB LinuxFB Custom VNC

Network qvW

Virtual  FB

Page 26: Qt on Real Time Operating Systems

QVFB screenshot

26

Page 27: Qt on Real Time Operating Systems

Embedded Windowing Systems

27

X11

QtGui

Hardware

Linux WindowsSolaris Mac  OS  XSymbian RTOS...

QWS

Page 28: Qt on Real Time Operating Systems

QWS vs. X11

• X11– asynchronous client-server architecture, IPC

– requires additional window manager process

– complex due to lots of (optional) extensions

• QWS

– self-contained

– single process mode possible

28

Page 29: Qt on Real Time Operating Systems

Contents

Hardware Acceleration

29

Page 30: Qt on Real Time Operating Systems

HW Acceleration in Qt

• Qt supports OpenVG and OpenGL ES >= 2.0

• Both allow HW accelerated 2D [or 3D] painting

• However, both APIs don't define the interface to the Windowing System

30

Page 31: Qt on Real Time Operating Systems

Embedded Windowing Systems

31

X11

QtGui

Hardware

Opera)ng  System

QWS

OpenGL  (ES)OpenVG

??? ???

Page 32: Qt on Real Time Operating Systems

EGL to the rescue

• EGL is the glue layer between Windowing Systems and hardware acceleration(http://www.khronos.org/egl/)

32

Page 33: Qt on Real Time Operating Systems

Embedded Windowing Systems

33

X11

QtGui

Hardware

Opera)ng  System

QWS

OpenGL  (ES)OpenVG

???

EGL

Page 34: Qt on Real Time Operating Systems

Something still missing for QWS

• EGL is still relying on an underlying windowing system

• Works for X11, but not (out of the box) for QWS

• OpenKODE with KDui extension required

34

Page 35: Qt on Real Time Operating Systems

Something still missing (2)

• OpenKODE with KDui extension is its own windowing system

• So is QWS

35

Page 36: Qt on Real Time Operating Systems

Something still missing (3)

• OpenKODE with KDui extension is its own windowing system

• So is QWS

• #%^!@#!!

36

Page 37: Qt on Real Time Operating Systems

Introducing Lighthouse

• Lighthouse is the new QWS

• Lighthouse is not its own windowing system

• Instead, features plug-in architecture for integrating existing windowing systems

WARNING! WORK IN PROGRESS

37

Page 38: Qt on Real Time Operating Systems

Embedded Windowing Systems

38

X11

QtGui

Hardware

Opera)ng  System

Lighthouse

OpenGL  (ES)OpenVG

EGL EGL  +  KD

Page 39: Qt on Real Time Operating Systems

Summary Windowing System

• QWS works well with non accelerated displays

– HW acceleration possible, but tricky

• Lighthouse works best with existing windowing systems (KDgui) with OpenGL (ES) or OpenVG

• X11 works best if the infrastructure already exists for the target board, or if co-existence with other X11 applications is required

39

Page 40: Qt on Real Time Operating Systems

Summary Integration

• Before writing an application, we need to...

– consider the atomic operation support

– consider the feature set

– consider the windowing system

– consider the hardware acceleration

• If that's done, it's write once, deploy everywhere

40

Page 41: Qt on Real Time Operating Systems

Contents

Demo

41

Page 42: Qt on Real Time Operating Systems

Contents

A Deeper Look Into...QNX

42

Page 43: Qt on Real Time Operating Systems

QNX

• QNX port is community supported– About 5 occurrences of conditional Q_OS_QNX code

• Several successful deployments

– QWS without HW acceleration

• No Photon integration

– Photon is a windowing system → collides with QWS

• Photon's X11 server not recommended

– Doesn't feature Xrender, poor rendering quality

43

Page 44: Qt on Real Time Operating Systems

QWS diagram on QNX

44

Hardware

QNX

QWS

io-­‐display Custom VNC

Network

Experimental!

Page 45: Qt on Real Time Operating Systems

QNX - limitations

• No QSystemSemaphore, QSharedMemory

– SYSV style semaphores and shared memory missing from QNX

• No QProcess support

– Starting a process in a thread not supported

• QWS has single process GUI support only

• No Qt3Support

45

Page 46: Qt on Real Time Operating Systems

QNX

• How to build (see Platform Notes - QNX)– -xplatform unsupported/qws/qnx-i386-g++

– -embedded i386

– -no-qt3support

– -qt-gfx-qnx

– -qt-mouse-qnx

– -qt-kbd-qnx

– -no-exceptions

– ...

43

Page 47: Qt on Real Time Operating Systems

Contents

A Deeper Look Into...VxWorks

46

Page 48: Qt on Real Time Operating Systems

VxWorks

• VxWorks port is community supported

– About 60 VxWorks specific code changes

• Several successful deployments

– X11 with OpenGL acceleration

47

Page 49: Qt on Real Time Operating Systems

QtGui diagram on VxWorks

48

Hardware

VxWorks

QtGui

X11

Page 50: Qt on Real Time Operating Systems

VxWorks - limitations

• No QSystemSemaphore, QSharedMemory

– No SYSV style semaphores, shared memory

• No QLibrary

– No plugins

• Only one QApplication per system

– VxWorks has flat address space

• No Qt3Support

49

Page 51: Qt on Real Time Operating Systems

QNX

• How to build (see Platform Notes - VxWorks)– -xplatform unsupported/qws/vxworks-simpentium-g++

– -embedded vxworks

– -exceptions

– -no-qt3support

– ...

43

Page 52: Qt on Real Time Operating Systems

Contents

A Deeper Look Into...INTEGRITY

50

Page 53: Qt on Real Time Operating Systems

INTEGRITY

• Only a subset of Qt supported

• Port currently only available on request

51

Page 54: Qt on Real Time Operating Systems

Contents

Thank you :)(Questions?)

52