1 / 51

Advanced Building of a Windows CE Image

Advanced Building of a Windows CE Image. Directory Structure. Platform Directory Hardware specific file 포함 Public Directory Platform 에 독립적인 component 와 WINCE 설정 파일 포함 SDK Directory Platform 생성을 위한 tool 과 binary Others Directory 다양한 runtime, sample component 저장소

pascha
Download Presentation

Advanced Building of a Windows CE Image

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. Advanced Building of a Windows CE Image

  2. Directory Structure • Platform Directory • Hardware specific file 포함 • Public Directory • Platform에 독립적인 component 와 WINCE 설정 파일 포함 • SDK Directory • Platform 생성을 위한 tool과 binary • Others Directory • 다양한 runtime, sample component 저장소 • Private Directory • Windows CE .NET OS의 source code 포함 Windows CE.NET

  3. Platform directory • Platform에 한정적인 Board Support Package (BSP) file • %_WINCEROOT%\Platform • 하위 directory는 각각의 reference platform 지원 • ARM만을 설치 했을 경우 • ARMINTEGRATOR / CEPC / EMULATOR / GEODE / SMDK2410 / XSC1BD 생성 • 각 directory는 .dirs file, SOURCE file, .bat file을 포함 Windows CE.NET

  4. Platform directory (con’t) • CESYSGEN • Platform에 한정된 sysgen 명령을 포함한 makefile • DRIVERS • platform의 모든 driver의 driver source file • EBOOT • platform의 Ethernet boot loader를 위한 source file • FILES • image를 build하기 위한 platform 한정된 configuration file • GWE • display, Battery, LED 같은 GWE module의 hardware 의존적인 부분 Windows CE.NET

  5. Platform directory (con’t) • INC • CPU register와 모든 device의 address의 platform 한정적인 header file • KERNEL • OEM Adaptation Layer (OAL) function 구현 file • LIB • Platform 한정적인 static libraries (.LIB) • Build process간 생성됨 • TARGET • DRIVER dynamic link library와 같은 platform 한정적인 modules • GWE.EXE와 NK.EXE와 같은 system executable • Build process간 생성됨 Windows CE.NET

  6. Platform directory (con’t) • CPU Support Package(CSP) • \WINCE420\PUBLIC\COMMON\OAK\CSP 에 존재 • 각 CPU type에 대한 common driver, OAL과 driver의 library component 를 제공 Windows CE.NET

  7. Public directory • Platform에 독립적인 Component와 configuration의 설정 포함 • %WINCEROOT%\PUBLIC 에 위치 • 3가지 형태의 하위 디렉토리 포함 • module, component와 configuration 하위 directory : Wceshellfe, Wceappsfe, IE, MSMQ • Reference configuration 하위 directory : IABase, HLBase • Custom configuration 하위 directory Windows CE.NET

  8. Public directory (con’t) • Module과 Component 하위directory • COMMON • DATASYNC : Device 측면의 communication component • DCOM : COM을 배분하기 위한 모듈 과 component • DIRECTX • IE • MSMQ • RDP : Windows 기반의 terminal을 위한 Remote Desktop Protocol • SCRIPT : JavaScript, VBScript engines • SERVERS : Web Server 지원 • WCEAPPSFE : Pocket Word/Outlook 응용프로그램 인가 • WCESHELLFE : task manager, control panel component shell 인가 Windows CE.NET

  9. Public directory (con’t) • 모든 하위 directory의 directory structure • CESYSGEN • directory build를 위한 makefile 포함 • OAK • OAL Device Driver Kit의 module과 component 포함 • SDK • Software Development Kit(SDK)의 module과 component 포함 • 일부는 DDK directory를 포함 • Device Driver Kit(DDK)의 module과 component 포함 Windows CE.NET

  10. Public directory (con’t) • Reference Configuration 하위 directory • 두 개의 reference configuration • IABase(Internet Appliance Base Configuration) %_WINCEROOT%\PUBLIC\IABase • HLBase(Headless Base Configuration) %_WINCEROOT%\PUBLIC\HLBase • 각 하위 directory는 비슷한 내용을 포함한다: • 특정한 pre-made configuration이 build될 때, Batch(*.bat) file의 collection이 실행 • Batch file은 Platform에 포함될 것을 control하는 환경 변수를 설정 • Batch file은 예를 들어 HLBase_minkern.bat 또는 Electoronic_Payment_Terminal.bat • OAK • Files : configuration file과 configuration의 default registry로 이루어짐 • Misc : OS에 포함될 module과 component를 나열한 CESYSGEN.BAT file 포함 Windows CE.NET

  11. Public directory (con’t) • Custom Configuration 하위 directory • configuration을 생성할 때, public directory에 새로운 directory 생성 • %_WINCEROOT%/Public/Myplat • RelDir • OS image를 build하기 위해 요구되는 모든 file을 포함하는 Release directory는 module, default registry, default database, memory setting을 포함 • WINCE420 • %_WINCEROOT% directory의 조합은 custom configuration을 명시 • CESYSGEN • Common, Wceshell, Wceapps, IE, MSMQ와 같은 Project의 모든 module과 component를 포함 • OAK(OAL Device Driver Kit) • platform file과 cesysgen.bat file포함 • Sysgen 단계에서 호출 • Platform을 정의한 Workspace file, project file을 포함한다. Windows CE.NET

  12. SDK Directory • Platform Builder에서 사용하는 tool • 그러나, Image를 build 하기 위해 사용되는 Tool은 포함하지 않음 • %_WINCEROOT_%\SDK • Processor compilers • Platform을 지원하는 cross compiler / assembler 포함 • Development tools • Error lookup, GuidGen, Link, Nmake • Miscellaneous utilites • Zoomin, Windiff Windows CE.NET

  13. Others Directory • 모든 Windows CE runtime libraries 와 headers 포함 • .NET Compact Frameworks의 component와 ATL와 MFC의 Samples 포함 • %WINCEROOT%\OTHERS • ATL • Debugging을 위한 ATL source code, libraries, headers • DOTNET • .NET processor specific binaries와 portable .NET Compact Framework file • MFC • Debugging을 위한 MFC source code, libraries, headers • SAMPLES • MFC와 ATL sample application을 포함 • WCETK • Windows CE Test Kit(CETK) processor specific binaries • CETK는 각각의 Driver class의 test를 제공 Windows CE.NET

  14. Private Directory • core operating system의 일부 source code • 설치 중에 반드시 check해야 한다. • source code • Kernel • GWES component • file system manager component • %_WINCEROOT%\PRIVATE Windows CE.NET

  15. Build Process ..\CESYSGEN\DDK ..\CESYSGEN\OAK ..\CESYSGEN\SDK \target, \files COMMON DATASYNC DIRECTX IE MSMQ RDP SCRIPT SERVERS WCEAPPSFE WCESHELLFE Step 1.System Generation Step 2.Feature Build ..\platform\.. \target, \files Step 3.Building the Release Directory Step 4.Making an Image C:\WINCE420\PUBLIC\%_TGTPROJ%RelDir\%_TGTPLAT%_X86Debug> NK.BIN Windows CE.NET

  16. Build Process (con’t) • System generation (Sysgen or CESYSGEN) • 가능한 모든 feature list로부터 platform을 위해 선택된 feature를 추출하여 포함하는 단계 • C:/WINCE420/PUBLIC/myplat/WINCE420/cesysgen • OS header file을 platform의 header file에 include 하기 위해 filtering • Feature build (build or BSP) • Device driver, OAL, Bootloader와 같은 BSP에 필요한 elements를 building, compiling, linking • C:\WINCE420\PLATFORM\ • User feature, projectfile(.pbp)가 build, compile, link됨과 동시에 dirs, source, makefiles가 built된다. Windows CE.NET

  17. Build Process (con’t) • Building the release directory (buildrel or BUILDREL) • 1, 2 단계에서의 file을 단일 directory로 copy한다. • PB – Build – Open Build Release Directory • Making an image (Makeimg or MAKEIMG) • Build release directory로부터 모든 파일을 취하고, 단일 file로 merge한다. • 이 단일 file은 reference platform hardware에 download 한다. • NK.BIN / NK.SRE / NK.nb0 Windows CE.NET

  18. BUILDREL Build Process (con’t) Catalog Items 1 Build Sysgen Filter 2 OS Design BSP / project Source Code ③ Build Release (BUILDREL) :Release Directory (%_FLATRELEASEDIR%) 안으로 파일들을 복사해오는 단계 ④ Make Image : 최종적인 OS Run-Time Image(NK.BIN)을 생성해 내는 단계 ① SYSGEN : OS Design으로 선택된 모듈과 컴포넌트들을 여과(Filtering) 해주는 단계 ② Build : OS Design과 BSP의 소스 코드들을 compile하는 단계 3 %_FLATRELEEASEDIR% 4 Run-Time Image Windows CE.NET

  19. Step 1. System generation Filtering / Link *.exe / *.dll *.h / *.lib for Device Driver / OEM Application Windows CE.NET

  20. Step 2. Feature Build Build Windows CE.NET

  21. Step 3. Building the Release Directory Copy Component / Configuration File Windows CE.NET

  22. Step 4. Making an Image Makeimg Windows CE.NET

  23. System generation • 모든 component의 모든 library • Module에 의해 expose된 모든 function과 모든 header file • Module definition file(.def) • IDE에서 sysgen을 실행할 때, 선택된 module과 component library를 link • Header file과 system function export file이 Custom version의 OS 생성을 위해 추출 • Makefile은 CESYSGEN.BAT의 변수 설정에 의존적 • Makefile은 선택된 component와 일치되는 library를 link한다. • Build -> Generate Platform Headers Windows CE.NET

  24. System generation (con’t) Complete header and source code files System-specific header files SYSGEN.BAT Complete system libraries Linked libraries Module definitions(.def) Specific .def files Cesysgen.bat Windows CE.NET

  25. Feature Build • Source code를 complie • Dirs를 이용, 하위 directory compile여부 결정 • SOURCES file을 이용, 어떤 file을 compile할지 결정 • Object module을 compile 하고 link하기 위해 NMAKE.EXE 호출 • .exe, .dll을 위한 target folder에 binary file 생성 • Example : Target\ARMV4I\Debug • .lib를 위한 lib folder에 binary file 생성 • Example : Lib\ARMV4I\Debug Windows CE.NET

  26. Feature Build (con’t) • DIRS file이 존재하면: • DIRS에 list된 각각의 directory를 build • DIRS file이 존재 하지 않는다면: • build.exe는 SOURCES file을 참조해 그것이 포함한 모든 C, C++과 assembly file을 compile한다. • Build.exe에 의해 호출된 NMAKE.exe가 .exe와 .dll, .lib file로 build하고, link • build.exe에 의해 생성되는 모듈: • .exe 와 .dll files • Target\%_TGTCPUTYPE%\%WINCEDEBUG% • Example: target\ARMV4I\Debug • .lib files • Lib\%_TGTCPUTYPE%\WINCEDEBUG% • Example: Lib\ARMV4I\Debug Windows CE.NET

  27. Feature Build (con’t) • DIRS file • 하위 directory를 build하기 위한 list • 하위 directory를 DIRS file에 포함할 수 있다. • DIRS에서 DIRS_CE와 OPTIONAL_DIRS를 사용할 수 있다. • DIRS_CE • 만약 Windows CE를 위해 building 할 경우 build 되는 directory를 명시 • OPTIONAL_DIRS • build.exe command line에서 명시하지 않거나 BUILD_OPTION 환경변수에 directory를 추가해주지 않으면, build 할 수 없다. • DIRS =\ • Display\ • Mouse\ • Keyboard\ • Ethernet Windows CE.NET

  28. Feature Build (con’t) • SOURCES files에 의해서 사용된 주요한 macro: • TARGETNAME • build된 module의 이름 • TARGETTYPE • type을 정의(.lib/.dll/.exe) • DLLENTRY • .dll file을 위한 entry type • EXEENTRY • .exe file을 위한 entry type • TARGETLIBS • link단계를 위한 .lib file • INCLUDES • Header file을 찾기 위한 path • SOURCES • compile될 모든 source file • 반드시 makefile이 있어야 한다. Windows CE.NET

  29. Feature Build (con’t) %_MAKEENVROOT% MAKEFILE Local Project folder MAKEFILE.DEF SOURCE Windows CE.NET

  30. Feature Build (con’t) • SOURCE file 예: • build.exe가 IOPORT.CPP와 VGAPORT.CPP를 compile • COREDLL.LIB와 결과를 link • entry는 DllMain • kbdmouse.dll라는 dynamic link library 생성 TARGETNAME = Kbdmouse TARGETTYPE = DYNKINK DLLNTRY = DllMain TARGETLIBS = \ $(_COMMONSDKROOT)\Lib\$(_CPUNDPATH)\Coredll.bib INCLUDES = $(COMMONSDKROOT)\Inc SOURCES = \ iport.cpp \ vgaports.cpp\ Windows CE.NET

  31. Building the Release Directory • buildrel tool은 다음 directory로부터 파일을 copy: • %_PROJECTROOT%/Cesysgen/Oak/Files • %_PROJECTROOT%/Oak/Files • %_PLATFORMROOT%/%_TGTPLAT/\Files • %_PROJECTROOT%/Cesysgen/Oak/Target/%_TGTCPUTYPE%/%WINCEDEBUG% • %_PROJECTROOT%/Oak/Target/%_TGTCPUTYPE%/%WINCEDEBUG% • %_PLATFORMROOT%/%_TGTPLAT%/Target/%_TGTCPUTYPE%/% WINCEDEBUG%/ Windows CE.NET

  32. Building the Release Directory(con’t) • Makeimg.exe가 호출 되기 전 모든 file과 binary는 %_FLATRELEASEDIR%에 존재 해야 한다. • CE version 3.0 이전에는 _FLATRELEASEDIR에 file을 copy하기 위해 Buildrel을 사용 • 지금의 Windows CE .NET에서는 _FLATRELEASEDIR이 NTFS partition에 있다면 Buildrel은 original file이 어디에 저장되어 있는가에 관계없이 hard link를 생성하려고 시도 • Hard linking은 파일의 단지 하나의 물리적인 복사본으로서 disk space에 저장되고 존재 Windows CE.NET

  33. Building the Release Directory (con’t) • buildrel이 성공적으로 hard link를 생성하는가에 따라 flatreleasedir내에 original의 update된 file이 writing • Hard linking의 결과 어떤 feature(e.g. automatic bib update)를 실행하기 위해 IDE는 _FLATRELEASEDIR내 file의 외부 management가 original을 update하는 것을 보호 해야 한다. • IDE를 통해 개발 한다면 사용자는 직접 _FLATRELEASEDIR의 어떤 file(e.g. project.bib)를 편집하거나 _FLATRELEASEDIR에 private version의 file들을 copy하지 않아도 된다 Windows CE.NET

  34. Making an Image • Makeimg는 Fmerge tool을 사용하여 build process에서 사용된 configuration file을 merge: • 모든 .bib file을 unique file(CE.BIB)에 merge • Binary image build • 모든 .reg file을 unique file(reginit.ini)에 merge • 모든 .dat file을 unique file(INITOBJ.DAT)에 merge • 모든 .db file을 image의 default database를 정의한 unique file(initdb.ini)에 merge • reginit.ini file을 binary file(DEFAULT.FDF)로 압축 • 특정한 language에 맞게 바꿀 module의 resource를 대체(language는 LOCALE환경 변수에 정의 해야함) Windows CE.NET

  35. Making an Image (con’t) • makeimg는 file과 binary가 CE.BIB에 명시 • ce.bib로부터 binary와 file을 windows CE image로 결합한다. • Windows CE image를 완료 • Build -> Make Image Windows CE.NET

  36. Explaining Build Errors • Error during the Sysgen phase • 일반적으로 file이 없을 경우 • Operating system feature의 설정 • Sysgen 단계의 application build 에서 발생 • Build.log를 참조하여 해결 • \Public directory의 component를 수정한 경우 • Error during the feature build phase • Compilation syntax error / Unresolved link error • Build.err 검토 • Error during the building the release directory phase • Disk space가 부족 / locked file / read only file 인 경우 • Hard driver의 용량 확인 • Build.log 확인 Windows CE.NET

  37. Explaining Build Errors (con’t) • Errors during the making an image phase • Flat release directory에 file이 없을 경우 • 이전 error / bib file error에서 초래 • Build.log / build.err 확인 • Romimage.exe failed in CE.BIB • Bib에 등록된 file이 Flat release directory에 없을 경우 • Romimage.exe failed in reginit.ini • CE Registry의 syntax error가 발생한 경우 • Error:Image exceeds • Config.bib에 명시한 NK space보다 더 큰 image를 building 하는 경우 Windows CE.NET

  38. Integrated Development Environment • Feature View • Platform에 포함된 모든 드라이버 / OS component 표시 • 선택한 WebPad, Media Appliance와 같은 configuration 아래에 OS component가 표시 • [IABASE] 또는 [HLBASE] 인 base configuration 표시 • Third party와 다른 driver는 BSP 또는 platform root node 아래에 list된다. • IDE내의 각각의 OS component는 SYGEN 환경 변수와 연관되어 있다. • Feature View에서 Sysgen feature와 component는 추가 / 제거 할 수 있다. Windows CE.NET

  39. Integrated Development Environment (con’t) • Resolve Features • feature group이 Unresolved된 platform은 특정한 feature와 연관되지 않은 feature group을 포함한다. • platform build 전에 unresolved된 feature group을 resolve 해야 한다. • platform이 unresolved된 feature group을 포함한다면, Resolve Features dialog box가 platform과 BSP에 feature를 선택하도록 한다. • Resolve Features dialog box는 이미 resolve된 feature group의 조합을 remove 또는 modify 할 수 있도록 한다. Windows CE.NET

  40. Integrated Development Environment(con’t) • Build option을 이용하여 Windows CE의 image를 build할 때, full build mechanism은 단지 변경된 feature를 build하려고 한다. • 그러나 feature의 상호 의존의 복잡성 때문에 때대로 변경되지 않은 feature가 불필요하게 build된다. • 이것은 시간이 걸리므로 좀더 낳은 platform building process 방법을 보인다. • Building a Selected Component • FeatureView window에서 build될 item선택 • Right-click하고, Build Selected Component click • Making the Image • Build -> Make Image • Environment Variables • Platform Environment Variable Window에서 환경 변수를 변경한 경우, 전체 platform을 rebuild 한다. • CE component(CEC) file에서 환경 변수를 설정하면 programmatically하게 trigger된다. Windows CE.NET

  41. Modifying Configuration Files • 다음 configuration file은 image를 생성하기 위해 build process에서 사용된다: • .BIB files • .REG files • .DAT files • .DB files Windows CE.NET

  42. The Configuration Files: .BIB Files • OS 이미지에 포함되어져야할 모듈과 컴포넌트를 가리키는 텍스트 파일 • Files • Modules • Memory • Config • FILES : static data의 memory partition을 예약한다. • Example Tahoma.ttf $(_FALATRELEASEDIR)\Tahoma.ttf NK SHU • S: System file • H: Hidden file • U: Uncompressed file Windows CE.NET

  43. The Configuration Files: .BIB Files • MODULES : memory에 load되어 지기 위한 object module 명시(.exes/.dll) • Example TASKMAN.EXE $(_FALATRELEASEDIR)\Taskman.exe NK SH • S to define it as a system file • H to define it as a hidden file • R to compress resources • C to compress everything • D to prevent a debugger from running • N to mark a module as non-trusted • P to ignore the CPU type on a per-module basis • K to signal that ROMIMAGE has to fixup the DLL to run properly • PLATFORM.BIB / PROJECT.BIB / CONFIG.BIB Windows CE.NET

  44. The Configuration Files: .BIB Files • MEMORY : OS / Object Store의 크기 및 시작 번지 Data memory – ROM 또는 RAM memory 영역 Program memory – memory application을 위해 예약된 RAM영역 • NK • Nk영역은 800000 hex byte(8388608 byte)의 사이즈 / 시작 번지 8C800000 • Data memory를 위한 ROM을 다룬다. • RAM • RAM영역은 7AFFFF hex bytes의 사이즈 / 시작 번지 8C050000 • Program memory를 위한 RAM을 다룬다. Name Start address Size(bytes) Type NK 8C800000 00800000 RAMIMAGE RAM 8C050000 007AFFFF RAM Config.bib Windows CE.NET

  45. The Configuration Files: .BIB Files • Memory (con’t) • MEMORY section memory type • RAM • program memory와 RAM file system이 존재하는 RAM이 동작하기 위한 Memory영역 명시 • 이 영역들은 연속적이어야 하며, 중간에 메모리를 예약하면 않된다. • 실행중인 프로세스와 RAM base file system을 위한 영역 • RAMIMAGE • ROM처럼 다루어 지는 memory 영역을 명시 / system에 unique해야 함 • 한번만 선언되어야함 • RESERVED • kernel에서 사용하지 않고 application에서 접근 • RAM영역 예약, 다른 영역과 겹치면 않된다.(프레임버퍼 등) • CONFIG : OS image의 압축 / NK.nb0 생성 여부 • Compression 또는 ROM size와 같은 특성을 설정할 경우 사용 Windows CE.NET

  46. The Configuration Files: .REG Files • .REG file은 default registry setting을 정의하기 위해 사용 • HKEY_LOCAL_MACHINE root key에서 Init key • Launch10 와 Launch20에 2개의 string entry • Launch10과 Launch20의 값은 각각 SHELL.EXE 와 DEVICE.EXE의 설정 값 • 이 entry는 kernel이 startup할 때 자동적으로 SHELL.EXE 와 DEVICE.EXE 실행하도록 한다. • COMMON.REG, DATASYNC.REG, DCOM.REG, DIRECTX.REG IE.REG, MSMQ.REG, RDP.REG, SCRIPT.REG WCEAPPS.REG와 WCESHELL.REG • PLATFORM.REG • PROJECT.REG [HKEY_LOCAL_MACHINE\Init] “Launch10”=“SHELL.EXE” “Launch20”=“DEVICE.EXE” *.reg Reginit.ini 통합 압축 Default.fdf Windows CE.NET

  47. The Configuration Files: .DAT Files • .DAT file은 image의 folder 구조를 정의 • 특정 폴더를 생성 및 복사할 경우 사용 • Program Files 과 My Documents라는 2개의 directory가 정의 • Windows CE에서 root directory(\)에 위치 • Program Files는 하나의 My Project 하위 directory를 가지고 있다. • My Document directory는 MyFile.doc라는 file을 포함하고 있다. • 단지 할당만 한다는 것에 주의. • MyFile.doc는 .BIB file에 등록되어야 image에 존재한다. • COMMON.DAT, IE.DAT, MSMQ WCEAPPS.DAT과 WCESHELL.DAT • PLATFORM.DAT • PROJECT.DAT Root:-Directory(“Program Files”) Directory(“\Program Files):-Directory(“My Projects”) Root:-Directory(“My Documents”) Directory(“\ My Documents):-File(“MyFile.doc”,”\ Windows\Myfile.doc”) Windows CE.NET

  48. The Configuration Files: .DB Files • .DB configuration file은 default image database • Windows CE 시스템 및 Application에 사용될 데이터베이스 • .DB file이 포함되어 image 생성시에 사용 • COMMON.DB, WCEAPPS.DB와 WCESHELL.DB • PLATFORM.DB • PROJECT.DB Windows CE.NET

  49. Creating a Component • CEC : CE component file • OAL, device driver 또는 다른 component를 개발한다면, 해당 Component File(.cec)에 의해 Platform Builder Catalog에 추가할 수 있다. • Platform Builder environment에 생성된 component를 importing할 수 있다. • .CEC file은 catalog에 통합되어질 component를 설명한 test file이다. Windows CE.NET

  50. Creating a Component (con’t) • .CEC file은 4개의 다른 type의 block을 가진다 • CECInfo Block : 일반적인 정보를 포함 • ComponentType block : 그룹 혹은 생성된 Catalog 항목 포함 • MaxResolvedImpsAllowed • (Optional)OS Design에 존재해야 하는 같은 형태의 구현에 대한 최대 수를 설정하는 Element • 일반적으로 1을 사용 • RequiredCEModules • (Optional)OS Design에 더불어 추가되어야 하는 모듈을 설정하는 Element Windows CE.NET

More Related