Topics in this chapter:
All Windows Embedded Compact components have parameter files. This includes BSPs and optional Catalog components. Any OS project has parameter files sourced from its BSP, selected components, the OS configuration and subprojects. There are has four types of parameter files, BIB, DAT, DB and REG.. These are all text files although they might have a structure based GUI based editor such as the Registry Editor.
BIB
DAT
DB
REG
When the operating system is built, all of the parameter files of selected components, the BSP and subprojects are copied to the release directory, filtered, merged and inserted into the operating system. binary image file (nk.bin) Filtering occurs because in some parameter files, there is optional inclusion of some entries depending upon upon SYSGEN variables.With subprojects, only the parameter files for projects that haven’t been configured to be excluded from the OS (although built with the OS) are merged.
Each BSP has a set of parameter files, platform.bib, platform.dat, platform.db and platform.reg. Each OS project has a set of top level parameter files, OSDesign.bib, OSDesign.dat, OSDesign.db and OSDesign.reg viewable in solution explorer at the top level. Custom entries for the OS can be directly inserted in these files. There are also Common parameter files, which are common to all OS projects.
.
Figure 24.1: Parameter files in an OS project
The BSP has a file config.bib that is used to configure the RAM memory layout of the OS, as well ROM memory mapping and compression options. A BIB file is also used effect the inclusion of content files in the OS image. These content files must be present in the OS release directory in the makeimage phase of the build and are directly copied there in the build process if they exist prior to the build, such as content such as image files. Other files such as OS catalog components are generated by the build process by compilation and/or linkage and placed in the release directory. All of these files, are placed in the \Windows directory when the OS boots.
BIB entries contain MODULES and FILES sections. The MODULES section contains executable and DLL files. The FILES section contains non-runnable content such as image files, Note that managed code applications are placed in the files section because their executable is actually the .NET CF runtime (which “interprets” them). Note also that files that run in the boot phase are placed in the FILES section of a BIB file.
A BIB file entry for a file is one line in either section, stating the name that the file is to take on the OS, followed by its source on the system. The development system reference can make use of Build Window environment variables. The entry can also include optional attribute flags such as being a system file, placed in the OS kernel space and compression.
The following is the BIB file entries for including the CoreCon3 application debugging connectivity files could be included in OSDesign,bib
MODULES ;Name Path Memory Flags ;-------------------------------------- ---------------------------------------------------- -------- -------- clientshutdown3.exe $(_FLATRELEASEDIR)\clientshutdown3.exe NK U CMAccept3.exe $(_FLATRELEASEDIR)\CMAccept3.exe NK U ConmanClient3.exe $(_FLATRELEASEDIR)\ConmanClient3.exe NK U DeviceAgentTransport3.dll $(_FLATRELEASEDIR)\DeviceAgentTransport3.dll NK U eDbgTL3.dll $(_FLATRELEASEDIR)\eDbgTL3.dll NK U TcpConnectionA3.dll $(_FLATRELEASEDIR)\TcpConnectionA3.dll NK U
FILES ;Name Path Memory Flags ;-------------------------------------- ---------------------------------------------------- -------- --------
Listing 24.1 CoreCon OSDesign.bib entries
NK places the places the files in the RAMIMAGE section. The U Flag means the files are uncompressed. Note that a batch file is required to copy these files from their source to the release directory prior to Makeimage phase of the build process. If there is an environment variable for their source on the development system, this could be used instead of the _FLATRELEASEDIR reference, For example the environment variable _CORECON3 could be defined as:
C:\Program Files (x86)\Common Files\Microsoft shared\Embedded Tools\CoreCon\11.0\Target\wce800\x86
then the batch requirement is removed), This path is the installed location of the x86 CoreCon3 files with Compact 2013
MODULES ;Name Path Memory Flags ;-------------------------------------- ---------------------------------------------------- -------- -------- clientshutdown3.exe $(_CORECON3)\clientshutdown3.exe NK U CMAccept3.exe $(_CORECON3)\CMAccept3.exe NK U ConmanClient3.exe $(_CORECON3)\ConmanClient3.exe NK U DeviceAgentTransport3.dll $(_CORECON3)\DeviceAgentTransport3.dll NK U eDbgTL3.dll $(_CORECON3)\eDbgTL3.dll NK U TcpConnectionA3.dll $(_CORECON3)\TcpConnectionA3.dll NK U
Listing 24.2 CoreCon OSDesign.bib entries that doesn’t require batch file to copy files
Alternatively a subproject could be generated that has these files as content, that has the first BIB file entry as its BIB file, and that copies those files to the release directory in is postlink.bat batch file. Such a project is generated later in this chapter in the CEComponentWiz section of this chapter.
The following BIB listing includes some image, sound and video files in the OS image file:
MODULES ;Name Path Memory Flags ;-------------------------------------- ---------------------------------------------------- -------- --------
Listing 24.3 OSDesign.bib- Some Media entries
Media files may require shortcuts and their placement in the wider file system of the OS (apart from \Windows). For example, image files may need a shortcut in My Pictures folder. This is covered in the Shortcuts and Directories section of this chapter.
The following BIB listing adds a Third Party application binary and its associated DLL plus an image file to the OS.
MODULES ;Name Path Memory Flags ;-------------------------------------- ---------------------------------------------------- -------- -------- ImageDisplay.exe $(_FLATRELEASEDIR)\ImageDisplay.exe NK U imaging.dll $(_FLATRELEASEDIR)\imaging.dll NK U
FILES ;Name Path Memory Flags ;-------------------------------------- ---------------------------------------------------- -------- -------- MyPicture.png $(_FLATRELEASEDIR)\MyPicture.png NK U
Listing 24.4 OSDesign.bib- A Third Party Binary
Warning: Binaries need to be recompiled for Compact 2013. Binaries from Compact 7 and earlier will not run on Compact 2013
When the OS starts all of the MODULE and FILE files are physically placed in the \Window directory. It is simpler when the file system is created as a RAM drive to then place shortcuts for those files in the file system folders as required. The DAT file contains specifications for the required folders in the file system, shortcuts for those files as well as to which folder each shortcut is placed.
A Shortcut is a simple text file with the extension .lnk. It consists of a single line stating the full path to file on the device (i.e. in \Windows) and the number of ASCII characters in that path. The length appears first, then a pound (#) symbol followed by the path. For example:
22#\Windows\MyPicture.png
Listing 24.5a A Sample Shortcut file
This shortcut is for the image file MyPicture.png and would be saved as MyPicture.lnk
If placed in say, \My Documents then applications can load the file using: \My Documents\MyPicture.png
It can still be loaded via its \Windows path though.
A DAT file is also a text file that explicitly specifies the required directories one level at a time and places the shortcut files in them. A sample DAT file follows:
root:-Directory("My Documents") Directory("\My Documents"):-Directory("My Pictures") Directory("\My Documents\My Pictures"):-File("MyPicture.lnk","\Windows\MyPicture.lnk")
root:-Directory("My Documents")
Directory("\My Documents"):-Directory("My Pictures")
Directory("\My Documents\My Pictures"):-File("MyPicture.lnk","\Windows\MyPicture.lnk")
Listing 24.6 A Sample DAT file
This creates the folders \My Documents and \My Documents\My Pictures if they don’t already exist. It then copies MyPivture,lnk to \My Documents\My Pictures. Applications can then reference the file via that link.
Registry entries in OSDesign.reg (and other .reg files in the OS) have the RegEdit4 registry format and are just text files. Custom registry entries placed in OSDesign.reg will be merged into the operating system’s registry. As example, consider Portable Network Graphic (PNG) image files. In Compact 7, the default application to display images was IE (iesample.exe) but the PNG files had no such association. The following registry entry can be added to OSDesign,reg to create that association in a target OS. Note though that there is no IE in Compact 2013 so a suitable alternative application is required.
[HKEY_CLASSES_ROOT\.png] @="pngfile" "Content Type"="image/png" [HKEY_CLASSES_ROOT\pngfile] @="Bit Image" [HKEY_CLASSES_ROOT\pngfile\DefaultIcon] @="iesample.exe,-108" [HKEY_CLASSES_ROOT\pngfile\Shell\Open\Command] @="iesample.exe %1"
[HKEY_CLASSES_ROOT\.png]
@="pngfile"
"Content Type"="image/png"
[HKEY_CLASSES_ROOT\pngfile]
@="Bit Image"
[HKEY_CLASSES_ROOT\pngfile\DefaultIcon]
@="iesample.exe,-108"
[HKEY_CLASSES_ROOT\pngfile\Shell\Open\Command]
@="iesample.exe %1"
Listing 24.7 OSDesign.reg entry to create a PNG file association.
Amongst the various tools for Windows Embedded Compact, there is a tool for generating CAB (.cab) files for installing applications on a Compact device. This can be used to install runnable applications on an existing (and running) OS. It can also be used on an existing device to retro-add content in much the same manner as a BIB file places files on a system at startup. A INF (.inf) file is required that configures the installation.
1. Create the INF file in a text editor
2. Build the cab file:
3. Install cab file on device:
The OS documentation covers the syntax of the .inf and the command line options. CEComponentWiz simplifies this by generating a INF file for a content list etc. which builds a CAB file when the project is built
NEXT: 24.2 Introduction to CEComponentWiz
Click here to provide feedback and input