|
|
Understanding Windows CE 5.0's configuration file formats
2005-03-24
Foreword: A variety of configuration parameters are required to fully specify a Windows CE system. This information is contained within a number of text files of various types. In particular, .REG, .DB, .DAT, and .BIB files serve to define and configure a Windows CE system.
Mike Hall, a technical product manager on Microsoft's Windows CE team, puts these files in context and describes their syntax in this brief technical article. REG Files REG files for the Windows CE build process use almost the same format as REG files for the other Windows versions. The primary difference is that the REG version marker is removed from the top of the file. This prevents you from accidentally merging a Windows CE REG file into your development workstation's registry, as the default action for double clicking a REG file is normally to merge the data instead of editing the file. (I feel sorry for and am thankful to the first guy that did that and learned the hard way what a problem that would be!) The syntax is fairly straightforward. A key name is specified in brackets based on one of the system-defined keys. Data is assigned to sub-keys using the key name, data type, and data value, with @ identifying the key's default value. In this example, a new key is created for the MegaSoft software company for their KillerApp. The following values are added to that key.
DAT files DAT files are used to specify how the file system should initialize the RAM file system structure when the system is cold booted. You can create a complete file system structure in the RAM system to meet your application and end-user needs. The file system will copy any files specified in the initobj.dat file into the folders they are listed for. Keep in mind that all ROM files exist in the \Windows\ folder already, so copying EXE and DLL files to RAM-based folders in a DAT file just wastes space. Instead, you should create a shortcut file to reference the EXE in the windows folder. The syntax for a DAT file is a bit odd but not complicated: This sample creates the Program Files folder off of the root of the file system. Inside that folder, it creates a new one called KillerApp, and lastly it copies the KillerApp shortcut (.LNK file) to the newly created folder. The user can now navigate to Program Files\KillerApp and click on the shortcut to start the application.DB files DB files define the default RAM-based property database for the object store. The syntax is a bit cryptic, but it is documented. For Platform Builder-generated systems, it is rare to need to use the database at all, except to set up the automatic connection for ActiveSynch, as follows: This DB file will set up the notification database to run REPLLOG whenever an RS232 event is triggered. This will start the connection process on the default "hot plug" port for ActiveSync.BIB files ROMIMAGE uses Binary Image Builder (BIB) files to configure how it should configure the ROM. BIB files are just plain text files with keywords defining four different sections. The modules section is identified with the keyword MODULES on a line of its own. In the modules section, executable modules are listed for code that will execute in place (XIP). The files section (keyword FILES) lists other files to place in the image (bitmaps, data files, HTML pages, and so on). It can also specify executable modules not intended for XIP. Rarely used diagnostic applications are a good candidate for that. The items in the files section are compressed by default to reduce the size. The syntax is pretty straightforward for the entries of the modules and files sections: Target Name is the name of the file as it will appear in the ROM. Workstation path is the path ROMIMAGE will use to find the actual file (normally based on $(_FLATRELEASEDIR)). The memory section will be "NK" with few exceptions. (Boot loaders are a common exception).The flags are summarized in the following table:
The remaining two sections of BIB files are normally placed in the Config.bib file (merged with the other BIB files in the makeimg phase to generate ce.bib). These are the memory section, and the config section. The memory section, which describes the memory layout for your system, has the following syntax: where TYPE is one of the following:
The config section specifies a number of miscellaneous settings, including the size and width of ROM if you are using the raw binary image format (ABX=ON). About the Author: Mike Hall is Technical Product Manager on the Microsoft Windows CE team. Among other things, he writes an extensive (and often entertaining) blog that's published on Microsoft's MSDN developer website.
|