Internal Structure and steps of Windows Mobile Compilation

Source: Internet
Author: User
Tags builtin

Compilation is divided into four stages.
(1) cesysgen compilation phase
This is the first phase of compilation, completed by sysgen. bat. This part first excluded users from the customization of the platform
Files corresponding to system functions are removed from the compiled list, and header files, Def files, and. Lib related to custom functions are retained.
Files, which will be used to compile the DLL and other files generated during subsequent compilation. In addition
Header files and library files can be used to export the Platform SDK.
In the IDE integrated development environment, this Part has two names: Generate System headers and re-generate
System headers. In fact, their functions are the same. Re-Generate System headers first sets the existing Header
Delete all files, and then filter the files again before processing. Re-Generate System headers will spend a lot
Time, but after the user re-configures the system structure, this is still necessary. After you have configured the system configuration
After configuration, compilation in this phase is not required every time the operating system is compiled.
Figure 19 is compiled in this phase.

(2) BSP compilation phase
Compilation of this step is completed by build.exe. After this stage, the compilation process will take up most of the Compilation Time.
The compiler will compile the kernel, graphic interface module, event subsystem, and OEM Adaptation LayerSource codeAnd add these parts and
The files compiled by BSP are linked together. These modules are closely related to the hardware platform and therefore must be supported by BSP.
Hold. The kernel module is connected to oal, and nk.exe is used. A special set of files will be used in this phase.
It will guide how to compile and decide which files need to be compiled and linked. Which paths will dirs indicate?

Find the file to be compiled. The sources file defines how files need to be compiled. These two
Files are only text files, but they describe a lot of information about the compilation process. The format of these two files is based on
Makefile. The dirs file can be equivalent to a workspace in a visual C ++ environment. While
The sources file can be viewed as a project file. The sources file is relatively complex, but it basically sets
Module compilation and link sequence as well as the source files to be included and compiled.
The contents of the Dir file under kaola BSP are as follows:
Dirs = \
Drivers \
GWe \
Kernel \
PMU
The preceding lists the directory items to be scanned during this phase of compilation. After the compiler enters these directories, scan these
The dir file or the sources file in the directory (either of them) to recursively scan all directories.
(3) buildrel compilation stage
This phase is mainly completed by the buildrel. BAT file. It will compile the target file, EXE, or
DLL files, which are copied from their respective directories to the release (_ flatreleasedir) files prepared for image compilation.
Recording. The target files and subdirectories under BSP will be copied to the target folder to obtain the middle of each module compiled in the previous stage.
File. In the integrated development environment, the overall compilation of the operating system will be copied to _ flatreleasedir in all required files.
Directory.
(4) makeimg compilation stage
This stage is executed by the makeimg.exe file, which is the final compilation phase, linking all binary files
To generate an operating system image file suitable for a specific platform. In this phase, process
File. It also needs to solve the xip problem in all modules.
This compilation phase mainly consists of three child stages.
The first stage integrates various configuration files, such as bib, dat, Reg, and DB.
Configuration file. The integrated information is stored in a master file. Table 1 shows these files and the corresponding master
File.
Table 1 configuration files and corresponding master files
Description of the source file merged master
Common. bib,
Config. bib,
Project. bib,
Latform. bib
Ce. bib describes
Windows CE File
Common. Reg,
Project. Reg,
Platform. Reg
Reginit. INI provides the registry entry for operating system image files
Common. dat,
Project. dat,
Platform. dat
Initobj. dat provides descriptions of operating system image files and various directories.
1 9
Continue table
Description of the source file merged master
Common. DB,
Project. DB,
Platform. DB
Initdb. ini defines Windows CE Object Storage Service
In the second sub-stage, makeimg replaces the specified
Module. After the resource is updated, makeimg starts romimage to enter the third compilation sub-stage.
Link and locate all xip files in the third sub-stage. Create an image file for the ROM file system.
This file system will eventually be integrated into the Windows CE Unified File System. After Windows CE is started,
All files under \ Windows correspond to the ROM file system. Romimage will eventually create the NK. Bin Image File
. This image file can be in Sre or bin format and can be interpreted by the programmer and downloaded to the target machine.
. SRE is a file format based on ASCII Hex and is widely used in embedded systems.
Microsoft provides binary file formats similar to SRE.

2. Explanation of the configuration file in compilation
(1) reg file
The reg files used during Windows CE. Net compilation are almost the same as those on other Windows systems.
The main difference is that Reg version marker is deleted from the file header. The reason for this is to prevent the default
. Because If reg version marker is retained, double-click
The reg file icon directly integrates the default reg file into the custom platform, instead of editing this
File.
The following is an example of the content of the Registry file. The key is enclosed by an arc. the subkey has been assigned a value, and
Data Type and default value.
Strataflash block driver.
[HKEY_LOCAL_MACHINE \ drivers \ builtin \ stratafmd]
"Membase" = DWORD: b8380000
"Memlen" = DWORD: 01f80000
; PCMCIA driver
[HKEY_LOCAL_MACHINE \ drivers \ builtin \ PCMCIA]
"DLL" = "PCMCIA. dll"
"Order" = DWORD: 0
"Iclass" = multi_sz: "{6beab08a-8914-42fd-b33f-61968b9aab32} = PCMCIA
Card services"
The above is the content of the Registry File Excerpted from the platform. In this sectionCodeDefines the driver information of the two devices: Flash
And PCMCIA device driver.
The keys in Flash are membase and memlen subkeys. Membase indicates the physical start address of flash.
8380000, memlen defines the flash capacity, 1f80000 is 32 MB. In the pcmcia driver, the driver
The sequence is located in the dynamic link library of PCMCIA. dll, And the iclass and guid representing the device are defined.

(2) bib File
Romimage uses the binary image builder (bib) file to configure the ROM file system. Bib file is
In a text file, different keywords are used to define different sections.
The module section starts with the keyword modules, which lists the executable files of xip.
Other File sections that need to be added to the image starting with the keyword file. These files include bitmaps, Data
File and HTML pages ). It can also describe non-xip executable modules. Files listed in file. The default value is
Compressed to reduce space usage.
The following describes the structure of the bib file:
<Target Name> <whitespace> <workstation path> <memorysection> <flags>
<Target Name> is the file name that will appear in the ROM file system, that is, in/windows. <Workstation
Path> refers to the path of these files in the development environment. <Memory section> generally "NK ".
<Flags> values listed in table 2 can be used.
Table 2 flags values and descriptions
Flags
C compressed encryption (file section is encrypted by default to save space)
U uncompressed unencrypted (modules section default)
R only encrypts Resources
H. Hide the file
S System File
There are two sections in the bib file, which usually appear in the config. bib file. They are:
Memory section, which defines the Memory Distribution of the target system. It uses the following format tag:
<Name> <virtual address> <size> <type>
<Type> values in Table 3 can be used:
Table 3 type description of memory Section
Value Function
Ram describes the available Ram zone, which is used to run processes and file systems. This Ram zone is required
Must be continuous.
The ramimage description area is regarded as Rom.
The memory area in the reserved range is reserved. Memory in this region may be used as video
Frame Buffer or direct memory access (DMA) buffer.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.