이것저것/Windows CE

Catalog Feature File(.cec File) - (일부 계속 수정 중)

우담바라 2007. 4. 17. 14:50

Catalog, CEC Files and CEC Editor


1. Catalog

. Windows CE Catalog는 런타임 이미지 안에 포함되어야 하는 모듈과 컴포넌트들의 리스트를 제공하는 database 이다.

. Catalog View를 통해 계층화된 트리 형태의 Catalog 항목들을 볼 수 있다.

. End User나 Third party에 의해 이 구조는 확장될 수 있다. (Catalog를 추가 및 삭제가 가능)


2. CEC File

. CE component file을 말하며, Catalog database안으로 Import하여 사용하는 간단한 텍스트 기반의 파일.
  .cec(Catalog Feature File 라고도 불리는 듯)는 Catalog (또는 그 요소)들의 관계 또는 특징들에 관한 정
   보들을 담고있음.
  Catalog의 인자 등을 사용하기 위해서는, CEC 파일을 먼저 생성하고, import를 해주어야만 한다.

 . CEC File의 구조
   : CEC 파일은 Block, Sub Block 로 구성이 되며, 다음의 4가지 영역으로 구분된다.

      - CECInto Block: CEC 파일에 대한 일반적인 정보를 포함한다.

      - ComponentType Block: Catalog 항목의 그룹 혹은 생성된 Catalog 항목을 포함한다.

      - Implementation Block: Component의 구현을 정의한다.

      - BuildMethod Block : Component 빌드에 필요한 정보를 제공하는 블록이다.

Block name                                         Content

CECInfo Block               Basic information about the .cec file, such as the name,
                                   description, vendor, and version of the .cec file.

ComponentType Block    Catalog item groups or a generalized Catalog item that might
                                    have many different implementations.

Implementation Block      Definition of an implementation for a component type.

BuildMethod Block          Information about which CPUs support your Catalog item
                                   and, if applicable, links to source files, Help documentation
                                    (.chm) files, and user-created projects.  
                                    Note Build-specific information in custom CEC files is not
                                    supported in Windows CE 5.0. Although this does not
                                    prevent CEC files from earlier versions of Platform Builder
                                   from being used, the information that is no longer supported,
                                   such as custom build steps, is ignored.



a. CECInfo Block     Send Feedback

CECInfo 항목은 기본적으로 이 CEC가 제공하는 소스가 BSP인지 아니면 third party 모듈인지 혹은 드라이버 모듈인지를 알려주는 정보를 가지고 있다. 여기서 주의 할 사항은 GUID이다 일반적으로 고유한 값이어야 한다. 그래서 GUID생성기 혹은 CEC Editor를 사용하면 고유한 값을 만들수 있다.
(The CECInfo block contains basic information about the .cec file, such as the name, description, vendor and version of the .cec file.)
Note   The CECInfo block must be the first block in a .cec file, and there can only be
one CECInfo block in a .cec file.
CECInfo (
   Name(Mycecfile.cec)
   CECVersion (3.00)  // CEC file
   GUID( <GUID value> )
   Vendor ("Calc U. Later")  //  quotes are needed because of space in the string
   Description ("My CEC File description")
)
Copy Code


The following table shows the elements of the CECInfo sub-blocks.
Element                            Description

Name               Optional element that identifies the name of the .cec file

GUID                Optional element that supplies the GUID of the .cec file
                       If a value is not present, it is created when the .cec file is imported into the
                       Catalog.

Description      Optional element that describes the .cec file.

CECVersion      Element that identifies the version of the .cec file.
                       The following versions are supported: 2.12, 3.0, 4.0, and 5.0. Use
                       version 2.12 and 3.0  only to support backward compatibility.

Vendor             Optional element that defines the vendor of the .cec file






b. ComponentType Block

The component type block is the basic block, which contains all feature information to be imported into the Catalog. The following code example shows a component type block.

ComponentType(
  Name( <string> )
  GUID( <GUID Value> )
  Group( <string> )
  Description( <string> )
  Vendor( <string> )
  Implementations(
    Implementation( ... )
    Implementation( ... )
  )
)

Copy Code


 Componet Type인데 여기서도 Group과 GUID가 중요하며 그보다 중요한것은 RequiredCEModules이다. 이것은 CE의 모듈을 사용해야 하는경우 Set되어야 하는 환경변수들의 값이다.

그다음 중요한것은 Action항목으로 실제 build되는 Sources파일의 위치를 말한다.

The following table shows the elements of component type sub blocks.

Element                                                   Description

Name                              Element that identifies the name of the component type as
                                     it is displayed in the catalog.

GUID                              (Optional) Supplies the GUID for component types,
                                     implementations, and build methods.
                                     If a value is not present, it is created when the .cec file is
                                     imported into the Catalog.

Description                      (Optional) Describes the Catalog item.
                                      The default is none.
                                      The description must be enclosed in quotation marks; for
                                      example,
                         Description("A variety of board games").

Group                              (Optional) Names the file folder where your Catalog item
                                       is placed when it is added to the Catalog.
                                      The folder name must be enclosed in quotation marks. For
                                      example,
   Copy Code
                                      Group("Applications\Games\BoardGames")

Vendor                           (Optional) Provides vendor information.

Implementations               Groups of implementations.

Implementation                 A Catalog item implementation within a group of
                                     implementations.


MaxResolvedImpsAllowed   (Optional) Specifies the maximum number of
                                        implementations of the same type that can exist in an OS
                                        design.
                                        (Optional) OS Design에 존재해야 하는 같은 형태의 구현
                                       에 대한 최대 수를 설정하는 Element이다.
                                        => 해당 콤포넌트가 시스템 상에서 생성될 수 있는 인스턴
                                        스 갯수

RequiredCEModules          (Optional) Lists modules that are required for this type to
                                       be added to the OS design.
                                        Note   In Windows CE 5.0, this setting is ignored.

ExcludeWhenSet             (Optional) Lists a set of variables that, when set in the
                                    OS design, causes all implementations of this type to be
                                     excluded from build.
                                     Note   In Windows CE 5.0, this setting is ignored.

HelpID                            (Optional) Contains the help identifier used for component
                                     type lookup in the Platform Builder Help.





c.Implementation Block
Send Feedback

An implementation block defines an instance of a component type.

The implementation block exists within the scope of a ComponentType block.

A component type can have multiple implementation blocks.

A ComponentType block is not required to have an implementation block.

There is no limit to the number of implementation blocks that a ComponentType block can have.

The following code example shows a ComponentType block with an implementation block.


ComponentType(
  Name( MyGWESCatalogItem )
  GUID( <GUID Value> ) 
  Description( "This is the GWES functionality" )
  Implementations(
    Implementation(
        Name( MyComp )
        GUID( <GUID Value> )
        Children( <GUID Value> )
        Children( <GUID Value> )
    )
  )
)
Copy Code

The following table shows the elements of implementation block subblocks.

 
  Element                                               Description
Name                               Identifies the name of this specific implementation.

GUID                               (Optional) Supplies the GUID.
                                      If the GUID is not present, it is created when the
                                      implementation is imported.
                                     The default is none.

Description                      (Optional) Describes this Catalog item implementation.
                                      The description must be enclosed in quotation marks.
                                      ( " " )

Version                           Specifies the version of this Catalog item, using the
                                      following format:
                                      
Copy Code
          Version( <major version>.<minor version>.<build number>.<update number>)
                                      For items imported with a later version number than an
                                      existing item, the new item replaces the existing one.
                                       If the existing item has a later version number, Platform
                                      Builder rejects the new item.
       
Locale                           Specifies the locale of the Catalog item, using the following
                                     format.                       
Locale( 0409 )

Vendor                          (Optional) Specifies the vendor for this implementation.
                                    The default is none.


Date                              (Optional) Specifies the implementation date.
                                    The format is mm/dd/yy.

SizeIsCPUDependent       (Optional) Specifies whether the size of the Catalog item
                                     is CPU-specific.
                                     If the size of the Catalog item is dependent on a specific
                                     CPU, set to "1".
                                     For example, code compiled for a MIPS CPU typically
                                     requires more space than code compiled for an x86 CPU.
                                     If a Catalog item is mainly composed of code, it has a
                                     SizeIsCPUDependent setting of "1".
                                     Otherwise, if the item consists mainly of data,
                                     SizeIsCPUDependent is set to "0".
                                     Platform Builder uses SizeIsCPUDependent and ImplSize
                                     to estimate the total size of the run-time image.

Children                        (Optional) Lists child component types by name or GUID.
                                    The default is none.
                                    You do not need to include quotation marks for a list of
                                    children.
                                    Children are pulled into the OS design when a parent is
                                    added, and parent Catalog items are added to an OS
                                    design when a child is added.

OptionalChildren             (Optional) Specifies children that contribute to this
                                    implementation but are not required for this implementation.
                                    An optional child Catalog item is not pulled into the OS
                                   design when a parent is added. It must be added manually.
                                    Parent Catalog items are added to an OS design when an
                                    optional child  is added.

ExcludeWhenSet            (Optional) Lists a set of variables that, when set in the OS
                                   design, cause this implementation to be excluded from the
                                   build. Note   In Windows CE 5.0, this setting is ignored.

HelpID                          (Optional) Contains the help identifier used for
                                   ComponentType lookup in the Platform Builder Help system.

FeatureVariable             (Optional) Contains the variable that associates this
                                   implementation with a  Catalog item.
                                   The parameter set by this element is the Sysgen variable
                                   used by the build system.
                                   Note   In Windows CE 5.0, if you set value to "" or leave it
                                             blank, the entire declaration is ignored. If you use
                                             any other values as the setting for value, Platform
                                             Builder sets value to "1".

ImplSize                      (Optional) Contains the physical size of memory that this
                                  Catalog item adds to the run-time image.
                                  Platform Builder uses SizeIsCPUDependent and ImplSize to
                                  estimate the total size of the run-time image.

BSPPlatformDir             (Optional) Lists the BSP directory that this implementation is
                                  associated with. When set, this variable causes this
                                  implementation to be shown in the catalog under all BSPs
                                  that have the same BSP directory as the PPlatformDir
                                 variable.

Variable                      (Optional) Specifies environment variables associated with
                                  this Catalog item, using the following format:
                                      
Variable( <variable name>, <value> )
                    * Variable: (Optional) Catalog Item과 함께 사용되
                    어야 하는 특별한 환경 변수
                             : Ex) Variable ( , )
                   
Note   In Windows CE 5.0, if you set value to "" or leave it
                                              blank, the entire declaration is ignored. If you use
                                             any other values as the setting for value, Platform
                                             Builder sets value to "1".

DefaultDrivers               Specifies the default drivers to use for this Catalog item,
                                  using the following format:
                                  
Copy Code
                                   DefaultDrivers( <Implementation GUID (of a driver)> )
                                   Only BSPs should use this element.
                                   Note   In Windows CE 5.0, this setting is deprecated. To
                                             set the default drivers for your BSP, modify the
                                             associated Platform.bat file.
                                              For example, to set default drivers for a BSP called
                                             MyBSP, modify  the file
                                            %_WINCEROOT%\Platform\MyBSP\MyBSP.bat.







d.BuildMethod Block
Send Feedback

The BuildMethod block provides information about which CPUs support your Catalog item and, if applicable, links to source files, Help documentation (.chm) files, and user-created projects.

Note   Build-specific information in custom CEC files is not supported in Windows CE 5.0. Although this does not prevent CEC files from earlier versions of Platform Builder from being used, the information that is no longer supported, such as custom build steps, is ignored. For information about including custom build actions at a project level in your OS design, see Specifying Project Settings.

For more information about changes to BuildMethod blocks in Windows CE 5.0, see Catalog Item Migration.

The following code example shows a BuildMethod block.

BuildMethods(
   BuildMethod(
      CPU ( "x86" )
      Step ( BSP )
      Action ( '#CLONE_MODULE(common,ddi_flat)' )
   )
)
The following table shows the elements of a BuildMethod block.


Element                                               Description
CPU                        Specifies which microprocessors this build method supports.
                              The following microprocessors are supported by default:
                               -ARMV4I
                               -Emulator
                               -MIPSII, MIPSII_FP, MIPSIV, MIPSIV_FP
                               -SH4
                               -x86    
                              The microprocessor list must be enclosed in quotation marks.
                              The string "default" refers to the default microprocessor list.

CoreOS                   (Optional) Specifies whether the Catalog item is a Core OS
                              Catalog item, or a
                              Third Party Catalog item.
                              Uses the format shown in the following code example.
                              Copy Code
                              CoreOS( CEBASE )
 
Step                       Build step. Only one step per build method is allowed.
                                 Step: Build Step을 말한다.
                                           - BSP: Feature Build Step
                                           - BUILDREL: Release Copy Step
                                           - MAGEIMG: Make Image Step
                                           - CESYSGEN: Cesysten Step
                            Note   This information is required in a .cec file, but is otherwise
                                      ignored in Windows CE 5.0.

GUID                      (Optional) Supplies the GUID for the build method.
                             If the GUID is not present, it is created when the implementation
                             is imported.

Setting                   (Optional) Supplies a path for the Help documentation, using the
                             following format.
                            Copy Code
                            Setting ( '#CHM( "CHM_FILE" )' )
                            This attaches an HTML Help file (.chm) to the Catalog item
                             described in the .cec file.
                           Exported SDKs that include the item will also contain the
                            associated HTML help files.
                            This setting is used to determine whether a help file is exported
                             to the SDK for the OS design.

Action                   Specifies metadata associated with the selected Catalog item or
                            module, using
                            a string that uses one of the following formats:
                            Copy Code
                       Action( '#SRCCODE( DIR|SOURCES, "SOURCES_FULLPATH" )' )
                       Action( '#SRCCODE( USER_PROJECT, SOURCES_FULLPATH" )' )
                       Action( '#CLONE_MODULEDEPENDENCY_TREE,MODULE_NAME)' )
                    Valid metadata descriptors that you can choose include the following:
   
                    * Action: 빌드 단계에서 Platform Builder에 의해 특별한 활동을 수행한다.
                      (즉, SOURCES 혹은 DIRS 파일에서 정의한 형태로 동작을 수행한다)
                     - #SRCCODE: 소스코드의 위치를 IDE상에서 보여주는 element 이다.
                                (IDE상에서 해당 소스코드를 편집 할 수도 있음)
                           
                     -  #SRCCODE
                    Specifies the directory containing the sources, dirs, and makefile files
                    associated with this Catalog item.
                    You can also use this action to specify the Platform Builder project
                    (.pbpxml) file associated with this Catalog item. However, using this
                    descriptor will not build code. For information about including custom
                    build actions at a project level in your OS design,
                   see
Specifying Project Settings.
                  - #CLONE_MODULE
                    Specifies the dependency tree containing the target module that you
                    want to clone by replacing one or more of the libraries in the selected
                    module during the build process.




* Sample .cec Files *Send Feedback

The following code examples show sample .cec files.

For more examples of .cec files, examine the default .cec files that are installed in the %_WINCEROOT%\Public\Common\Oak\Catalog\Cec directory.

Sample 1

The following code example shows all important keywords known to the .cec parser:

CECInfo (
   Name(test2.cec)
   CECVersion(4.00)
   GUID({EBA7FFA0-87EB-11d3-9930-00105AC7264F})
   Vendor("Dens computer company")
   Description("Dens test cec file")

)


ComponentType (
   Name("Dens Child Comp")
   Description("Dens Child Feature")
   GUID( {EBA7FFA0-87EB-11d3-9930-00105AC7264F} )
   Vendor("Dens computer company")

   Implementations (
      Implementation (
         Name("Dens Child xxxx")
         Description("Dens Child xxxx Feature")
         GUID( {24E94E20-87EC-11d3-9930-00105AC7264F} )
         Vendor("Dens computer company")
         Date("10/21/99")
         BuildMethods (
            BuildMethod (
               Step ( BSP )
               CPU ( DEFAULT )
            )
         )
      )
   )

)
               


ComponentType (
   Name("Dens comps")
   Description("Dens Features")
   Group("\Dens")
   GUID( {01FA62A0-858D-11d3-992E-00105AC7264F} )
   Vendor("Dens computer company")

   Implementations (
      Implementation (
         Name("Dens i486")
         Description("Dens i486 Feature")
         GUID( {B0325830-858D-11d3-992E-00105AC7264F} )
         Vendor("Dens i486 company")
         Date("10/19/99")
         Children( "Dens Child Comp" )

         BuildMethods (
            BuildMethod (
               Step ( BSP )
               CPU ( x86 )
               CPU ( Emulator )
            )
         )
      )
      Implementation (
         Name("Dens SH4")
         Description("Dens SH4 Feature")
         GUID( {B0325831-858D-11d3-992E-00105AC7264F} )
         Vendor("Dens computer company")
         Date("October 20,1999")
      )
      Implementation (
         Name("Dens Default")
         Description("Dens default Feature")
         GUID( {B0325832-858D-11d3-992E-00105AC7264F} )
         Vendor("Dens computer company")
         Date("October 21,1999")
      )
      Implementation (
         Name("Dens mixed")
         Description("Dens mixed Feature")
         GUID( {43DBF740-9C71-11d3-9941-00105AC7264F} )
         Vendor("Dens computer company")
         Date("November 16,1999")
         BuildMethods (
            BuildMethod (
               Step ( BSP )
               CPU ( DEFAULT )
            )
         )
      )
   )  //  end implementations
)  // end componentType

Sample 2

The following code example shows a full code sample of a .cec file:

//  The necessary CECInfo block
CECInfo (
   Name(example.cec)
   CECVersion(4.00)
   Vendor("Johnnys company")
   Description("Example CEC for cec.doc")
)

//  CEPC -  video drivers ("ddi_s3v" and "ddi_vga8")...
//
ComponentType (
    Name( display )
    GUID( {B3509B51-F1E4-11d2-85F6-004005365450} )
    Description( "CEPC Video Drivers" )
    Group( "\Device Drivers" )
    Implementations(
        Implementation(
            Name( ddi_s3v )
            Description( "S3ViRGE driver" )
            BSPPlatformDir( "CEPC" )
            GUID( {B3509B57-F1E4-11d2-85F6-004005365450} )
            BuildMethods (
                BuildMethod (
                    Step ( BSP )
                    CPU ( x86 )
                )
            )
        )

        Implementation(
            Name( ddi_vga8 )
            Description( "VGA 8BPP driver" )
            BSPPlatformDir( "CEPC" )
            GUID( {B3509B59-F1E4-11d2-85F6-004005365450} )
            BuildMethods (
                BuildMethod (
                    Step ( BSP )
                    CPU ( x86 )
                )
            )
        )
    )
)

// CEPC - wavedev...
//
ComponentType (
    Name( Wavedev )
    GUID ( {14C1DB2A-3DEE-4851-ABEA-C60DCB9D2ADD} )
    Description( "Wavedev" )
    Group( "\Device Drivers" )
    Implementations(
        Implementation(
            Name( Wavedev )
            Description( "Wavedev driver" )
            BSPPlatformDir( "CEPC" )
            GUID ( {20469435-4124-41c0-9C96-632BF395E0DF} )
            BuildMethods (
                BuildMethod (
                    Step ( BSP )
                    CPU ( x86 )
                )
            )
        )
    )
)



3. CEC Editor

. CECEditor.exe 파일을 통해 CEC 파일의 작성 및 수정이 가능하다

. Platform Builder의 메뉴 / Tools / CEC Editor를 수행하면 된다.
 

4. CEC File의 추가 및 제거
. Platform Builder Tool의 File Menu에 보면 Manage Catalog Items를 통해 CEC 파일을 새롭게 등록한다거나  기존의 CEC 파일을 제거 할 수 있다.