Partager via


Optimize Configuration Files (Compact 2013)

3/26/2014

Your OS project contains several types of configuration files, not all of which affect system performance. This topic describes how to improve performance by customizing the configuration files that affect it — the ce.bib file, DIRS files, and DAT files.

Config.bib File

To customize Romimage.exe output to optimize the image size and file performance, use the CONFIG Section of the Config.bib file. You can also use the Config.bib file to create an absolute binary data (.abx) file version of your ROM image, which contains the raw binary image. For more information, see Romimage Tool (romimage.exe).

The Config.bib file also offers a number of options that you can specify in the CONFIG section to optimize your system. The following list describes the CONFIG section options that are most commonly used to improve performance:

  • AUTOSIZE If you store your image in RAM, you can set all RAM that the image does not occupy as system RAM and object store RAM without modifying the memory parameters set in the .bib files. If you set AUTOSIZE = ON, Romimage.exe combines the system RAM and run-time image memory regions into one region. The run-time image fills this region from the lowest address to the highest address, and modifies RAM parameters in the system’s Table of Contents so that the system can use all remaining RAM.
    For example, if you have a 5-MB image and you install it on a device that has 20 MB of RAM, the system assigns 10 MB for the image itself and 10 MB for system RAM. However, this leaves 5 MB of unused RAM. If you use AUTOSIZE, your image occupies 5 MB of the available RAM on the device, and you can pool the remaining 15 MB to use as system RAM and object store RAM.
     

  • COMPRESSION If you set COMPRESSION = ON, Romimage.exe compresses the writable sections in your image. If the data and files in the writable sections are compressed, the kernel uncompresses them as it loads them into RAM. Using compression means that file size is smaller, but load time is longer. You must also add the compression component to the image.

    Note

    The system always automatically copies writable sections to RAM, even if they are not compressed.

  • FSRAMPERCENT Use FSRAMPERCENT to specify the percentage of RAM you want to allocate to the file system. By default, FSRAMPERCENT defines 50 percent of RAM for the file system. You can adjust this to reduce the percentage of RAM available to the file system, and make more RAM available to the system to use.

For more information about the options available in the Config.bib file, see Binary Image Builder (.bib) FileCONFIG Section.

DIRS File

Use the directories (DIRS) file to specify the subdirectories that contain the source code you want the Build Tool (Build.exe) to build into your image. By including only the source code directories necessary to support your platform, you can speed up your build process and minimize your image size. To exclude source code directories, wrap the directory in a @CESYSGEN IF tag in both the DIRS file and the platform.bib file. This ensures that the dependency relationships match.

For example, if you wanted to include the MYWAVE1 driver when the WAVE API component is selected, the entry in your platform.bib file would look like the following:

; @CESYSGEN IF CE_MODULES_WAVEAPI
   
IF BSP_WAVEDEV_MYWAVE1
mywave1.dll          $(_FLATRELEASEDIR)\mywave1.dll                 NK SHK
ENDIF BSP_WAVEDEV_MYWAVE1
   
; @CESYSGEN ENDIF CE_MODULES_WAVEAPI

To make sure the dependencies match, you also need a corresponding entry in the DIRS file for the driver directory, as shown in the following example:

DIRS=\
# \@CESYSGEN IF CE_MODULES_DEVICE
# \@CESYSGEN IF CE_MODULES_WAVEAPI
    mywave1\
# \@CESYSGEN ENDIF CE_MODULES_WAVEAPI
# \@CESYSGEN ENDIF CE_MODULES_DEVICE

Tip

Build.exe builds the source code in the directory in which it runs, and in any subdirectories named in the DIRS file. To update only a part of your image without rebuilding all of it, run Build.exe in the subdirectory you want to update.

For more information about the DIRS file, see Dirs File.

DAT Files

Because .dat files generally contain application-specific data, consider employing one or more of the following approaches:

  • Generate a .dat file after startup. This approach reduces the size of the nk.bin file, but can lead to a delay when the application is initialized on first use.
  • Compress all .dat files. List the .dat files in the FILES section and do not change the default compression setting.
  • Include only a placeholder .dat file in nk.bin. If the application must have a .dat file, but the file can be populated on first startup of the application, consider including an empty .dat file in your project for the application to initialize on application startup.

See Also

Concepts

Optimize ROM Size