1 / 23

Dissecting the Windows CE Build Process

Dissecting the Windows CE Build Process. James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc. Agenda. Build Architecture Command Line Tools Extending the Build Controlling the Build Build Strategies Build Scenarios (Labs) Complete Session Evaluations.

nfaulkner
Download Presentation

Dissecting the Windows CE Build Process

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Dissecting the Windows CE Build Process James Y. Wilson Principal Engineer, Windows Embedded MVP CalAmp, Inc.

  2. Agenda • Build Architecture • Command Line Tools • Extending the Build • Controlling the Build • Build Strategies • Build Scenarios (Labs) • Complete Session Evaluations

  3. Build Architecture • Defines initial build environment • Executes build for PUBLIC and PRIVATE tree • Selects build targets through SYSGEN_ variables and knowledge of intermodule dependencies. • Builds PLATFORM COMMON and BSP trees. • Constructs content of release directory • Calls user defined batch files at various points in the Build and Sysgen stage. Environment Variables Batch Files Build Make Files Sysgen Make File

  4. Build Architecture • “Common Build” aka “Build” • Builds Private and Public source trees (generates mostly LIB files) • “Sysgen” • Assigns SYSGEN_, results in _MODULES, and _COMPONENTS variables assignment • Combines selected (_MODULES and _COMPONENTS) component LIB files into DLL and EXE modules • Filters header files, .BIB files, .REG files, etc. • Builds BSP and Platform Common trees • Builds Workspace tree • Populates RELDIR • Creates OS Image file • Essentially, everything else in the build

  5. Build Architecture Establishes environment variables used globally, generates DEPTREE, loads developer and project specific environment WinCE.bat Initiates build from within command shell initialized by WinCE.bat BldDemo.bat Enumerates DEPTREE entries, and calls CeBldTree.bat for each entry CeBuild.bat If enabled builds (compiles) source tree (DEPTREE entry) in Private and Public (Common Build). Initiates Sysgen. CeBldTree.bat Called to build (compile) specified source tree using Build.exe CeBuild1.bat Enumerates DEPTREE entries, and calls project specific batch file and CeSysgen.bat for each entry, in four passes (preproc, pass1, pass2, and report). Finally calls “make” to generate EXE and DLL targets. Sysgen.batCeSysgen.bat

  6. Build Architecture Runs CeSysgen.bat (same as above), then builds Platform source tree. SysgenPlatform.bat Enumerates DEPTREE entries, and calls BuildRel1.bat for each. BuildRel.bat

  7. Make Files • MAKEFILE: Rules referenced in Makefile.def • SOURCES: Assigns variables defining source files, target type, and build options • SOURCES.CMN: Contains common SOURCES file entries (in parent directory). • _OBJECTS.MAC: List of .obj targets produced during dependency scan. • DIRS: Used by Build.exe when performing dependency scan

  8. Command Line Tools • Build.exe • Processes DIR file • Identifies dependencies, determines which files to build after scanning • Calls NMake.exe to perform compilation • CEFilter.exe • Processes @CEFILTER statements to filter out contents of build and header files for undefined SYSGEN_ • PBXMLUtils.exe • Used to generate environment (variables and files) from existing PB workspace • Used during build to generate certain batch files just before execution

  9. Command Line Tools • SysgenMake.exe • Used instead of NMake.exe when auto cloning enabled • Overrides .lib file dependencies using specially formatted environment variables • Appears to call NMake.exe after override

  10. Inspecting Build Progress • Build.log • Provides more detailed build output, including full error strings • SysgenSettings.out • Allows inspection of final SYSGEN_ variables set • MakeImg.out • Contains output from image creation

  11. Customization: Batch File Hooks

  12. Customization: Batch File Hooks

  13. Directory Structure • C:\WINCE500\PUBLIC\CEBASE\OAK\MISC:Contains SysGen batch files • C:\WINCE500\PUBLIC\COMMON\OAK\MISC:Contains build command batch files • C:\WINCE500\PLATFORM: Contains drivers and kernel code changes • C:\WINCE500\PBWorkspaces:Contains RELDIR, local Public tree, cloned projects • C:\WINCE500\PBWorkspaces\%_TGTPROJ%\WINCE500\%_TGTPLAT%\OAK\MISC:Contains parent CESysgen, and a CESysgen hook batch file • OAK/DDK/SDK build product folders:OAK contains platform specific modules and libs, DDK contains platform specific interface components, SDK contains Microsoft supplied platform independent, modules and components

  14. Platform Builder Options • Build OS • “Sysgen”: Use when Public SYSGEN_ variable has changed • “Build and Sysgen”: Use when code in Public tree has changed • “Build and Sysgen Current BSP”: Use when Platform SYSGEN_ variable has changed or Platform code has changed • Build Project • “Build and Sysgen Current Project”: Used when project consists of Public component or module • “Build Current Project”: Used for all Platform projects and anything else

  15. Build Strategies • Create ALL source code in PBWorkspace and Platform (only if making BSP) tree • Clone (see Lab for manual cloning) to minimize changes to Platform tree • Try hard to avoid changes to Public tree • Strive for a Workspace only build (unless creating a BSP) to provide a greater degree of “Project Portability”

  16. Build Strategies • Build without generating a new OS image and use RelDir mirroring to download changes • Reserve OS image generation for flashing image to target • Build in background console window(s) • Build using –M {n+2} even on uniprocessor systems for 30% to 40% enhancement • Build on XP x64, install using link in references

  17. Lab Exercise 1 Creating a Command Line Build Environment

  18. Lab Exercise 2 Manual Cloning of a Platform Common Component

  19. Lab Exercise 3 Manual Cloning of a Public Driver

  20. Lab Exercise 4 Using External IDE’s

  21. Conclusion • PBWorkspaces provides total flexibility to modify PUBLIC and PLATFORM components • Possible to customize an OS design entirely from PBWorkspaces • Various options are provided to hook into build • Ability to maintain command line build configured from PB IDE • Running multiprocessor builds saves time, more common as dual core processors proliferate

  22. References • Visit http://www.LearningCE.com for more discussion on this topic • For a batch file debugging and command shell replacement see: http://www.jpsoft.com/ • Provides single-step debugging • Compatible with default XP command shell • For information on PB install under XP x64 see: http://blogs.msdn.com/mikehall/archive/2006/04/24/582444.aspx

  23. Please Complete Session Evaluations

More Related