SlideShare a Scribd company logo
Development with Qt
for Windows CE
                      10/11/09
Agenda

• Introduction to Windows CE

• How to build Qt for Windows CE
• Windows CE 5 memory model
• Ways to more memory
• Demonstration
What is Windows CE?

• OS for embedded devices
• not derived from desktop Windows
• monolithic kernel
• highly configurable using Platform Builder
• runs on x86, ARM, SH4 and MIPS




                                               3
The world of Windows CE

• Windows CE 5.2
  – Windows mobile 5, 6, 6.1, 6.5
     • SmartPhone (standard)
     • PocketPC (classic / professional)
• Windows CE 6.0 R2
  – Microsoft Auto
  – Windows mobile 7?




                                           4
Desktop Windows vs. Windows CE

• UTF16 string representation
•   No NTFS support → no file security model
•   No file drives
•   No current directory
•   Only 32 processes
•   Only 32 MB memory per process (CE < 6)




                                               5
Desktop Windows vs. Windows CE

• Number of threads limited to system resources
  – no more free memory → no more threads
• API is a Win32 API subset
  – no *A functions
  – no asynchronous file I/O or network
  – incomplete standard C libs




                                                  6
Desktop Windows vs. Windows CE

• Situation gets better with Windows CE 6
  – Up to 1 GB process memory
  – More than 32K processes
  – Improved system call performance
  – New product name:
     Windows embedded CE




                                            7
What do you need for development?

• Visual Studio 2005 Standard or
  Visual Studio 2008 Professional
• Windows CE SDK for your device
• Qt for Windows CE from qt.nokia.com
• Perl for using out-of-source builds
• Qt Visual Studio Add-in from qt.nokia.com




                                              8
Development work flow

• Prototype on Desktop Windows
• Switch to a Windows CE Qt build
• Build, deploy and run


  – Not everybody in the team needs a
    Windows CE development environment.




                                          9
How to build Qt for Windows CE?

• Use shadow builds.

 C:Qt4.6.0qtsource
               win32
               wincewm60professional
               wince50standard-x86




                                        10
How to build Qt for Windows CE?
Open a Visual Studio command prompt.
Add C:Qt4.6.0wincewm60professionalbin to PATH.

cd C:Qt4.6.0wincewm60professional
.qtsourcesconfigure
          -xplatform wincewm60professional-msvc2008
          -signature mysignature.pfx


Creates Qt configuration and builds the host tools:
• qmake, moc, uic, rcc
• setcepaths / checksdk
• cetest (if Remote API is in INCLUDE, LIBS)



                                                      11
How to build Qt for Windows CE?

...only two steps left...


setcepaths wincewm60professional-msvc2008


nmake




                                            12
Qt DLL sizes
Library sizes of Qt 4.5.2 on Windows mobile 6 professional:
      Qt library            Size in MB

      QtCore4.dll            1.67 MB
      QtGui4.dll             5.67 MB
      QtNetwork4.dll         0.53 MB
      QtWebKit4.dll          6.86 MB
      qjpeg4.dll             0.12 MB
      sum                   14.85 MB



                                                              13
The Windows CE 5.0 memory model
Slot 63 Resource only DLLs        • only 32 MB per slot
                                  • Application stack & heap grow
       large memory area
                                   from slot's bottom
Slot 32            Process 32
                                  • DLLs are loaded into process
                                   slots top-down
 ...                              • DLLs are guaranteed to have
Slot 3
                                   the same address in every slot
                   Process 2
Slot 2             Process 1
Slot 1           bundled DLLs
Slot 0          current process




                                                                14
The Windows CE 5.0 memory model



Bundled DLLs



Load address
for new DLLs




                                   15
The Windows CE 5.0 memory model




                              Qt
                              DLLs




                              Stack &
                              heap



                                        16
Ways to more Virtual Memory

•   Reduce the DLL size
•   Use static linking
•   Load small DLLs first
•   Switch to Windows mobile 6.1




                                   17
Reducing Qt DLL sizes

• Exclude the features you don't need
• “feature” = set of classes (e.g.
  GraphicsView)
• define QT_NO_FEATURENAME
  configure -D QT_NO_FEATURENAME
• add this define to your application .pro file
  DEFINES += QT_NO_FEATURENAME
• Tedious stuff! Is there no easier way to do
  this?

                                                  18
Reducing Qt DLL sizes using qconfig
Reducing Qt DLL sizes using qconfig

In your desktop Windows Qt build directory:
md toolsqconfig
cd toolsqconfig
qmake ......toolsqconfigqconfig.pro
nmake release
releaseqconfig.exe




                                              20
Reducing Qt DLL sizes using qconfig

Good candiates for exclusion:
• Standard dialogs (color, font, input, wizard, …)
• Convenience widgets (QCalendarWidget, ...)
• Clipboard, drag and drop, shortcuts
• QtConcurrent, FTP, QSystemTrayIcon
• GraphicsView for QWidget only applications
• MDI


                                                     21
Reducing Qt DLL sizes using qconfig

• Open the features description file in
srccorelibglobalqfeatures.txt

• Unselect unwanted features
• Save the result in
srccorelibglobalqconfig-myfeatures.h

• Reconfigure Qt
configure -qconfig myfeatures ...



                                          22
Reducing Qt DLL sizes

                           2.43
 minimal
                   1.42


                                      4.18
                                                    QtCore
   small
                    1.67                            QtGui



                                             5.67
standard
                    1.67

           0   1    2       3     4     5    6




                                                             23
Accessing the Large Memory Area

•   just 32 MB? Are you serious?
•   there's more behind slot 32
•   use memory mapped files
•   use the VirtualAlloc API




                                   24
Accessing the Large Memory Area

Using memory mapped files:
• acquire memory at 64 K boundaries
   QFile memfile("myfile.bin");
   memfile.open(QIODevice::ReadWrite);
   memfile.resize(1024*1024*2);
   uchar* buf = memfile.map(0, 1024*1024*2);
   ...
   memfile.unmap(buf);
   memfile.remove();




                                               25
Accessing the Large Memory Area

Using VirtualAlloc:
• Reserve memory at 64 K boundaries or
  commit reserved memory at 4 K
  boundaries
void* ptrBase = VirtualAlloc(0, dwSize,
                         MEM_RESERVE, PAGE_NOACCESS);
buffer = VirtualAlloc(ptrBase, dwSize,
                         MEM_COMMIT, PAGE_READWRITE);
...
VirtualFree(ptr, dwSize, MEM_DECOMMIT);
VirtualFree(ptr, 0, MEM_RELEASE);


                                                        26
Demonstration
Questions and Answers

More Related Content

What's hot (20)

PPT
了解 Qt
Chi Zhang
 
PDF
Introduction to Qt Creator
Qt
 
PPTX
Qt 6.2 lts vs. qt 5.15 the big feature parity comparison
Qt
 
PDF
Contributions to an open source project: Igalia and the Chromium project
Igalia
 
PDF
Migrating from Photon to Qt
Janel Heilbrunn
 
PDF
Network-Connected Development with ZeroMQ
ICS
 
PDF
Creating Slick User Interfaces With Qt
Espen Riskedal
 
PPTX
Qt for beginners part 5 ask the experts
ICS
 
ODP
Meet Qt
account inactive
 
ODP
Qt 5 - C++ and Widgets
Juha Peltomäki
 
PPTX
Knowit study group örnsköldsvik - introduction to qt & qt creator
Mathias Westin
 
PPTX
Qt for beginners part 1 overview and key concepts
ICS
 
PDF
Creating Advanced GUIs for Low-power MCUs with Qt
ICS
 
PDF
So I Downloaded Qt, Now What?
Janel Heilbrunn
 
PDF
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
ICS
 
PDF
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
ICS
 
PDF
Meet Qt 6.0
Qt
 
PDF
How to Make Your Qt App Look Native
account inactive
 
PDF
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Andreas Jakl
 
PDF
Chromium on Wayland Desktop (BlinkOn 7)
Igalia
 
了解 Qt
Chi Zhang
 
Introduction to Qt Creator
Qt
 
Qt 6.2 lts vs. qt 5.15 the big feature parity comparison
Qt
 
Contributions to an open source project: Igalia and the Chromium project
Igalia
 
Migrating from Photon to Qt
Janel Heilbrunn
 
Network-Connected Development with ZeroMQ
ICS
 
Creating Slick User Interfaces With Qt
Espen Riskedal
 
Qt for beginners part 5 ask the experts
ICS
 
Qt 5 - C++ and Widgets
Juha Peltomäki
 
Knowit study group örnsköldsvik - introduction to qt & qt creator
Mathias Westin
 
Qt for beginners part 1 overview and key concepts
ICS
 
Creating Advanced GUIs for Low-power MCUs with Qt
ICS
 
So I Downloaded Qt, Now What?
Janel Heilbrunn
 
[Webinar] QtSerialBus: Using Modbus and CAN bus with Qt
ICS
 
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
ICS
 
Meet Qt 6.0
Qt
 
How to Make Your Qt App Look Native
account inactive
 
Qt App Development - Cross-Platform Development for Android, iOS, Windows Pho...
Andreas Jakl
 
Chromium on Wayland Desktop (BlinkOn 7)
Igalia
 

Similar to Development with Qt for Windows CE (20)

PDF
Php on Windows
Elizabeth Smith
 
PDF
LXC, Docker, and the future of software delivery | LinuxCon 2013
dotCloud
 
PDF
LXC Docker and the Future of Software Delivery
Docker, Inc.
 
PDF
321 codeincontainer brewbox
Lino Telera
 
PPTX
JS Fest 2019. Алексей Бороденко. Windows Containers. Why should I care?
DevOps_Fest
 
PDF
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Odinot Stanislas
 
PDF
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
NETWAYS
 
PDF
Ch 6: The Wild World of Windows
Sam Bowne
 
PDF
Unikernel User Summit 2015: Getting started in unikernels using the rump kernel
The Linux Foundation
 
PPTX
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu Vunvulea
 
PDF
The end of embedded Linux (as we know it)
Chris Simmonds
 
PPTX
Presentation1.pptx
SubashiniRathinavel
 
PDF
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
PPT
RSA SF Conference talk-2009-ht2-401 sallam
Ahmed Sallam
 
PDF
Real-World Docker: 10 Things We've Learned
RightScale
 
PDF
Running Applications on the NetBSD Rump Kernel by Justin Cormack
eurobsdcon
 
PPTX
Server 2016 sneak peek
Michael Rüefli
 
PDF
Surviving a Plane Crash, a NU.nl case-study
peter_ibuildings
 
PDF
CNIT 127 Ch 6: The Wild World of Windows
Sam Bowne
 
Php on Windows
Elizabeth Smith
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
dotCloud
 
LXC Docker and the Future of Software Delivery
Docker, Inc.
 
321 codeincontainer brewbox
Lino Telera
 
JS Fest 2019. Алексей Бороденко. Windows Containers. Why should I care?
DevOps_Fest
 
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Odinot Stanislas
 
stackconf 2020 | Replace your Docker based Containers with Cri-o Kata Contain...
NETWAYS
 
Ch 6: The Wild World of Windows
Sam Bowne
 
Unikernel User Summit 2015: Getting started in unikernels using the rump kernel
The Linux Foundation
 
Radu vunvulea building and testing windows 8 metro style applications using ...
Radu Vunvulea
 
The end of embedded Linux (as we know it)
Chris Simmonds
 
Presentation1.pptx
SubashiniRathinavel
 
CNIT 126: 10: Kernel Debugging with WinDbg
Sam Bowne
 
RSA SF Conference talk-2009-ht2-401 sallam
Ahmed Sallam
 
Real-World Docker: 10 Things We've Learned
RightScale
 
Running Applications on the NetBSD Rump Kernel by Justin Cormack
eurobsdcon
 
Server 2016 sneak peek
Michael Rüefli
 
Surviving a Plane Crash, a NU.nl case-study
peter_ibuildings
 
CNIT 127 Ch 6: The Wild World of Windows
Sam Bowne
 
Ad

More from account inactive (20)

PDF
KDE Plasma for Mobile Phones
account inactive
 
PDF
Shipping Mobile Applications Using Qt for Symbian
account inactive
 
PDF
The Future of Qt Widgets
account inactive
 
PDF
Scripting Your Qt Application
account inactive
 
PDF
Special Effects with Qt Graphics View
account inactive
 
PDF
Developments in The Qt WebKit Integration
account inactive
 
PDF
Qt Kwan-Do
account inactive
 
PDF
Qt on Real Time Operating Systems
account inactive
 
PDF
Translating Qt Applications
account inactive
 
PDF
Qt Creator Bootcamp
account inactive
 
PDF
Qt Widget In-Depth
account inactive
 
PDF
Qt State Machine Framework
account inactive
 
PDF
Mobile Development with Qt for Symbian
account inactive
 
PPT
Animation Framework: A Step Towards Modern UIs
account inactive
 
PDF
Using Multi-Touch and Gestures with Qt
account inactive
 
PDF
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)
account inactive
 
PDF
The Mobility Project
account inactive
 
PDF
Copy Your Favourite Nokia App with Qt
account inactive
 
PDF
The Next Generation Qt Item Views
account inactive
 
PDF
Optimizing Performance in Qt-Based Applications
account inactive
 
KDE Plasma for Mobile Phones
account inactive
 
Shipping Mobile Applications Using Qt for Symbian
account inactive
 
The Future of Qt Widgets
account inactive
 
Scripting Your Qt Application
account inactive
 
Special Effects with Qt Graphics View
account inactive
 
Developments in The Qt WebKit Integration
account inactive
 
Qt Kwan-Do
account inactive
 
Qt on Real Time Operating Systems
account inactive
 
Translating Qt Applications
account inactive
 
Qt Creator Bootcamp
account inactive
 
Qt Widget In-Depth
account inactive
 
Qt State Machine Framework
account inactive
 
Mobile Development with Qt for Symbian
account inactive
 
Animation Framework: A Step Towards Modern UIs
account inactive
 
Using Multi-Touch and Gestures with Qt
account inactive
 
Debugging Qt, Fixing and Contributing a Bug Report (Using Gitorious)
account inactive
 
The Mobility Project
account inactive
 
Copy Your Favourite Nokia App with Qt
account inactive
 
The Next Generation Qt Item Views
account inactive
 
Optimizing Performance in Qt-Based Applications
account inactive
 
Ad

Recently uploaded (20)

PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Development with Qt for Windows CE

  • 1. Development with Qt for Windows CE 10/11/09
  • 2. Agenda • Introduction to Windows CE • How to build Qt for Windows CE • Windows CE 5 memory model • Ways to more memory • Demonstration
  • 3. What is Windows CE? • OS for embedded devices • not derived from desktop Windows • monolithic kernel • highly configurable using Platform Builder • runs on x86, ARM, SH4 and MIPS 3
  • 4. The world of Windows CE • Windows CE 5.2 – Windows mobile 5, 6, 6.1, 6.5 • SmartPhone (standard) • PocketPC (classic / professional) • Windows CE 6.0 R2 – Microsoft Auto – Windows mobile 7? 4
  • 5. Desktop Windows vs. Windows CE • UTF16 string representation • No NTFS support → no file security model • No file drives • No current directory • Only 32 processes • Only 32 MB memory per process (CE < 6) 5
  • 6. Desktop Windows vs. Windows CE • Number of threads limited to system resources – no more free memory → no more threads • API is a Win32 API subset – no *A functions – no asynchronous file I/O or network – incomplete standard C libs 6
  • 7. Desktop Windows vs. Windows CE • Situation gets better with Windows CE 6 – Up to 1 GB process memory – More than 32K processes – Improved system call performance – New product name: Windows embedded CE 7
  • 8. What do you need for development? • Visual Studio 2005 Standard or Visual Studio 2008 Professional • Windows CE SDK for your device • Qt for Windows CE from qt.nokia.com • Perl for using out-of-source builds • Qt Visual Studio Add-in from qt.nokia.com 8
  • 9. Development work flow • Prototype on Desktop Windows • Switch to a Windows CE Qt build • Build, deploy and run – Not everybody in the team needs a Windows CE development environment. 9
  • 10. How to build Qt for Windows CE? • Use shadow builds. C:Qt4.6.0qtsource win32 wincewm60professional wince50standard-x86 10
  • 11. How to build Qt for Windows CE? Open a Visual Studio command prompt. Add C:Qt4.6.0wincewm60professionalbin to PATH. cd C:Qt4.6.0wincewm60professional .qtsourcesconfigure -xplatform wincewm60professional-msvc2008 -signature mysignature.pfx Creates Qt configuration and builds the host tools: • qmake, moc, uic, rcc • setcepaths / checksdk • cetest (if Remote API is in INCLUDE, LIBS) 11
  • 12. How to build Qt for Windows CE? ...only two steps left... setcepaths wincewm60professional-msvc2008 nmake 12
  • 13. Qt DLL sizes Library sizes of Qt 4.5.2 on Windows mobile 6 professional: Qt library Size in MB QtCore4.dll 1.67 MB QtGui4.dll 5.67 MB QtNetwork4.dll 0.53 MB QtWebKit4.dll 6.86 MB qjpeg4.dll 0.12 MB sum 14.85 MB 13
  • 14. The Windows CE 5.0 memory model Slot 63 Resource only DLLs • only 32 MB per slot • Application stack & heap grow large memory area from slot's bottom Slot 32 Process 32 • DLLs are loaded into process slots top-down ... • DLLs are guaranteed to have Slot 3 the same address in every slot Process 2 Slot 2 Process 1 Slot 1 bundled DLLs Slot 0 current process 14
  • 15. The Windows CE 5.0 memory model Bundled DLLs Load address for new DLLs 15
  • 16. The Windows CE 5.0 memory model Qt DLLs Stack & heap 16
  • 17. Ways to more Virtual Memory • Reduce the DLL size • Use static linking • Load small DLLs first • Switch to Windows mobile 6.1 17
  • 18. Reducing Qt DLL sizes • Exclude the features you don't need • “feature” = set of classes (e.g. GraphicsView) • define QT_NO_FEATURENAME configure -D QT_NO_FEATURENAME • add this define to your application .pro file DEFINES += QT_NO_FEATURENAME • Tedious stuff! Is there no easier way to do this? 18
  • 19. Reducing Qt DLL sizes using qconfig
  • 20. Reducing Qt DLL sizes using qconfig In your desktop Windows Qt build directory: md toolsqconfig cd toolsqconfig qmake ......toolsqconfigqconfig.pro nmake release releaseqconfig.exe 20
  • 21. Reducing Qt DLL sizes using qconfig Good candiates for exclusion: • Standard dialogs (color, font, input, wizard, …) • Convenience widgets (QCalendarWidget, ...) • Clipboard, drag and drop, shortcuts • QtConcurrent, FTP, QSystemTrayIcon • GraphicsView for QWidget only applications • MDI 21
  • 22. Reducing Qt DLL sizes using qconfig • Open the features description file in srccorelibglobalqfeatures.txt • Unselect unwanted features • Save the result in srccorelibglobalqconfig-myfeatures.h • Reconfigure Qt configure -qconfig myfeatures ... 22
  • 23. Reducing Qt DLL sizes 2.43 minimal 1.42 4.18 QtCore small 1.67 QtGui 5.67 standard 1.67 0 1 2 3 4 5 6 23
  • 24. Accessing the Large Memory Area • just 32 MB? Are you serious? • there's more behind slot 32 • use memory mapped files • use the VirtualAlloc API 24
  • 25. Accessing the Large Memory Area Using memory mapped files: • acquire memory at 64 K boundaries QFile memfile("myfile.bin"); memfile.open(QIODevice::ReadWrite); memfile.resize(1024*1024*2); uchar* buf = memfile.map(0, 1024*1024*2); ... memfile.unmap(buf); memfile.remove(); 25
  • 26. Accessing the Large Memory Area Using VirtualAlloc: • Reserve memory at 64 K boundaries or commit reserved memory at 4 K boundaries void* ptrBase = VirtualAlloc(0, dwSize, MEM_RESERVE, PAGE_NOACCESS); buffer = VirtualAlloc(ptrBase, dwSize, MEM_COMMIT, PAGE_READWRITE); ... VirtualFree(ptr, dwSize, MEM_DECOMMIT); VirtualFree(ptr, 0, MEM_RELEASE); 26