Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
Microsoft Corporation
August 2000
Summary:This paper describes how the modules and components of Microsoft Windows CE can be selected, combined and configured to create a customized version of the operating system. (21 printed pages)
Introduction
The Windows CE operating system, first introduced in 1996, has
been specifically designed for resource-constrained embedded
applications. There are literally thousands of such applications,
including products as diverse as handheld communications devices,
commercial building automation systems, manufacturing process
controllers, consumer electronic products and medical data
acquisition devices. A common requirement of these devices is the need to reduce the
amount of hardware (RAM, ROM and other resources) required for
implementation. Windows CE has been designed to meet the need for a
smaller, more efficient, powerful and customizable 32-bit operating
system. Microsoft Windows CE is an operating system designed for a wide
variety of embedded systems and products, from handheld PCs and
consumer electronic devices to specialized industrial controllers
and embedded communications devices. The Windows CE operating
system has proven itself capable of handling the most demanding
32-bit embedded applications by bringing the full power of
Microsoft 32-bit programming and operating systems technology to
the embedded systems developer. An important aspect of Windows CE for embedded systems is its
high degree of modularity. As you will learn in this paper, Windows
CE is actually a collection of operating system modules and
components that can be selected and configured to meet the needs of
a specific embedded application or product. Using Microsoft Windows
CE Embedded Toolkit for Visual C++, embedded systems developers are
able to create a version of Windows CE that is customized and
optimized for their unique hardware platforms and applications. This paper describes how the modules and components of Microsoft
Windows CE can be selected, combined and configured to create a
customized version of the operating system. This paper:
The need for simplification in embedded systems is often based
on cost (as in the case of consumer electronic devices), but may
also be driven by other factors such as system reliability, strict
power budgets or physical size limitations. Consider the following
aspects of a typical embedded system:
The last point is of particular importance. The operating system
chosen for an embedded system must not get in the way of the
embedded application. In many cases it is not even required (or
desirable) that the application user know what operating system is
being used inside the embedded system or product. In this
environment, an operating system that can be reduced to its core
functionality and adapted to the limited resources
available—without unnecessarily compromising other design goals—is
of paramount importance. For example, consider the design of a home automation system.
This product may incorporate the functions of a climate control
system (heating, ventilation and air conditioning), as well as
control of lights, a remote alarm system, intercom, telephone
answering system, and more advanced features, such as energy usage
monitoring. This is an example of an embedded application that may
require a substantial (although simplified) graphical interface,
but in which there is no requirement to expose to the user any
elements of the underlying operating system, or to utilize such
hardware features as a keyboard. This information appliance,
although relatively complex, will have only a limited need for many
of the features of a complete operating system. In support of embedded applications such as this, Windows CE is
designed to be efficient, customizable and modular. The result is
an operating system in which specific features (such as
communications, graphical user interface, and support for
specialized input devices) can be easily selected, configured or
removed altogether to create a customized, application-specific
operating system. Before describing the modules and components that make up
Windows CE, it is important to understand, from a higher level,
what Windows CE is and what it is not. Those unfamiliar with
Windows CE may have a mistaken notion that it is simply a reduced
feature-set version of an existing operating system (such as the
Microsoft Windows NT operating system). The truth is that Windows
CE was developed from the ground up as a small-footprint, highly
customizable and modular operating system for embedded
applications. The Windows CE kernel borrows much of what is best
from other Microsoft 32-bit operating systems, while eliminating
(or replacing) those operating system features that are not needed
for typical Windows CE-based applications. That result is that
Windows CE is compact and customizable. In fact, it is possible to
create a version of the Windows CE kernel that requires less than
200K of ROM. Unlike other 32-bit Windows operating systems, Windows CE
operating system code resides and executes in ROM. Depending on
your product requirements, you may also choose to place application
code in ROM. For example, Pocket Word, Pocket Excel and other
application programs included with an H/PC are provided in ROM. Because programs stored in ROM execute in place in Windows CE,
your embedded applications can function with only a modest amount
of RAM, for such purposes as stack and heap storage. Alternatively,
your application may make use of RAM for program memory as well as
for temporary storage. To further increase the performance of application software,
Windows CE features on-demand paging: the operating system only
needs to uncompress and load a small portion of a RAM-based program
for execution. The flexibility and speed of ROM- and RAM-based
programs mean that devices based on Windows CE can be constructed
with a wide variety of memory configurations. On the development side, programmers targeting Windows CE have
access to a wide variety of familiar development environments,
including Microsoft Visual C++ and Visual Basic development
systems. The Windows CE application programmer interface (API) is
consistent with the Win32 API used in other 32-bit Windows
platforms, making it easy to create new applications, or (as
appropriate) to port existing desktop applications. For customizing
Windows CE for a specific type of hardware, including selecting and
configuring the appropriate modules and components, Microsoft
provides the Windows CE Embedded Toolkit for Visual C++. This set
of tools gives you everything you need to build, download to your
target platform and debug a version of Windows CE that includes
your application software and only those Windows CE operating
system components that are required to support that component. Because minimal memory requirement is a major design goal,
Windows CE is built from a number of discrete modules. You can
control the size ("footprint") of the operating system software by
selecting only the modules that you need. Several of these modules
are also further divided into components. By selecting a minimum
set of modules and components, you can minimize the hardware
resources (ROM and RAM, in particular) needed to support your end
product. Windows CE modules that include one or more optional components
are referred to as component modules. Examples of component modules
include Coredll, Gwes, Filesys, and Ole32. Each of these modules
provides full or partial support for major features of the
operating system, and can be tailored to serve the needs of a given
embedded application. The Windows CE kernel (represented by the Coredll module)
provides the base operating system functionality that must be
present on all platforms. The kernel is responsible for memory
management, process management, and certain required file
management functions. It manages virtual memory, scheduling,
multitasking, multithreading, and exception handling. Most components of the Coredll module are required for any
configuration of Windows CE. There are some optional kernel
components, however, that are needed when you are including other
operating system features (and corresponding modules) such as
telephony, multimedia and GDI graphics. The Filesys module supports the Windows CE object store API
functions. These API functions support a ROM-based file system, a
RAM-based file system, a structured storage system (the Windows CE
database), and a system registry. The file system also supports
multiple installable file systems. An implementation of the FAT
File System is provided to support files stored on external media
such as PC Cards. These various file system components can be
selected or omitted during the operating system build process to
include only those file system features that are required. The
following are a few typical combinations of file system components:
Windows CE can be custom-configured to support any of these file
system combinations. If you are experienced with programming for Windows, you are
probably familiar with the Win32 User and GDI (Graphics Device
Interface) subsystems of desktop Windows platforms, as exposed in
the Win32 API. Windows CE combines the User and GDI subsystems into
one component module called the Graphics, Windowing, and Events
Subsystem (Gwes). The event manager and window manager in Gwes are
analogous to the User subsystem of Win32, while the Win32 GDI
sub-system is replaced with a smaller multi-platform GDI (MGDI)
more suitable for Windows CE-based devices. The Gwes module is responsible for user interface and windowing
features of Windows CE. Gwes implements the window, dialog, and
control manipulation capabilities of the system. Gwes is also
responsible for displaying graphics and text on graphics display
devices and for performing sophisticated graphics manipulations.
Application software, and Windows CE itself, use the MGDI features
of Gwes extensively for the visual display of user interface items
such as menus, scroll bars, and icons. The Gwes components can be
organized into the following general areas:
In addition to the primary component modules Filesys and Gwes,
other operating system modules are available, including modules and
components in the following categories:
Each module or component provided in Windows CE supports a group
of related API functions that are available to the application
developer. All defined modules and components, and their
corresponding APIs, are listed in the documentation provided with
the Microsoft Windows CE Embedded Toolkit for Visual C++. Another modular aspect of Windows CE is its device driver
architecture. Windows CE supports two fundamental categories of
device drivers: built-in drivers and installable drivers. As the
name implies, built-in device drivers are intended for devices that
are built into a given Windows CE-based hardware platform. An
embedded system designer using Windows CE is responsible for
providing the built-in drivers to operate any devices to be
included with the system. For example, some Windows CE-based
applications require a custom touch-sensitive LCD screen. The
designers of such products are responsible for providing device
driver software for their devices in order to allow the Windows CE
operating system to use the touch screen device. In the complete
system, these built-in drivers reside in ROM along with the
customized Windows CE kernel. Installable device drivers are for any peripheral devices that
can be temporarily connected to a Windows CE platform. This covers
devices such as modems, printers, digital cameras, PC Cards (also
known as PCMCIA cards), and other external devices. Windows CE
platforms are different from desktop computers in their method of
adding hardware. With a desktop PC, a computer user can open the
case and plug an expansion card directly into the data bus. This
generally means that device driver software for these types of
expansion cards must run in kernel mode because of their need for
direct access to whatever memory locations control the hardware.
Windows CE platforms, on the other hand, do not offer any end-user
access to the data bus, and new hardware cannot be added in that
fashion. In Windows CE, all additional hardware must be connected
to the Windows CE platform via external connectors such as serial
ports, PC card slots, or USB ports. This puts peripheral devices
for Windows CE in a similar situation to printers on normal PCs;
device driver software for both runs as user-mode processes that
use the services of built-in hardware in order to control their
devices. The device driver architecture of Windows CE has been designed
to streamline the process of creating drivers, while at the same
time reducing system resource requirements and maintaining fast
device interrupt processing. Whether your application uses built-in
drivers, installable drivers, or both, it will benefit from the
ways in which Windows CE minimizes device resource
requirements. Installable device drivers for Windows CE are dynamically linked
libraries (DLLs). You create them in very much the same way as you
create a DLL for the Windows 95 or Windows NT operating
systems. The primary job of an installable device driver is to expose the
services of a peripheral device to applications. In much the same
way as in other Windows operating systems, presenting the device as
a special file in the file system does this. All installable device
driver DLLs expose the same entry points. Those entry points
correspond to the standard Win32 file I/O functions, such as
OpenFile,
ReadFile,
DeviceIOControl, and others. In addition, Windows CE
requires some additional entry points related to maintaining a
device's state while the Windows CE platform is turned off. Creating a version of Windows customized for your application
and hardware requirements is easy, if you have the right tools. The
Windows CE Embedded Toolkit for Visual C++ includes everything you
need to build the Windows CE operating system and port it to your
new hardware. Remote debugging tools make it possible to test and
debug your embedded application, and sample drivers simplify the
process of supporting new custom hardware devices. Windows CE Embedded Toolkit for Visual C++ is integrated into
the Visual C++ for Windows CE integrated development environment
(IDE) and provides additional capabilities for embedded software
developers, including:
Windows CE and the Embedded Toolkit support a wide variety of
embedded processors, including: Hitachi SH3, Sh1; DEC SA-1100, ARM
720T; NEC VR4102, VR4111, VR4300; IBM and Motorola PPC821,
PPC403GC; Philips PR31500; Toshiba TX3912; AMD ElanSC400, and the
Intel 486DX and Pentium family of processors. Additional members of
these CPU families may also run Windows CE but have not yet been
certified in Microsoft test labs. If you are creating a fully customized product, including the
hardware, your first step will be to determine the hardware and
application requirements and build a customized version of Windows
CE that meets those requirements. When developing a new hardware
platform and its supporting I/O devices, you will be making
decisions and tradeoffs at different levels in the design. For
example, unless you are relying exclusively on common,
off-the-shelf hardware, you will almost certainly need to write
custom device drivers to support one or more peripheral devices.
You may also need to configure Windows CE to include the necessary
device handling components, and to customize the OEM abstraction
layer (OAL) of Windows CE for your hardware. At the application level, you will need to write interface code
that meets the requirements of the devices in your system. The
Windows CE Driver Development Kit (included in the Embedded
Toolkit) provides the information and examples you need to create
Win32-capable device drivers. To create a customized version of Windows CE that meets the
unique requirements of your hardware platform, you must:
As you can see, there are many steps required to create and
implement a customized version of Windows CE. Fortunately, the
Embedded Toolkit provides you with a rich set of tools intended to
simplify this process, allowing you to focus on implementing and
debugging your embedded application. The Embedded Toolkit also
includes sample operating system builds so you can better
understand the steps required. Selecting an appropriate set of Windows CE modules and
components for a given embedded application can be a complex,
time-consuming task. There are many optional modules and components
from which to choose, and many interdependencies among these
modules and components. To simplify the process of selecting
modules and components, the Embedded Toolkit includes a number of
pre-tested configurations. The following four samples illustrate a
few of these formally tested configurations. The base kernel project, provided in the Embedded Toolkit,
demonstrates how to configure Windows CE for a minimal application
that includes user input (keyboard) support, does not include
display capability, and has only minimal device and communications
facilities. This version of Windows CE contains the minimum number
of components required to build the Gwes and CoreDLL modules and
includes the components needed to build the file system module,
database, registry, and password components. Two additional
variations of this project are provided in the Embedded Toolkit
that remove optional components such as the RAM file system and
database. A sample application is included with the project that
accepts keyboard input and displays the appropriate keyboard (VK)
codes to the debug serial port. This sample configuration supports the following features:
To support these features, the sample project includes the
following modules and components: This Embedded Toolkit sample project, like the one previously
described, builds a partial version of Windows CE with no user
interface components. This version does, however, include most of
the data communications and networking components available in
Windows CE, including TCP/IP, PPP, NDIS, IRComm, IRDA, Serial,
WinInet, Secure sockets, NTLM authentication, TAPI, Unimodem and
Redir. Variations of this project allow the inclusion of only the
IRComm, IRDA, and Serial components, or the TCP and NDIS
components. This demonstration project includes the source code for a simple
communications application called RASDEMO. This sample application
creates a phone book entry on the target platform and attempts to
connect with a specified RAS server. The project makes use of the
following Windows CE features:
This sample project includes the following Windows CE modules
and components (depending on the build variation): This demonstration project builds a nearly complete version of
the Windows CE file system, including Gwes and CoreDLL. The
configuration includes support for touch pad input devices, audio,
and other features common to handheld PCs (H/PCs) and other
handheld devices, but includes only a minimally configured Gwes
module with no window management support. This sample project provided with the Embedded Toolkit includes
an application (POLYGONS.EXE) that tests the graphic output of the
target platform. This sample project provides support for the following Windows
CE features:
In support of these features, the project includes the following
Windows CE modules and components: This sample project includes nearly all modules and components
available for Windows CE, including complete graphic and drawing
support, TrueType fonts, OLE interfaces, communications, PC Card
(PCMCIA) devices and other advanced features. This sample
represents the typical feature set of a handheld PC (H/PC). Two sample applications are provided in the Embedded Toolkit to
assist in validating the configuration. This sample project provides support for the following Windows
CE features:
This sample project includes the following Windows CE modules
and components: This paper has shown how the Windows CE operating system can be
custom-configured for the unique needs of an embedded application.
The modular architecture of Windows CE, coupled with its compact
and efficient design, makes it possible to create highly efficient
embedded applications while retaining all the benefits of a widely
understood and consistent programming interface. For information about creating your own customized shell using
the shell support components, see
Implementing a Custom Shell On a Microsoft
Windows CE 2.1-based Device. Complete documentation about the tools and process used to build
the Windows CE operating system is included with the Microsoft
Windows CE Embedded Toolkit for Visual C++ 5.0.
Windows CE Modules and Components
Customizing Windows CE
Sample Configurations
Summary
Introduction
Streamlining Embedded Systems
Windows CE for Embedded Applications
Windows CE Modules And
Components
Operating System Kernel Components
File System Components
Graphic, Windowing and Event Components
Other Components and Modules
Supporting Devices with Windows CE
Customizing Windows CE
Porting Windows CE To New Hardware
Sample Configurations
Sample Configuration: Base Kernel
Modules/components
Related sample applications
CoredllOperating core DLL module (required)
coremainRequired component
corelocRequired component
fmtmsgCoreDLL component
lmemRequired component
thunksRequired component
FilesysFile system module
fsdbaseDatabase component
fsmainFile system main component
fsysramRAM and ROM file system component
fsheapHeap file system component
fsregRegistry component
fspassPassword component
pmstubPost message stub component
NkOperating system kernel (required)
ToolhelpToolhelp (debugger support) module
ShellDebugging shell
Sample Configuration: Adding Communications
Module/component name
Description
AfdAFD module
ArpARP module
CardservCard services (PCMCIA driver) module
CoredllOperating core DLL module (required)
coremainRequired component
corelocRequired component
lmemRequired component
thunksRequired component
fmtmsgCoreDLL component
rectapiGDI support component
wmgr_cWindow manager component
serdevSerial device support component
tapilibTAPI telephony support component
cryptapiCryptography component
rsa32RSA encryption component
CxportCommon transport utilities component
DeviceInstallable device manager module
DhcpDynamic host configuration module
Elnk3Elnk3 module
FilesysFile system module
fsmainFile system main component
fsysramRAM and ROM file system component
fsheapHeap file system component
fsregRegistry component
GwesGraphics, windowing and event module
calibruiTouch pad calibration U/I component
mgbaseGDI base component
mgbitmapGDI bitmap component
mgbltBitBlt component
mgblt2Bitmap transfer support component
mgdcDevice context support component
mgdibsecCreateDIBSection API component
mgdrawDrawing and drawing tool component
mgdrwtxtText drawing support component
mgpalPalette support component
mgprintPrinting support component
mgrgnDrawing region support component
mgttTrueType font support component
mgwinmgrScrollDC support component
wmbaseGWES base component
gweshareGWES component
gwesmainGWES main component
immthunkThunking component
msgqueMessage queue component
loadstrString loading component
tchuiTouch pad U/I component
gsetwinlongGet/SetWindowLong component
IrcommIrDA communications module
IrdastkIrDA stack module
NdisNDIS network module
Ne2000NE2000 module
NetbiosNetbios module
NetdetecNetwork detect (ping) module
NetuiNetwork U/I module
NkOperating system kernel (required)
NtlmsspNtlmssp module
PppPoint-to-point protocol module
RedirRedirector module
RsabaseRSA encryption module
Secur32Security Support Provider Interface module
SchannelSSL/PCT secure socket layer
ShellDebugging shell module
TapiTAPI support module
TcpstkTCP/IP stack module
ToolhelpToolhelp (debugger support) module
WinsockWinsock services module
sslsockSSL Winsock support component
UnimodemUnimodem module
WininetInternet support module
inetftpFTP protocol component
Sample Configuration: Adding Minimal Display
Capabilities
Module/component
Description
CoredllOperating core DLL module (required)
coremainRequired component
corelocRequired component
fmtmsgCoreDLL component
lmemRequired component
thunksRequired component
mgdi_cGDI support component
rectapiGDI support component
wmgr_cWindow manager component
FilesysFile system module
fsmainFile system main component
fsysramRAM and ROM file system component
fsheapHeap file system component
fsregRegistry component
fspassPassword component
fsdbaseDatabase component
GwesGWES module
calibruiTouch pad calibration U/I component
foregndForeground window component
getpowerBattery power component
gsetwinlongGet/SetWindowLong component
gweshareGWES component
gwesmainGWES main component
idleSystem idle component
immthunkThunking component
kbduiKeyboard interface component
loadstrString loading component
mgbaseGDI base component
mgbitmapGDI bitmap component
mgbltBitBlt component
mgblt2Bitmap transfer support component
mgdcDevice context support component
mgdibsecCreateDIBSection API component
mgdrawDrawing and drawing tool component
mgrgnDrawing region support component
mgwinmgrScrollDC support component
mgttTrueType font support component
mgprintPrinting support component
mgdrwtxtText drawing support component
mgpalPalette support component
msgbeepMessageBeep API component
msgqueMessage queue component
nledNotification LED component
tchuiTouch pad U/I component
uibaseUser interface base component
wmbaseGWES base component
NkOperating system kernel (required)
ShellDebugging shell
ToolhelpToolhelp (debugger support) module
Sample Configuration: Adding Window
Management
Module/component
Description
AfdAFD component
AtadiskATA disk support module
CegsmCEGSM module
ConsoleConsole component
CoredllOperating core DLL module (required)
accel_cCreateAccelerator table component
coreimmInput method manager component
coremainRequired component
corelocRequired component
coresiowWide string formatting fns component
corestrwWide stdio fns component
lmemRequired component
thunksRequired component
fmtmsgCoreDLL component
fpemulFloating point emulation component
rectapiGDI support component
wmgr_cWindow manager component
serdevSerial device support component
tapilibTAPI telephony support component
mgdi_cGDI support component
wavelibMultimedia support component
CxportCommon transport utilities module
DeviceInstallable device manager module
FatfsFAT file system module
FilesysFile system module
fsmainFile system main component
fsysramRAM and ROM file system component
fsheapHeap file system component
fsregRegistry component
fspassPassword component
fsdbaseDatabase component
GwesGWES module
accelAccelerator component
audioAudio component
btnctlButton control component
calibruiTouch pad calibration U/I component
caretCaret component
cascadeCascading menu component
cdlctlCandidate list control component
clipbdClipboard component
cmbctlCombo box control component
defwndprocDefine window procedure component
dlgmgrDialog manager component
dlgmnemDialog mnemonics component
edctlEdit control component
foregndForeground window component
gcacheGWES initialization component
getpowerBattery power component
gsetwinlongGet/SetWindowLong component
gwectrlGWES base component
gweshareGWES component
gwesmainGWES main component
iconIcon component
iconcmnCore icon component
iconcursMouse cursor component
idleSystem idle component
imgctlImage control component
immthunkThunking component
kbduiKeyboard interface component
lbctlListbox component
loadstrString loading component
loadbmpBitmap loading component
loadimgImage loading component
mcursorCursor component
mcursor8Standard window cursor component
menuMenu component
menuscrlScrolling menu component
msgbeepMessageBeep API component
msgboxMessage box component
msgbox2Color message box component
mgbaseGDI base component
mgbitmapGDI bitmap component
mgbltBitBlt component
mgblt2Bitmap transfer support component
mgdcDevice context support component
mgdibsecCreateDIBSection API component
moverlapOverlapping menu component
mgdrawDrawing and drawing tool component
mgrgnDrawing region support component
mgwinmgrScrollDC support component
mgrastFont support component
mgrast2Font support component
mgdrwtxtText drawing support component
mgpalPalette support component
mgpalnatNatural Palette component
msgqueMessage queue component
mtapuiTap menu U/I component
nclientNon-client window area component
nledNotification LED component
oomOut of memory component
oomuiOut of memory U/I component
scbctlScroll bar control
startuiStartup dialog U/I component
startupStartup component
stcctlStatic control component
tchuiTouch pad U/I component
timerTimer component
uibaseUser interface base component
winmgrWindow manager component
wmbaseGWES base component
IrcommIrDA communications module
IrdastkIrDA communications support module
NdisNetwork driver component
NetuiNetwork U/I module
NkOperating system kernel (required)
NtlmsspNTLMSSP module
Ole32OLE support module
comCOM interface support component
olemainOLE main component
Oleauto32OLE Automation module
PppPoint-to-point protocol module
Secur32Security Support Provider Interface module
ShellDebugging shell module
SramdiskSRAM (PCMCIA) card device module
TapiTAPI telephony module
TcpstkTCP/IP stack module
ToolhelpToolhelp (debugger support) module
UuidUUID support module
UnimodemUnimodem support module
WaveapiMultimedia sound API module
WininetInternet services support module
inetftpInternet file transfer component
WinsockWinsock support module
sslsockSSL Winsock component
Summary
For More Information