WINCE Build Process Overview and Build Commands used in Visual Studio2005


1.     Introduction

This article will cover the WINCE 6.0 build process and the process of different build commands which used from Visual Studio2005. WINCE build process contains several phases includes compile the source code, copy modules and files to a common release directory, and create the run-time image. Batch files and build tools, such as the Sysgen tool (Sysgen.bat) and the Make Binary Image tool (Makeimg.exe), automate this process. You can run these tools directly at the command prompt or start the build process in Microsoft Platform Builder for Windows Embedded CE 6.0 R2 (the process of doing this is out of scope of the article, future it can be added).

2.     Scope

The Scope of the article is to target mainly towards who wants to know the WINCE6 build process and different build commands available and its step by step process.

3.     Different Phases of Build

a)      Compile Phase/Pre Sysgen Build
b)      Sysgen Phase
c)      Post Sysgen Phase
d)      Build Release Directory
e)      Make Run Time Image Phase
These are the four phases of WINCE 6.0 build process. They carried out sequentially. And can be processed separately by selective build options for reducing the build time.

Fig: Build Process OverView

Ø   Compile Phase/PreSysgen Phase

Compiler and linker use source code and resource files to generate executable (.exe) files, static (.lib) libraries, dynamic-link library (.dll) files, and binary resource (.res) files according to the selected locales. The build system compiles the source code in the Private and Public folders into .lib files during this phase. This process can take several hours to complete, but it is seldom required to rebuild these components because binaries are already provided by Microsoft. In any case, you should not modify the source code in the Private and Public folders.

Ø  Sysgen Phase

Filters and combines modules and components based on OS Design settings. The build system sets or clears SYSGEN variables based on the catalog items and dependency trees included in the OS design, filters the header files and creates import libraries for the Software Development Kits (SDKs) defined in the OS design, creates a set of run-time image configuration files for the OS designs, and builds the BSP based on the source files in the Platform directory.

Fig: Sysgen Phase

 

Ø  Post Sysgen Phase

Compile source code in BSP and user subprojects. The build system processes the source files of your Board Support Package and applications using the files generated during the Sysgen phase. At this time, hardware-linked drivers and the OEM adaptation layer (OAL) are built. Although the processes during the build phase are carried out automatically during the Sysgen phase, it is important to understand that if you modify only the BSP and subprojects, then you can rebuild the BSP and subprojects without running the Sysgen tool again.

Fig: Post Sysgen Phase

Ø  Build Release Directory

Copy output files to release directory in preparation for making OS run-time image (NK.BIN). This includes the .lib, .dll, and .exe files created during the Compile and Sysgen phases, as well as binary image builder (.bib) and registry (.reg) files. The build system might skip this phase if headers and libraries are up-to-date. The process includes following steps,
a)      Copies OS binaries and configuration files from the OS design directory to the release directory
b)      Copies project binaries and configuration files from the OS design directory to the release directory
c)      Copies BSP binaries and configuration files from the BSP directory to the release directory
d)      Binaries automatically copied to release directory when built if WINCEREL environment variable is set.

Ø  Make Run Time Image Phase

Create operating system image. The build system copies project-specific files (Project.bib, Project.dat, Project.db, and Project.reg) to the release directory and assembles all files in the release directory into a run-time image. Directives based on environment variables specified in .reg and .bib files control which catalog items the build system includes in the final run-time image. The run-time image is typically a file named Nk.bin, which you can download and run on the target device. Merges release folder files to create the Windows CE image based on a set of configuration files The process includes the following steps,
a)      Merge configuration files:
  • All .BIB files into CE.BIB All .reg files into REGINIT.INI
  • All .dat files into INITOBJ.DAT
  •  All .db files into INITDB.INI
b)      Compress reginit.ini in a binary registry file (DEFAULT.FDF)
c)      Replace resources in .exe and .dll for language adaptation
d)      From ce.BIB, combine binaries and files into a Windows CE image (NK.BIN)

4.     Build Commands in Visual Studio 2005

Ø  Advanced Buil


Commands
Operations
Sysgen

This Build command will links the .lib files in the Public and Private folders to create the files for the run-time image. The files remain in the WinCE folder of the OS design. Depending on global build settings, the build process can automatically advance to the Release Copy and then make Run-time Image phases.

Clean Sysgen

This Build command will cleans out intermediate files created during previous builds before running the Sysgen tool. Use this option if you added or removed files or catalog items after a previous Sysgen session to reduce the risk of build errors.
Build And Sysgen
Compiles the entire contents of the Public and Private folders, and then links the files by using the settings in your OS design. This process takes several hours and is only necessary if you modified the contents of the Public folder. Unless you modify the Windows Embedded CE code base (not recommended), you should not use this option.

Rebuild And Sysgen

Cleans out intermediate files created during previous builds in the Public and Private folders, and then runs the Build and Sysgen steps. You should not use this option
Build Current BSP And Subprojects
Builds the files in the directory for the current BSP and any subprojects in the OS design, and then runs the Sysgen tool. Note that this option will build other BSPs than the ones used in the current OS design, so make sure your BSPs are compatible with each other or remove unused BSPs.

Rebuild Current BSP And Subprojects
Cleans out intermediate files created during previous builds, and then runs the Build Current BSP And Subprojects steps
Build All Subprojects
Compiles and links all subprojects, skipping any files that are up-to-date
Rebuild All Subprojects
Cleans, compiles, and links all subprojects.
Build All SDKs
Builds all SDKs in the project and creates corresponding Microsoft Installer (MSI) packages. Because there is generally no reason to create debug versions of MSI packages, use this option only for a Release build configuration
Copy Files To Release Directory
Copies the files generated for the BSP and other components during the Compile and Sysgen phases to the release directory in order to include these file in the run-time image
Make Run-Time Image
Make Run-Time Image takes all the files in the release directory to create the run-time image. Following this step, you can download the run-time image to a target device

5.    Build and Rebuild Commands

Commands
Operations
Build Solution
Equivalent to the Sysgen command on the Advanced Build Commands submenu.
Rebuild Solution
Equivalent to the Clean Sysgen command on the Advanced Build Commands submenu.
Clean Solution
Cleans the release directory by deleting all intermediate files

6.    Conclusion


From the article you can knw some basic knowledge about the WINCE 6.0 Build process and different build commands available in Visual Studio 2005 and their process.

Comments

Popular posts from this blog

Drawing National flag using Java Applet

CELog and Kernel Tracker

WinCE Essentials Volume and File Control