Top Banner
Optimizing Platform Builder in Windows Embedded Compact 7 Douglas Boling Boling Consulting Inc.
24

Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Mar 20, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Optimizing Platform Builder inWindows Embedded Compact 7

Douglas Boling

Boling Consulting Inc.

Page 2: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

About Douglas Boling

• Independent consultant specializing in Windows Mobile and Windows Embedded Compact (Windows CE)

– On-Site Instruction

– Consulting and Development

• Author

– Programming Embedded Windows CE

• Fourth Edition

Page 3: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Agenda

• Configuring a build machine

• Understanding Virtual Machines

• Quick overview of the build process

Page 4: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Building the Operating System

Page 5: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Basic Concepts

• Windows Embedded Compact build is “disk bound”

– Speed of compilation is limited by the speed of the storage device

– Super fast CPU isn’t much help

– Huge amounts of RAM not much help

• PB 6 and PB 7 are incompatible

– Never install them on the same machine

– Yes, I know this is very frustrating

• Know how things work

– Knowing Sysgen process allows developer to skip steps

Page 6: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Development Machines

• Choose Win32/Win64 depending on machine

– Win32 for PB 6, 4 GB RAM PCs

– Win64 for high RAM PCs

• When you want to use Virtual Machines

• Two physical disks

– OS disk

– Big build tree disk

• Never throw away old builds that work

– Also need lots of space when using Virtual Machines

Page 7: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Build Setup

• Use at least 2 physical disks

– Primary drive: OS and apps

– Data drive: Big disk with build tree (d:\wincexxx)

• Keep paths 8.3, AK build tree drive letters c: or d:

– Make data drive BIG

• Keep old builds around

• Keep old release directories

Page 8: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Win32 vs Win64

• Windows Embedded CE 6 Platform Builder

– Doesn’t support Win64

• Generally works but subtle breaks in some tools

• These may have been fixed over the years but still unsupported.

• Windows Embedded Compact 7 Platform Builder

– Supports Win32 and Win64

• In both versions

– Old CEPC “Bldr” bootloader won’t build under Win64

• Requires DEBUG.EXE script that won’t run under Win64

Page 9: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Build Speed Tweaks

• Builds take lots of time

– Best if you can avoid building

– But when you do, here are some things that help…

Page 10: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Build Setup (Hard Disk)

• Faster disk == faster builds

– Good:

• At least 7200 RPM

– Better:

• RAID disk (RAID 0 with backup)

– Best:

• Solid State Disk (SSD)

• Enable multi-processor builds

– Set BUILD_MULTIPROCESSOR=0

• Counter intuitive environment variable

Page 11: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Build Setup: Temp Directory

• Reassign TEMP and TMP directory defaults

– Default TEMP and TMP assignments slow

– Good: Reassign to c:\temp

Page 12: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Temp Dir to RAM Disk

• If Win32 system, use a RAM Disk

– Find a good RAM disk on Web

• Gavotte Ramdisk with GUI

– www.mydigitallife.info/2007/05/27/free-ramdisk-for-windows-vista-xp-2000-and-2003-server/

– Supports large disk sizes, any FAT and NTFS

– No need to reboot after install or disk resize

– Installs as R:\

Page 13: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Build Setup (Virus Software)

• Turn off virus checking for build tree

– X:\wincexxx

– %temp% directory or %temp% drive

• Turn off virus checking for build tools

– Build.exe

– cl.exe

– link.exe

– nmake.exe

– Others, if you notice them…

Page 14: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Using Virtual Machines

• Enables multiple Platform Builder installations

– Different instance in each VM

• Need a PC with lots of RAM

– Each VM requires as much RAM free as is set in the VM

– PB needs around 1.5 MB

• Enable Ethernet controllers for KITL

• Enable integration features

– Allows access to host machine hard disks

Page 15: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Virtual Hard Disk Setup

• Use a differencing virtual hard disk

– Bases new hard disk images off previously created core disk

• On Base disk, install

– OS

• Activate OS in base image

– Visual Studio 2005 (for CE 6)

– Visual Studio 2008 (for WEC 7)

– Other standard apps you prefer

• Create differencing disk and install PB on top of base disk

Page 16: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Setting up Base Virtual Machine

• Windows 7

– Open Virtual PC folder from Start Menu

– Select Create Virtual Machine

– Select name of the Virtual PC

– Set RAM to 1.5 MB or greater

– Select Create a dynamically sized virtual hard disk

– Install the base OS

– Start the image, enable auto-update and update OS

– Once complete, shut down VM and mark base disk read only

• Never open the base VM again

Page 17: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Checklist for Base Disk

• Install all your generic apps

– Activate any software necessary

• Be sure to turn on Windows Update to add all fixes

• Configure the shell the way you like it

• Shut down the VPC (not hibernate/suspend)

• Mark the disk as read only

Page 18: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Differencing Virtual Hard Disk

• Create new Virtual Machine

– Open Virtual PC folder from Start Menu

– Select Create Virtual Machine

– Select name of the Virtual PC

– Set RAM to 1.5 MB or greater

– Select “Differencing Disk”

– Point to base disk image

Page 19: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

The Build Process

• Operating system built before BSP (Platform)

• Builds are fairly independent of each other

• Only rebuild entire system if catalog changes

• BSP changes can be done

– “Build current BSP and subprojects”

• Makeimg only necessary if changing low level files

– Otherwise, new files can be pulled down via KITL

• If modules listed in “Release Directory Modules” list

Page 20: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Command Line Builds

• Building from the Command Line is the most flexible

• Command line configured via environment variables

– IMGNOKITL, BSP_NOxxx, etc.

• Only way to know the environment variables is to examine the BSP

– Platform.reg/bib and various SOURCES files

– Learning these is the key to understanding the build

Page 21: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

3 Ways to Open a Build Window

• IDE method:

– Use Build | Open Build Release Directory in Build Window

• In the Explorer Shell

– Navigate to \wince600\OSDesigns\<design>\<design>

– Right click on <design>.pbxml file

– Select “Open Build Window” menu item

• Command line method

– Change directory to \wince600\OSDesigns\<design>\<design>

– Type: PBOpenBuildWindow.exe <design.pbxml>

• Platform Builder bin directory must be in path

Page 22: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Environment variable use

• Build environment tracks many environment variables by their existence, not their value

• Example

– IMGNOKITL=1 Asserted condition

– IMGNOKITL= Non-asserted condition

• Don’t do this

– IMGNOKITL=0 This is the asserted condition

• As always, there are exceptions

– WINCEDEBUG=debug, WINCEDEBUG=retail, WINCEDEBUG=checked

Page 23: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Summary

• A tuned build machine can save time

• Understand how to create differencing virtual hard disks

• Understand the build process

Page 24: Optimizing Platform Builder in Windows Embedded Compact 7download.microsoft.com/download/F/D/D/FDDC7E09-3929... · Optimizing Platform Builder in Windows Embedded Compact 7 Douglas

Questions…

Doug Boling

Boling Consulting Inc.

www.bolingconsulting.com

dboling @ bolingconsulting.com