Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory

Keywords: Match:
Windows CE and Windows XP together on the same PC
by Heinrich Munz (Mar. 4, 2003)

Windows XP doesn't provide real-time capabilities, hindering its utility for industrial applications. However, because it supports so many apps, sometimes it would be useful to have it running on the same platform as Windows CE.

That's possible with the CeWin extender from Kuka Roboter, which enables Windows CE and Windows XP to run together on one PC.

This paper will describe the technology. CeWin is software only real time extension technology for the desktop Windows has been developed, which guarantees deterministic response on interrupts which are targeted to Windows CE. Theses interrupts can be generated by any PCI- or ISA- PC plug in board controlled by Windows CE and have always a higher priority than the desktop Windows.



As long as at least one Windows CE task is active, the processor’s execution time is available exclusively for Windows CE. In other words, only if all Windows CE tasks have given up their execution time, Windows will be reactivated. This is done when Windows CE falls into the so called idle task of Windows CE. From this point of view, one can say, desktop Windows runs as the idle task of Windows CE. The Windows CE idle task controls the re-activation of Windows. This makes it possible for the programmer to control the sharing of the processor between the two operating systems according to the requirements of the application.

There are two members within Kuka's CeWin product family: CeWin PE (Professional Edition) and CeWin LE (Light Edition). While CeWin PE has the full and unlimited functionality of the original Windows CE, the CeWin LE as a low cost entry product has some limitations:
  • Pre-configured images with several fixed sizes that cannot be modified
  • Additional OS features cannot be included
  • Development environment: Embedded Visual Studio and Visual Studio.NET, Platform Builder cannot be used
  • Only one user process is supported
  • Does support TCP/IP communication between Windows and WinCE but with no routing (IP Forwarding) support

However, both versions do support:
  • Access of the local Windows hard disk (i.e. to load the user application)
  • Win32 subset API, C++ Support
  • Windows CE console accessible using Telnet



The CeWin product license from KUKA Roboter only consists of the coupling mechanisms to have both operating systems concurrently on the same PC. However, it does not include the two also needed original Microsoft licenses for Windows XP and Windows CE. Those have to be procured at the official Microsoft distributors. After installing the two original software products, the installation of CeWin has to be done at last.

Communication between Windows CE and desktop Windows
The TCP/IP-protocol is used for communication between Windows CE and Windows XP using shared memory areas. For this purpose two corresponding network drivers have been developed for both sides, Windows XP and Windows CE.

Both systems can exchange data over the commonly accessible shared memory area as they would do via an Ethernet line. Using the Windows built in IP-Forwarding feature, Windows CE can access other systems, which are connected to the Windows XP TCP/IP network.

This communication method has the advantage, that the two systems can be torn apart and connected by a real Ethernet line without changing one of the applications. This makes sense, if the real time target system is not only PC-based but also an embedded system like a stand alone controller without Windows PC functionality.

For a more direct TCP/IP connection to systems outside of the PC an additional Ethernet hardware can be used. An Ethernet board, which is supported by a standard Windows CE driver, can be plugged in into the PC. Usually, this will be an additional Ethernet board beside the first one, which is used by Windows. CeWin can control this Ethernet board directly.

Using the standard TCP/IP protocol, any additional Windows CE products can be used together with CeWin, e. g. development systems like Platform Builder or Kernel Tracker. As Windows CE and Windows XP run on the same processor, no special host is required for the development.

For the run time system, TCP/IP sockets etc. can be used for proprietary communication protocols between Windows and Windows CE programs. Alternatively standard mechanisms like DCOM or SOAP may be used for communication.

From the point of view of the Windows CE or the Windows XP applications there is no difference between running under CeWin on the same PC or as usual running on two different systems. Host and target system are identical.



Loading and starting of CeWin

After Windows XP is up and running, CeWin can be started by uploading the Windows CE image file with a little loader tool which is a Win32 application and easily can be integrated into a user written Windows XP application. This application communicates with the CeWin interface driver which was loaded during the boot sequence of Windows XP. Initially, the loader calls the driver to allocate memory that Windows CE later uses for code and data. The allocated memory is guaranteed to be fixed (not swapped to disk) and the code running in this memory has the highest privilege level (Ring 0). The next step of the loader is to read the Windows CE image from disk, and copy it to the allocated memory on behalf of the driver. After the code and data are relocated to the loading address, Windows CE is started by calling the init function of Windows CE. As soon as all initialization tasks are idle, the init function returns and the loader terminate. From now on, Windows CE only will be activated by real time interrupts followed by task scheduling.



Activation of CeWin by interrupts

The interrupts for Windows CE as well as for Windows are received directly from the Programmable Interrupt Controller (PIC) of the PC. However, the real time Extension technology assures that the interrupts enabled for Windows CE always have higher priority than everything in Windows (including Windows interrupts). These interrupts will interrupt Windows XP or CeWin tasks within a few microseconds and call the corresponding Windows CE interrupt service routine (ISR). After returning from the ISR, but before returning to Windows, the system checks, if there are any Windows CE tasks ready to run. If this is the case (one or more tasks has been activated within the ISR), the system will not return to Windows, but it will activate the corresponding Windows CE task, first. Those tasks keep on running until all of them will be suspended again. The system then enters the idle task of Windows CE, which will lead to a return to Windows XP. Since Windows XP only will be re-activated, if all Windows CE tasks are idle, one can say that Windows XP runs as the idle task of Windows CE. The Windows CE idle task controls the re-activation of Windows. This makes it possible for the programmer to control the sharing of the processor between the two operating systems.




State diagram of CeWin



Exception Handling of Windows CE

Whenever Windows CE is activated via the ISRs a new exception table is loaded by only one assembler instruction. Therefore the exception handling for page faults, debugging, and so on is exactly the same as it is by Windows CE running stand alone. Before falling back to Windows, its exception table is re-loaded.
The arithmetic Co-Processor also can be used within CeWin without any restrictions. Since it is possible that the interrupted Windows has the Co-Processor currently in use, the state of the arithmetic Co-Processor is saved whenever Windows CE needs it and restored before returning to Windows.

Target Market
  • Real Time Extender for Windows XP using Windows CE
  • PC-based automation (PLC, Motion Control)
  • Real Time Measurements and Controls
  • PC and HMI add on for existing Windows CE applications
  • Windows CE target simulation with real time behavior and hardware access

Technical Features
  • Full usage of the RTOS Windows CE concurrently to desktop Windows
  • Multitasking, Intertask communication, Win32 API
  • TCP/IP Stack, ISAPI, ASP, SOAP etc.
  • Optional Products
  • Runtime environment for C, C++, C#, Visual Basic etc.
  • Software only solution, no additional hardware necessary
  • Usage of the well known Microsoft development tools for desktop Windows as well as for the RTOS development
  • Graphical real time analysis tools (Kernel Tracker etc.)
  • High resolution real time timer, granularity ca. 0.8 us
  • Hardware access to ISA and PCI plug in boards
  • Usage of the original Win32 API for Windows CE
  • All additional features of Windows CE are usable
  • Communication between desktop Windows and Windows CE via shared memory TCP/IP. Usage of DCOM or SOAP possible.
  • Access of the Windows hard disc (using a directory share)

Commercial Features
  • No need for additional intelligent co-processor board nor separate control
  • Reduction of hardware costs
  • Less hardware components: Reduction of failures
  • More compact controls possible
  • Small learning curve
  • Known tools (Visual Studio, Visual Basic etc.)
  • Win32 API
  • Re-usage of existing Windows CE Software and Know How is possible
  • Two scaled versions available
  • Low cost entry product CeWin LE (Light Edition)
  • Full version CeWin PE (Professional Edition)

How to work with it?
  • Microsoft tools as the Integrated Development Environment (IDE) to develop and debug real time applications
  • Wizards to generate applications
  • Development, test and debugging of the real target (no simulation) possible on the same PC with Visual Studio
  • Communication between desktop Windows and Windows CE via shared memory TCP/IP
  • Start and stop of the RTOS can be done after Windows is up and running by a Win32 application. This application can be built in into a user application (DLL).


Author Heinrich Munz is a strategic product manager at KUKA Roboter GmbH, a Windows Embedded MVP company.


(Click here for further information)


7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

4 Legal Reasons to Control Internet Access
The Internet is obviously a valuable resource for many organizations. However, many are exposed to legal liability concerns because they fail to control Internet access. Learn if you're safe in this white paper.

Rapidly Resolve J2EE Application Problems
Whether you are in the process of building J2EE applications or have J2EE applications already running in production, you must ensure that they deliver the expected ROI. Learn how in this white paper.

Load Testing 2.0 for Web 2.0
There are many unknowns in stress testing Web 2.0 applications. Find out how to test the performance of Web 2.0 in this white paper.

Build Better Games Online
For the game infrastructure providers, life is complex. Making money from games has become more complicated. Why? Find out in this white paper.

Building a Virtual Infrastructure from Servers to Storage
This white paper discusses the virtual storage solutions that reduce cost, increase storage utilization, and address the challenges of backing up and restoring Server environments.

Gaining Faster Wireless Connections with WiMAX
Welcome to what is quickly becoming the hyperconnected world where anything that would benefit from being connected to the network will be connected. Learn more in this white paper.

Is Your Desktop a Security Threat?
The new wave of sophisticated crimeware not only targets specific companies, but also targets desktops and laptops as backdoor entryways into those business’ operations and resources. Learn how to stay safe in this white paper.

Increasing SAN Reliability by 100 Percent
Storage area networks (SAN) are a strong part of storage plans. Learn how to increase your reliability and uptime by 100 percent in this case study.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

HOT TOPICS
2006 Windows Embedded retrospective
Windows CE 6 Arrives
Shared source contest winners
Ultra Mobile PCs
Spotlight on SPOT
Embedding Windows is 4X cheaper than Linux
CE "core" reduced to $3

...in our 2007
Windows Embedded Market Survey
Check out the latest Windows-powered...

mobile phones!

other cool
gadgets

REFERENCE GUIDES
Windows Device Showcase
Intro to Windows Embedded
Intro to Shared Source
Real-time Windows Embedded
Windows Embedded books

BREAKING NEWS

• Rack-mount automation computer runs Windows from flash
• Smallest GPS-equipped phone ever?
• Color e-paper rolls up for storage
• Windows XP leaps onto OLPC laptop
• "1-Watt" x86 processor powers pico-ITX board
• Webcast covers Windows Mobile development
• "Software-only" GPS supports WIndows
• Atom-based ECX board runs Windows
• $7 SoC runs Windows CE
• April XPe chat transcript available
• Little thin client runs Windows CE or XP Embedded
• Microsoft releases VS 2008, NET Framework 3.5 betas
• E-reader boasts 6-inch EPD display, Windows CE
• Thin clients bulk up on software
• Microsoft warns of Windows CE 5.0 security hole


Join our Windows Embedded discussion forums:
Windows XP Embedded
Windows CE
Windows Mobile


Windows Embedded developer newsgroups
Windows CE
XP Embedded
PocketPC
Smartphone

Microsoft's Windows Embedded resources
Embedded dev center
Mobile dev center
Windows CE tutorials
XP Embedded tutorials
Windows Embedded seminars
Windows Embedded application categories
3rd-party partners

Also visit our sister sites:


Sign up for WindowsForDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  Directory  |  About  |  Contact
 
Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Windows is a trademark or registered trademark of Microsoft Corporation in the United States and/or other countries and is used by WindowsForDevices under license from owner. All other marks are the property of their respective owners. WindowsForDevices is an independent publication not affiliated with Microsoft Corporation.