Author: Wenbin
Home: Wen Bin Program Network
http://www.wenbinweb.com
After the first two edges, we have created and free to modify their own platform. This time I will add a little theoretical knowledge in order to deepen the understanding of the CE generation process. Before this, it is necessary to explain that the directory structure of CE is very large and complicated. Many things in future work will depend on your level of understanding of the directory structure, where there is no big change in the CE5 folder structure Therefore, friends who want to understand this part can be directly referred to the relevant part of the "WinCe Experiment Tutorial". Slightly different from CE4 is that your own platform in CE5 is not stored in the public folder, but a pair of Pbworkspaces folders, which is more convenient to manage and have clear structure.
We focus on or the generation process of CE, that is, what do Platform Builder do for you when compiling?
In fact, the IDE has experienced four phases in the process of generating CEs, respectively, Sysgen, Build, Copy, Make, component generation phase, compilation phase, Release folder copy phase, and image packages. Below we will explain it in phases.
Under the public folder is the available components that CE provides us, we customize your own platform to choose a part of the components you need from here. In these folders, all available library files, header files, DEF files, of course, also include all of the extensive function descriptions. The Sysgen phase is to do is to select the header files, library files, and export functions required for our own platform to create the components needed for our own platform. It is tagged in the way C annotation so that it can be exported to select the required part. Finally, the link to all the required libraries will be given to our own platform. It is put it. WinCE500 / PBWORKSPACES /% ProjectName% / WinCE500 /% CPU_TYPE% _X86 / CESysgen folder.
After the previous stage, the needed header library file is ready, but this is only the system component part, and our platforms are all other things such as various equipment drivers, which will be done in the build phase.
The entire build phase is done around the Dirs file and the Sources file. The former decides which folders to be compiled, the latter determines which files have to be compiled, that is, this phase is to complete is a variety of sources. The compilation process of the program. Let's take a look at the contents of these two files.
DIRS files can be found in a lot of folders, which lists the subfolders to participate in compilation, and the content is generally as follows:
DIRS_CE = /
CEDDK /
Regenum /
PCIBUS /
In this way, Build.exe can be found in the compilation folder at the time of compilation. As in these optional_dirs, the meaning of DIRS_NTANSI and other items can be helpful.
Similarly, the Sources file has specified for the compilation method involved in the compiled source. For example, through TargetName specified by TargetName, the type compiled by TargetType is EXE, DLL or lib, through DLLENTRY, the entry point of the DLL file, by incrudes Specify the header files needed during the compilation process, and the source files that participate in the compiled process are specified by Sources. These macros have a more detailed description in helping documents, as long as this compilation mechanism can be understood.
Next, all compilation is completed, the DLL is good, EXE is also self-organized, the next step is a copy process, that is, put your project folder under the Wince500 folder under your project folder. The content is copied to the Release folder, which is nothing to say. The final step is to package, the file that is ready to be prepared, packaged into an operating system mirror file like NK.bin. In this process, a completed file merge, registry compression, resource file replacement, and packaging four sub-processes.
The following files are combined with the focus of the file merger:
- All .bib files are merged into CE.BIB
- All .reg files are incorporated into reginit.ini
- All .dat files are merged into initobj.dat
- All .db files are incorporated into initdb.ini
I know that after these mergers, you can find it in Release whether you have made changes to the target platform.
Registry compression will compress the reginit.int file into a default.fdf file.
Resource replacement is to replace resources in EXE or DLLs such as Simplified Chinese.
The next is to make NK.bin files such as these CE.BIBs, which is the file we need, but in CE5, it seems that you can change the name of this file in the project settings, readers can try themselves.
These compilation processes said above, in the Build OS menu in Platform Builder, it is more clear, this is much better than CE4, you can master some steps separately. If you modify the source program of a component, you can just click on this component and compile this component separately, and finally it is image, in short, flexibility is better.
At the same time, after the above analysis, Platform Builder can also be seen in helping to generate CEs, basically relying on folder structures and those text files and batch files, so it is interested in familiar with the folder structure. At the same time, it also proves that those who always say that the batch documents are useless. In Microsoft's operating systems and development tools, the batch file is critical, saying that it is useless because it is not enough because of its own level.
Ok, this time we have much less, but these knowledge is still necessary to understand, don't forget to learn about your folder structure!