introduction to embedded software development school of software engineering 2005 5. os development

89
Introduction to Embedded Introduction to Embedded Software Development Software Development School of software School of software Engineering Engineering 2005 2005 5. OS Development 5. OS Development

Upload: clarence-wiggins

Post on 26-Dec-2015

219 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Introduction to Embedded Software Introduction to Embedded Software DevelopmentDevelopment

School of software EngineeringSchool of software Engineering

20052005

5. OS Development5. OS Development

Page 2: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

AgendaAgenda

Introduction to Platform BuilderIntroduction to Platform Builder User InterfaceUser Interface Catalog and FeatureCatalog and Feature Platform ConfigurationPlatform Configuration

Platform Creation workflowPlatform Creation workflow

The Build SystemThe Build System

Catalog CustomizationCatalog Customization

Page 3: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

AgendaAgenda

Introduction to Platform BuilderIntroduction to Platform Builder User InterfaceUser Interface Catalog and FeatureCatalog and Feature Platform ConfigurationPlatform Configuration

Platform Creation workflowPlatform Creation workflow

The Build SystemThe Build System

Catalog CustomizationCatalog Customization

Page 4: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Introduction to Platform Introduction to Platform BuilderBuilder

An integrated development environment An integrated development environment (IDE) for building customized embedded (IDE) for building customized embedded platforms based on the Microsoft Windows platforms based on the Microsoft Windows CE operating system (OS). CE operating system (OS).

Comes with all the development tools Comes with all the development tools necessary for you to design, create, build, necessary for you to design, create, build, test, and debug a Windows CE–based test, and debug a Windows CE–based platform.platform.

The IDE provides a single integrated The IDE provides a single integrated workspace in which you can work on both workspace in which you can work on both platforms and projects. platforms and projects.

Page 5: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

What can PB do? (1)What can PB do? (1)

The New Platform Wizard assists in creating a The New Platform Wizard assists in creating a new platform. new platform.

The BSP Wizard streamlines the process of The BSP Wizard streamlines the process of creating a board support package (BSP). creating a board support package (BSP).

The Catalog displays a list of OS features that The Catalog displays a list of OS features that can be used to customize a platform. can be used to customize a platform.

Automated dependency checking ensures all Automated dependency checking ensures all features required to support a platform features required to support a platform configuration are included in the OS image. configuration are included in the OS image.

The Export Wizard exports custom Catalog The Export Wizard exports custom Catalog features to other Platform Builder users. features to other Platform Builder users.

Base configurations provide starting points for Base configurations provide starting points for creating custom OSs. creating custom OSs.

Page 6: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

What can PB do? (2)What can PB do? (2) The Windows CE Test Kit provides a collection of driver-The Windows CE Test Kit provides a collection of driver-

testing tools. testing tools. The kernel debugger debugs a customized OS image The kernel debugger debugs a customized OS image

and provides the user with information regarding the and provides the user with information regarding the performance of that image. performance of that image.

The application debugger debugs applications on a The application debugger debugs applications on a customized OS image. customized OS image.

The remote tools perform a variety of debugging and The remote tools perform a variety of debugging and information gathering tasks on a Windows CE–based information gathering tasks on a Windows CE–based target device. target device.

The Emulator speeds and simplifies development by The Emulator speeds and simplifies development by emulating hardware, allowing the user to test platforms emulating hardware, allowing the user to test platforms and applications on a development workstation. and applications on a development workstation.

The Export SDK Wizard enables the user to export a The Export SDK Wizard enables the user to export a custom software development kit (SDK). custom software development kit (SDK).

Page 7: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Review of Platform WizardReview of Platform WizardThe New Platform Wizard guides you through the process of creating a Windows CE–based platform.

Page 8: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Platform Wizard 4 StepsPlatform Wizard 4 Steps

1.1. Selecting an installed board support Selecting an installed board support package (BSP). package (BSP).

2.2. Selecting a platform configuration for Selecting a platform configuration for your device. your device.

3.3. Selecting a configuration variant that Selecting a configuration variant that is appropriate for your device. is appropriate for your device.

4.4. Selecting additional features for your Selecting additional features for your platform. platform.

Page 9: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Platform Builder UIPlatform Builder UI

Text Editor

Workspace Window

Search Text

Connectivity Device Name

Output Windows

Debug tool status

indicators

Multiple views of the workspace

Build Configuration

Page 10: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Catalog ViewCatalog View

Consists of a list of Consists of a list of BSPs, drivers, BSPs, drivers, configurations for core configurations for core OS, and Platform OS, and Platform Manager transports. Manager transports. The items in the The items in the Catalog represent Catalog represent ALLALL the technologies you the technologies you can select when can select when designing your designing your Microsoft Windows CE Microsoft Windows CE based platform.based platform.

Page 11: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

• Board Support Packages Board Support Packages

• Core OS: includes headless devices and display-based devices: Core OS: includes headless devices and display-based devices:

• Applications and Services Development Applications and Services Development

• Applications - End User Applications - End User

• Communication Services and Networking Communication Services and Networking

• Core OS Services Core OS Services

• File Systems and Data Store File Systems and Data Store

• Fonts Fonts

• International International

• Internet Client Services Internet Client Services

• Multimedia Technologies Multimedia Technologies

• Security Security

• Shell and User Interface Shell and User Interface

• Device Drivers Device Drivers

• Platform Manager Platform Manager

Catalog organizationCatalog organization

Page 12: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Feature Group and FeatureFeature Group and Feature

A feature group defines a general type A feature group defines a general type of feature without specifying a specific of feature without specifying a specific implementation. A feature group is implementation. A feature group is resolved when you select an resolved when you select an implementation and thus specify the implementation and thus specify the functionality. functionality.

A feature is any logical grouping of OS A feature is any logical grouping of OS components. components.

Page 13: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Feature Icon TypeFeature Icon TypeIconIcon DescriptionDescription

BSP BSP

Core OS design Core OS design

Catalog item group.Catalog item group.

Required Catalog item.Required Catalog item.

Optional Catalog item.Optional Catalog item.

Catalog item, type, or implementation excluded from the current OS Catalog item, type, or implementation excluded from the current OS design. design.

FolderFolder

Catalog item that has one or more special notifications.Catalog item that has one or more special notifications.

Catalog properties for a specific implementation of a Catalog item. Catalog properties for a specific implementation of a Catalog item.

ImplementationImplementation

Page 14: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Feature Icon Type (2)Feature Icon Type (2)

IconIcon DescriptionDescriptionUser-specified Catalog item.User-specified Catalog item.

Catalog item (optional).Catalog item (optional).

Catalog item that can be built but is excluded from the run-time Catalog item that can be built but is excluded from the run-time image.image.

Catalog item excluded from the build and the run-time image. Catalog item excluded from the build and the run-time image.

Source code file.Source code file.

Page 15: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Feature PropertyFeature Property

Displays information for the selected Displays information for the selected feature. feature.

Page 16: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Feature DependencyFeature DependencyShow the dependency of a selected Show the dependency of a selected featurefeature

Page 17: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Challenge for EngineerChallenge for Engineer

Know as many Know as many features as features as

possiblepossible

Page 18: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Challenge for EngineerChallenge for Engineer

Requires your experience and Requires your experience and knowledgeknowledge

Can NOT design required platform Can NOT design required platform without this.without this. Can Windows CE has a Chinese IME?Can Windows CE has a Chinese IME? Does Windows CE support VBScript?Does Windows CE support VBScript?

Detailed feature functionality reference Detailed feature functionality reference at :at : About Windows CE.NET -> Catalog About Windows CE.NET -> Catalog

FeaturesFeatures

Page 19: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Platform SettingPlatform SettingEnables you to view and modify options for individual Enables you to view and modify options for individual features and for an entire platform. features and for an entire platform.

Menu : Menu : Platform -> Settings…Platform -> Settings…

Page 20: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Build Options (1)Build Options (1) Enable CE Target Control Support Enable CE Target Control Support

Select the Enable CE Target Control Support check box to Select the Enable CE Target Control Support check box to enable target control support during the boot process. enable target control support during the boot process. Selecting this also enables Kernel Independent Transport Selecting this also enables Kernel Independent Transport Layer (KITL). Layer (KITL).

Enable Eboot Space in MemoryEnable Eboot Space in Memory Select Enable Eboot Space in Memory to reserve memory Select Enable Eboot Space in Memory to reserve memory

space in the Config.bib file. This allows the boot loader to space in the Config.bib file. This allows the boot loader to save data that the operating system (OS) can read at boot save data that the operating system (OS) can read at boot time. time.

Enable Event Tracking during Boot Enable Event Tracking during Boot Select Enable Event Tracking to start the event-tracking Select Enable Event Tracking to start the event-tracking

subsystem. subsystem. Enable Full Kernel ModeEnable Full Kernel Mode

Select Enable Full Kernel Mode to run threads in kernel Select Enable Full Kernel Mode to run threads in kernel mode. Enabling full kernel mode will leave the entire mode. Enabling full kernel mode will leave the entire system vulnerable, but will increase performance. system vulnerable, but will increase performance.

Enable Image for Flash Enable Image for Flash Select the Enable Image for Flash check box to allow the Select the Enable Image for Flash check box to allow the

image to be written to flash after download. image to be written to flash after download.

Page 21: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Build Options (2)Build Options (2) Enable Kernel DebuggerEnable Kernel Debugger

Allow the debugger to connect and pass debugging information Allow the debugger to connect and pass debugging information from the target device to the host device. from the target device to the host device.

Enable KITLEnable KITL Select the Enable KITL check box to enable KITL. This should be Select the Enable KITL check box to enable KITL. This should be

checked to allow communication between the development checked to allow communication between the development workstation and the target device. Deselecting this will also workstation and the target device. Deselecting this will also deselect Enable CE Target Control Support if it is selected. deselect Enable CE Target Control Support if it is selected.

Enable Profiling Enable Profiling Select the Enable Profiling check box to enable Windows CE log Select the Enable Profiling check box to enable Windows CE log

kernel profiling in the platform image. kernel profiling in the platform image. Enable Ship Build Enable Ship Build

This flag can be used to conditionally compile code. If set, the OS This flag can be used to conditionally compile code. If set, the OS will provide verbose debug messages to aid debugging. will provide verbose debug messages to aid debugging.

Flush Events to Release Directory Flush Events to Release Directory Select the Flush Events to Release Directory check box to flush Select the Flush Events to Release Directory check box to flush

events to the release directory. Selecting this also turns on Event events to the release directory. Selecting this also turns on Event Tracking. Tracking.

Page 22: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Platform Configuration FilesPlatform Configuration FilesPlatform Builder uses two general categories of configuration files:

• source code configuration filessource code configuration files

The Build tool uses source code configuration files to build modules and features, and to build the source code for your operating system (OS) image.

• image configuration filesimage configuration files

The Make Binary Image Tool calls a number of tools, which use image configuration files to create the OS image.

Page 23: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Source code configuration filesSource code configuration files

File typeFile type DescriptionDescription

DirsDirs File File Identifies subdirectories that contain Identifies subdirectories that contain source code.source code.

Sources FileSources File Contains the macro variables needed to Contains the macro variables needed to build source code.build source code.

MakefileMakefile File File Contains the variables needed to Contains the variables needed to compile and link the source code.compile and link the source code.

Page 24: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Image Configuration FilesImage Configuration Files

Parameter ViewParameter View

Page 25: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Configuration Files: .BIB FilesThe Configuration Files: .BIB Files

Indicates the modules and components that Indicates the modules and components that should be included in the imageshould be included in the image

Text files with four types of sections:Text files with four types of sections: The FILES section: Memory reservation for static The FILES section: Memory reservation for static

data filesdata files

The MODULES section: Specifies object module to The MODULES section: Specifies object module to be loaded in memorybe loaded in memory

;Name Path Memory Type-----------------------------------------------------Tahoma.ttf $(_FLATRELEASEDIR)\Tahoma.ttf NK SHU

;Name Path Memory Type-----------------------------------------------------Tahoma.ttf $(_FLATRELEASEDIR)\Tahoma.ttf NK SHU

Taskman.exe $(_FLATRELEASEDIR)\Taskman.exe NK Taskman.exe $(_FLATRELEASEDIR)\Taskman.exe NK

Page 26: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Configuration Files: .BIB FilesThe Configuration Files: .BIB Files

MEMORY section MEMORY section defines the platform memory informationdefines the platform memory information Partitions the physical memory into Data Partitions the physical memory into Data

memory and Program memorymemory and Program memory

The CONFIG sectionThe CONFIG section Is not mandatoryIs not mandatory Is used to set properties, such as Is used to set properties, such as

compression or ROM sizecompression or ROM size

Name Start address Size(bytes) Type-----------------------------------------------NK 8C800000 00800000 RAMIMAGERAM 8C050000 007AFFFF RAM

Name Start address Size(bytes) Type-----------------------------------------------NK 8C800000 00800000 RAMIMAGERAM 8C050000 007AFFFF RAM

Page 27: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Configuration Files: .REG FilesThe Configuration Files: .REG Files

Define default registry settingsDefine default registry settings COMMON.REG, IE.REG, COMMON.REG, IE.REG,

WCEAPPS.REG, WCESHELL.REG: WCEAPPS.REG, WCESHELL.REG: define registry settings for Windows define registry settings for Windows CE modulesCE modules

PLATFORM.REG: platform-PLATFORM.REG: platform-dependent registry settings, such as dependent registry settings, such as device drivers entriesdevice drivers entries

PROJECT.REG: defines registry PROJECT.REG: defines registry settings relative to your projectsettings relative to your project[HKEY_LOCAL_MACHINE\init]

“Launch10”=“shell.exe”“Launch20”=“device.exe”

[HKEY_LOCAL_MACHINE\init]“Launch10”=“shell.exe”“Launch20”=“device.exe”

Page 28: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Configuration Files: .DAT FilesThe Configuration Files: .DAT Files

Define folder structures of your Define folder structures of your imageimage COMMON.DAT, IE.DAT, COMMON.DAT, IE.DAT,

WCEAPPS.DAT, WCESHELL.DATWCEAPPS.DAT, WCESHELL.DAT PLATFORM.DAT PLATFORM.DAT PROJECT.DATPROJECT.DAT

Example:Example:Root:-Directory(“Program Files”)Directory(“\Program Files”):-Directory(“My Projects”)

Root:-Directory(“My Documents”)Directory(“\My Documents”):-File(“MyFile.doc”,“\Windows\Myfile.doc”)

Root:-Directory(“Program Files”)Directory(“\Program Files”):-Directory(“My Projects”)

Root:-Directory(“My Documents”)Directory(“\My Documents”):-File(“MyFile.doc”,“\Windows\Myfile.doc”)

Page 29: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Configuration Files: .DB FilesThe Configuration Files: .DB Files

Define default image databasesDefine default image databases COMMON.DB, WCEAPPS.DB, COMMON.DB, WCEAPPS.DB,

WCESHELL.DB WCESHELL.DB These .DB files are the databases relative to the These .DB files are the databases relative to the Common, Wceapps, and Wceshell modulesCommon, Wceapps, and Wceshell modules

PLATFORM.DBPLATFORM.DBThe PLATFORM.DB file contains the platform-The PLATFORM.DB file contains the platform-specific default databases specific default databases

PROJECT.DBPROJECT.DBThe PROJECT.DB file contains the project-The PROJECT.DB file contains the project-specific default databasesspecific default databases

Page 30: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Making an ImageMaking an Image Merges release folder files to make the Merges release folder files to make the

Windows CE imageWindows CE image ProcessProcess

Merge configuration files:Merge configuration files:All .bib files into CE.BIB All .bib files into CE.BIB All .reg files into REGINIT.INIAll .reg files into REGINIT.INIAll .dat files into INITOBJ.DAT All .dat files into INITOBJ.DAT All .db files into INITDB.INIAll .db files into INITDB.INI

Compress reginit.ini in a binary registry file Compress reginit.ini in a binary registry file (DEFAULT.FDF)(DEFAULT.FDF)

Replace resources in .exe and .dll for Replace resources in .exe and .dll for language adaptationlanguage adaptation

From ce.bib, combine binaries and files into a From ce.bib, combine binaries and files into a Windows CE image (NK.BIN)Windows CE image (NK.BIN)

Page 31: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Build PhasesThe Build Phases

Sysgen phaseSysgen phase Feature Build phaseFeature Build phase Release Copy phaseRelease Copy phase Make Image phaseMake Image phase

when you select the Build Platform command on the Build menu in the IDE, the build system builds a platform in four sequentially executed phases:

Page 32: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Sysgen phase tasksSysgen phase tasks1.1. Link the corresponding static libraries into modulesLink the corresponding static libraries into modules

2.2. Make SDKMake SDK1.1. filters the system header files, creating headers that only filters the system header files, creating headers that only

contain prototypes for the functions exported by your platform.contain prototypes for the functions exported by your platform.

2.2. Create Import libraries for the system modules Create Import libraries for the system modules

3.3. Build the board support package (BSP)Build the board support package (BSP)

Page 33: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

System GenerationSystem Generation

Complete header and source code

files

Complete system libraries

Module definitions (.def)

Cesysgen.bat

System-specific

header files

Linked libraries

Specific .def files

SYSGEN.BAT

Page 34: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Feature Build phase taskFeature Build phase task

All user features including Platform Builder All user features including Platform Builder project (.pbp) files, dirs files, sources files, project (.pbp) files, dirs files, sources files, and makefiles (.mak) files are compiled and and makefiles (.mak) files are compiled and built. built.

Page 35: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Release Copy phase taskRelease Copy phase task

Copy all the files you need to make an OS Copy all the files you need to make an OS image to the release directory. The modules image to the release directory. The modules and files created during the Sysgen phase and files created during the Sysgen phase are copied to this directory first, followed by are copied to this directory first, followed by the files created by the Feature Build phase. the files created by the Feature Build phase.

Page 36: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Make Image phase taskMake Image phase task

The files in the release directory are The files in the release directory are combined in the binary image file Nk.bin.combined in the binary image file Nk.bin.

This phase corresponds to the This phase corresponds to the Make ImageMake Image command on the Build menu. command on the Build menu.

Page 37: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Build ProcessThe Build ProcessCOMMON

DATASYNCDCOM

DIRECTXIE

RDPSCRIPT

SERVERSWCEAPPSFE

WCESHELLFE…

..\cesysgen\ddk

..\cesysgen\oak

..\cesysgen\sdk\target, \files

Step 1. System Generation

Step 2. Build

Step 3. Building the Release Directory

Step 4. Making an Image

NK.BIN

..\platform\..\target, \files

%_FLATRELEASEDIR%

Page 38: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Build ResultBuild Result

nk.bin : nk.bin : Windows CE binary image data formatWindows CE binary image data format when executed, must loaded into memory when executed, must loaded into memory

first.first. Organize code and data in sectionsOrganize code and data in sections

nk.nb0 : nk.nb0 : Absolute Binary Data Format Absolute Binary Data Format Can be flashed into flash ROMCan be flashed into flash ROM Can be executed by using Can be executed by using XIPXIP

Page 39: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Introduction to XIPIntroduction to XIP

Short for Execute In PlaceShort for Execute In Place

An application can execute code An application can execute code directly from read-only memory (ROM) directly from read-only memory (ROM) rather than having to load it from rather than having to load it from random access memory (RAM). random access memory (RAM).

Supported by NOR flashSupported by NOR flash

Page 40: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

How to resolve Build ErrorHow to resolve Build Error

1.1. Watch the Watch the OutputOutput window window No enough hard disk spaceNo enough hard disk space Compile & link errorCompile & link error

2.2. Examine Examine Build.log & Build.errBuild.log & Build.err files in files in WINCE420 root directoryWINCE420 root directory Detailed output informationDetailed output information

Leverage your Windows Programming Leverage your Windows Programming experience and knowledge to solve experience and knowledge to solve problems. problems.

Page 41: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Explaining Build ErrorsExplaining Build ErrorsErrors during the SysgenErrors during the Sysgen

Caused by missing files, missing configuration of the Caused by missing files, missing configuration of the operating system features, and applications built operating system features, and applications built during the Sysgen phaseduring the Sysgen phase

Errors during the Module build phasesErrors during the Module build phases Compilation errors or unresolved link errorsCompilation errors or unresolved link errors

Errors during the building the release directory Errors during the building the release directory phasephase File copy errorsFile copy errors

Errors during the making an image phaseErrors during the making an image phase Romimage.exe failed in CE.BIBRomimage.exe failed in CE.BIB Romimage.exe failed in reginit.iniRomimage.exe failed in reginit.ini Warning: Image exceedsWarning: Image exceeds

Page 42: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

HomeworkHomework

Read the “CEPC How-to Topics” and Read the “CEPC How-to Topics” and “Tutorial: Using Platform Builder with “Tutorial: Using Platform Builder with a CEPC” from Online Documentation a CEPC” from Online Documentation and try to download and run your and try to download and run your windows CE on x86 hardwarewindows CE on x86 hardware

Hint :Hint :1.1. Make wince boot disk and configure the Make wince boot disk and configure the

IP addressIP address

2.2. Build your WinCE with cepc BSPBuild your WinCE with cepc BSP

3.3. Boot a machine with your boot diskBoot a machine with your boot disk

4.4. Connect & download with TCP/IPConnect & download with TCP/IP

Page 43: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

AgendaAgenda

Introduction to Platform BuilderIntroduction to Platform Builder User InterfaceUser Interface Catalog and FeatureCatalog and Feature Platform ConfigurationPlatform Configuration

Platform Creation workflowPlatform Creation workflow

The Build SystemThe Build System

Catalog CustomizationCatalog Customization

Page 44: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Review of App developmentReview of App development

Get platform & SDK from OEMs

Coding & Testing

Release to Manufacture

Export your SDK

Page 45: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Platform Creation WorkflowPlatform Creation Workflow

1.1. Get BSPs for specified Software Get BSPs for specified Software Development Board (SDB)Development Board (SDB)

2.2. Customize your platform with Platform Customize your platform with Platform BuilderBuilder

3.3. Download, Debug and run your Download, Debug and run your Platform via the SDBPlatform via the SDB

4.4. Make release build of your platformMake release build of your platform

Page 46: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Step 1 : Get the BSPStep 1 : Get the BSP

From MicrosoftFrom Microsoft CEPCCEPC

From Third Party OEMsFrom Third Party OEMs Motorola Dragon ballMotorola Dragon ball Advantech 7230…Advantech 7230…

Create our own BSPCreate our own BSP To be discussed later…To be discussed later…

Where can we get BSPs?Where can we get BSPs?

Page 47: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Install & Use BSPInstall & Use BSP

If BSP is provided as an MSI file, install If BSP is provided as an MSI file, install it like other softwaresit like other softwares

If BSP is provided as source code, add If BSP is provided as source code, add the .CEC file to PBthe .CEC file to PB

NOTE : You MUST install the NOTE : You MUST install the corresponding CPU in PB support first.corresponding CPU in PB support first.

Page 48: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Demo :Demo :Install and Use Motorola Install and Use Motorola

Dragon Ball MXL BSPDragon Ball MXL BSP

Page 49: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Step 2: Customize your platformStep 2: Customize your platform

Choose one of Microsoft provided Choose one of Microsoft provided template and modify ittemplate and modify it

Customize from the very beginningCustomize from the very beginning

Page 50: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

HLBase and IABaseHLBase and IABase

HL mean headless, that means the OS HL mean headless, that means the OS has no graphic user interface.has no graphic user interface.

If you choose IABase, the OS will If you choose IABase, the OS will include GUIinclude GUI

Page 51: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Step 3: Download, Debug and Step 3: Download, Debug and run your Platform via the SDBrun your Platform via the SDB

Get Eboot or SbootGet Eboot or Sboot Configure networkConfigure network Configure Serial debug port (optional)Configure Serial debug port (optional) Configure Platform Builder connectionConfigure Platform Builder connection Download OS image to BoardDownload OS image to Board

General Routines:General Routines:

Page 52: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Get Eboot or SbootGet Eboot or Sboot

Bootloader is usually a part of BSP Bootloader is usually a part of BSP provided by the OEMs.provided by the OEMs.

The general purpose of the boot loader The general purpose of the boot loader is to place the OS image into memory is to place the OS image into memory and then jump to the OS startup and then jump to the OS startup routine. routine. Eboot : Ethernet BootloaderEboot : Ethernet Bootloader Sboot : Serial BootloaderSboot : Serial Bootloader

Usually stripped in retail buildUsually stripped in retail build

Page 53: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Variant BootloaderVariant Bootloader

Flash into flash RomFlash into flash Rom Use boot floppy diskUse boot floppy disk Use CF cardUse CF card ……

Has only one purpose:Has only one purpose:

Download the OS imageDownload the OS image

Page 54: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Configure network for SerialConfigure network for Serial

Just plug the serial port connection Just plug the serial port connection cablecable

Shortcoming : too slowShortcoming : too slow

Page 55: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Configure network for EthernetConfigure network for Ethernet

Using network hubUsing network hub

Page 56: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Configure network for EthernetConfigure network for Ethernet

Using an isolated networkUsing an isolated network

Page 57: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Configure Serial debug portConfigure Serial debug port

Plug the RS232 serial adapter into the ADS board default serial debugport to the Com port on your workstation.

Activate a Hyperterm window by choosing Start Menu → Programs→ Accessories → Hyperterminal → Hyperterminal.

Page 58: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

HyperterminalHyperterminal

Page 59: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Configure PB connectionConfigure PB connection From From Target -> Configure Remote Target -> Configure Remote

ConnectionConnection

Page 60: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Configure PB connectionConfigure PB connection

Eboot will send Eboot will send broadcastbroadcast package package to LAN, Platform Builder receive to LAN, Platform Builder receive the message and display the the message and display the device ID.device ID.

Page 61: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Download OS image to BoardDownload OS image to Board

From PB, click on From PB, click on Target → Download/Initialize.

Page 62: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

You should be able to see You should be able to see this screen on devicethis screen on device

Page 63: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Where are we?Where are we?

Get hardware & BSP from OEMs

Need platform customization

?

Get platform & SDK from OEMs

Customize your Win CE platform

Export your SDK

Coding & Testing

Release to Manufacture

Page 64: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

AgendaAgenda

Introduction to Platform BuilderIntroduction to Platform Builder User InterfaceUser Interface Catalog and FeatureCatalog and Feature Platform ConfigurationPlatform Configuration

Platform Creation workflowPlatform Creation workflow

The Build SystemThe Build System

Catalog CustomizationCatalog Customization

Page 65: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

PB Directory StructurePB Directory StructureDirectory Description

Others Run-time files, binary files for building OS image files, registry files, and batch files that are used to add files to an OS image.

Platform BSP and Device-specific files and directories.

Private Source code for the Windows CE OS.

Public Directories for the Windows CE OS configurations.

SDK Tools and libraries in the Windows CE SDK that support Platform Builder.

Page 66: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Environment VariablesEnvironment Variables %_WINCEROOT% - Root of the %_WINCEROOT% - Root of the

Windows CE build installWindows CE build install Typically C:\WINCE500Typically C:\WINCE500 %_PUBLICROOT% - %_WINCEROOT%_PUBLICROOT% - %_WINCEROOT

%\PUBLIC%\PUBLIC %_PLATROOT% - %_WINCEROOT%\%_PLATROOT% - %_WINCEROOT%\

PlatformPlatform Many othersMany others

Use ‘set’ in a command prompt build Use ‘set’ in a command prompt build window to see a list of the environment window to see a list of the environment variables currently set. variables currently set.

Page 67: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Contains Hardware Platform-specific BSP filesContains Hardware Platform-specific BSP filesIs located at the path %_WINCEROOT%\PlatformIs located at the path %_WINCEROOT%\PlatformContains subdirectoriesContains subdirectories

Each subdirectory represents a Windows CE–specific Each subdirectory represents a Windows CE–specific platform adaptationplatform adaptation

Each directory contains a dirs file and one or more Each directory contains a dirs file and one or more batch files for unique BSP settingsbatch files for unique BSP settings

Place your Hardware Platform-specific files in this Place your Hardware Platform-specific files in this directorydirectory

The Platform DirectoryThe Platform Directory

Page 68: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Public DirectoryThe Public DirectoryContains a platform-independent set of Contains a platform-independent set of

components and configurationscomponents and configurations Is located at the path %_WINCEROOTIs located at the path %_WINCEROOT

%\Public%\PublicContains subdirectories:Contains subdirectories:

Module and component subdirectories- Module and component subdirectories- Common, Wceshellfe, Wceappsfe, IE, Common, Wceshellfe, Wceappsfe, IE, ServersServers

Reference configuration subdirectory- Reference configuration subdirectory- CEBASECEBASE

Page 69: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The SDK DirectoryThe SDK Directory Is located at the path %_WINCEROOTIs located at the path %_WINCEROOT

%\SDK%\SDKContains tools to support Platform Contains tools to support Platform

Builder Builder Processor compilersProcessor compilers Development toolsDevelopment tools Miscellaneous utilitiesMiscellaneous utilities

Page 70: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Others DirectoryThe Others DirectoryIs located at the path %_WINCEROOT%\Is located at the path %_WINCEROOT%\

OTHERSOTHERSContains subdirectories:Contains subdirectories:

ATL: Contains ATL headers, libraries and source ATL: Contains ATL headers, libraries and source code for debugging code for debugging

DOTNET: Contains the .NET processor specific DOTNET: Contains the .NET processor specific binaries and portable .NET Compact Framework files binaries and portable .NET Compact Framework files

MFC: Contains MFC Headers, Libraries and Source MFC: Contains MFC Headers, Libraries and Source Code for debugging Code for debugging

SAMPLES: Contains the MFC and ATL sample SAMPLES: Contains the MFC and ATL sample applications applications

WCETK: Contains the Windows CE Test Kit (CETK) WCETK: Contains the Windows CE Test Kit (CETK) processor specific binariesprocessor specific binaries

Page 71: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

The Private DirectoryThe Private DirectoryIs located at the path %_WINCEROOT%\Is located at the path %_WINCEROOT%\

PRIVATEPRIVATEMust check option at installation time and Must check option at installation time and

agree to Shared Source License termsagree to Shared Source License terms YYouou can ship modified versions of the private code can ship modified versions of the private code

with your product!with your product!Premium (“Almost everything”) Source Premium (“Almost everything”) Source

availableavailableContains source code for:Contains source code for:

KernelKernel GWES componentsGWES components Filesys componentsFilesys components

Page 72: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Review of 4 build stepsReview of 4 build steps

Catalog Items

OS DesignBSP / project Source Code

%_FLATRELEASEDIR%

Run-Time Image

BUILDREL

SysgenFilter

Build

2

1

3

4

SYSGENSYSGEN Filters modules and Filters modules and

components based on OS components based on OS Design settingsDesign settings

BuildBuild Uses DIRS, SOURCES and Uses DIRS, SOURCES and

OS Design Workspace to OS Design Workspace to build Source Code for the build Source Code for the BSP and applicationsBSP and applications

BUILDRELBUILDREL Copies files into the Flat Copies files into the Flat

Release DirectoryRelease Directory

Make ImageMake Image Generates the OS Run-Time Generates the OS Run-Time

Image from the files in the Image from the files in the Flat Release DirectoryFlat Release Directory

1

2

3

4

Page 73: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Overview of Build SystemOverview of Build System

The IDE is a thin client over the The IDE is a thin client over the command-linecommand-line tools that make up the tools that make up the build system. build system.

Command line tools use Command line tools use Environment Environment VariablesVariables to identify the Build setting to identify the Build setting and call the compiler & linkerand call the compiler & linker

Command line utilities stored at :Command line utilities stored at : %_PUBLICROOT%\COMMON\OAK\MISC%_PUBLICROOT%\COMMON\OAK\MISC

Page 74: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Environment variablesEnvironment variables Important directoriesImportant directories

%_WINCEROOT%%_WINCEROOT% %_PublicRoot%%_PublicRoot%

Selected OS featureSelected OS feature SYSGEN_AYGSHELLSYSGEN_AYGSHELL SYSGEN_BATTERYSYSGEN_BATTERY SYSGEN_STANDARDSHELLSYSGEN_STANDARDSHELL

Platform->Setting optionsPlatform->Setting options IMGAUTOFLUSHIMGAUTOFLUSH WINCESHIPWINCESHIP IMGRAM64IMGRAM64

Page 75: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Source code configurationSource code configuration

DIRSDIRS

SOURCESSOURCES

MakeFileMakeFile makefile.defmakefile.def

Page 76: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

DIRS FilesDIRS FilesDIRSDIRS

Like a “Workspace” contains a list of “projects”Like a “Workspace” contains a list of “projects” Text file that lists directories containing other DIRS or SOURCES filesText file that lists directories containing other DIRS or SOURCES files BUILD.EXE will read the contents of DIRS files to determine what to buildBUILD.EXE will read the contents of DIRS files to determine what to build Example:Example:

DIRS=\

Eboot \

Drivers

Page 77: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

SOURCESSOURCESSOURCESSOURCES

List of source code files for the projectList of source code files for the projectTARGETNAMETARGETNAME

Name of output target (without extension)Name of output target (without extension)TARGETTYPETARGETTYPE

PROGRAM – (.EXE) ApplicationPROGRAM – (.EXE) Application DYNLINK – (.DLL) Dynamic Link LibraryDYNLINK – (.DLL) Dynamic Link Library LIBRARY – (.LIB) Static libraryLIBRARY – (.LIB) Static library

Page 78: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

File organizationFile organizationText file that is included into makefile.def to provide target specific information to the buildText file that is included into makefile.def to provide target specific information to the build

MAKEFILE.INC

SOURCES

MAKEFILE.DEFLocal

project folder

%_MAKEENVROOT%

Page 79: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Useful Command line toolsUseful Command line tools

Wince.batWince.bat Blddemo.batBlddemo.bat Cebuild.batCebuild.bat Build.exeBuild.exe Sysgen.batSysgen.bat Buildrel.batBuildrel.bat Makeimg.exeMakeimg.exe

Page 80: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Wince.batWince.bat

Prepares the development workstation Prepares the development workstation build environment by using three input build environment by using three input parameters parameters %_TGTCPU% %_TGTCPU% %_TGTPROJ% %_TGTPROJ% %_TGTPLAT% %_TGTPLAT%

Ex: wince x86 MYPROJ CEPCEx: wince x86 MYPROJ CEPC

Page 81: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

BldDemo.bat BldDemo.bat

Used to build and create an OS image.Used to build and create an OS image. It calls the three tools:It calls the three tools:

Cebuild.batCebuild.bat: Builds modules, features, : Builds modules, features, and source code for a platform.and source code for a platform.

Buildrel.batBuildrel.bat: Copies the files for a : Copies the files for a platform to a release directory.Make platform to a release directory.Make Binary Image tool Binary Image tool

Makeimg.exeMakeimg.exe Generates an OS image. Generates an OS image.

Page 82: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Build.exeBuild.exe

Application to traverse directory structure Application to traverse directory structure and build multiple itemsand build multiple items Directory structure defined by DIRS filesDirectory structure defined by DIRS files

Provides automatic dependency checking Provides automatic dependency checking for source files and include filesfor source files and include files

Central build engine of Windows CECentral build engine of Windows CECalls NMAKE.EXE to do the actual buildCalls NMAKE.EXE to do the actual buildDIRS and SOURCES determine what to DIRS and SOURCES determine what to

buildbuild

Page 83: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

How to set up command How to set up command line build Environmentline build Environment

1.1. Set environment variableSet environment variable

2.2. Build the OS imageBuild the OS image

Page 84: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Sample buildSample build

set _WINCEROOT=E:\WINCE420set _PROJECTROOT=E:\GOOD\WINCE420\Emulatorset _FLATRELEASEDIR=E:\GOOD\RelDir\EMULATOR_X86Releaseset _PROJPUBLICROOT=E:\GOOD\WINCE420\public

cd %_WINCEROOT%\public\common\oak\misc

call wince.bat X86 GOOD EMULATOR

set SYSGEN_CURSOR=1set SYSGEN_CONNMC=1set SYSGEN_MENU_OVERLAP=1set SYSGEN_MSIM=1

blddemo –q

Page 85: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

AgendaAgenda

Introduction to Platform BuilderIntroduction to Platform Builder User InterfaceUser Interface Catalog and FeatureCatalog and Feature Platform ConfigurationPlatform Configuration

Platform Creation workflowPlatform Creation workflow

The Build SystemThe Build System

Catalog CustomizationCatalog Customization

Page 86: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Windows CE CatalogWindows CE Catalog Database of CE Catalog itemsDatabase of CE Catalog items

Each item is either a module or component of a module that you can select Each item is either a module or component of a module that you can select to include in the run-time imageto include in the run-time image

Catalog view shows Catalog items in hierarchical treeCatalog view shows Catalog items in hierarchical tree Allows drag and drop selection of Catalog items to customize the OS designAllows drag and drop selection of Catalog items to customize the OS design

Extensible by end user and third partiesExtensible by end user and third parties Importing CEC files add items to the CatalogImporting CEC files add items to the Catalog

Page 87: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

CEC FileCEC File CECInfo blockCECInfo block

Contains general information about the contents Contains general information about the contents CEC file CEC file

ComponentType blockComponentType blockDescribes a top-level organizational description. Describes a top-level organizational description. For example, ‘Audio Driver’ might be a For example, ‘Audio Driver’ might be a ComponentType (Like a class in OO programming)ComponentType (Like a class in OO programming)

Implementation blockImplementation blockDescribes one specific implementation of a Describes one specific implementation of a ComponentType (Like an object instance in OO ComponentType (Like an object instance in OO programming)programming)

BuildMethod blockBuildMethod blockDescribes where source code for the item is Describes where source code for the item is locatedlocated

Page 88: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Introduction to CEC editorIntroduction to CEC editor

The CEC Editor is a tool, accessed The CEC Editor is a tool, accessed from the Tools menu, with which you from the Tools menu, with which you can create and edit .cec files. can create and edit .cec files.

Page 89: Introduction to Embedded Software Development School of software Engineering 2005 5. OS Development

Customize CEC file steps:Customize CEC file steps:

1.1. Creating a Catalog Feature File Creating a Catalog Feature File

2.2. Adding an Implementation Adding an Implementation

3.3. Adding a Build Method Adding a Build Method

4.4. Adding BIB Information Adding BIB Information

5.5. Adding the Feature to the Catalog Adding the Feature to the Catalog