当前位置: 代码迷 >> WinCE >> WINCE6.0如何把PUBLIC的代码移植到自己的BSP下
  详细解决方案

WINCE6.0如何把PUBLIC的代码移植到自己的BSP下

热度:435   发布时间:2016-04-28 13:56:05.0
WINCE6.0怎么把PUBLIC的代码移植到自己的BSP下
我想修改storage的代码,我把这个文件夹复制到我的BSP下,然后修改了sources文件,现在可以正常编译,但是好像不起作用,我加的打印信息没打印出来,搞过的给点提示啊

------解决方案--------------------
参考一下Burce Eitman的这篇博文:

Platform Builder: Clone Public Code

I recently wrote an article about modifying the behavior of KernelIoControl when called by User Mode code. In that article, I stated that you need to clone the Public oemioctl code to your platform. Sounds so simple doesn’t it, and really it isn’t that difficult if you know what you are doing, but for the rest of you I thought that I would walk through the process of cloning code.
Many of us use the term “clone code” but what does it really mean? Cloning code means to copy the code to another build tree and modify the build environment to build the code under the new tree. In the old days of Windows CE development, that meant reverse engineering how Microsoft builds the code to apply your knowledge of the build system to it. Today we have sysgen_capture.bat to do most of the hard work for us.
Here is how I would clone oemioctl:
1. Create a new folder in my platform to build oemoctl.dll, I will call mine OALIoctlDir. This folder will be a holding place for two new folders; one will build the lib that is built in Public\Common\OAK\oalioctl, and the other will link the lib to create the dll. You certainly can create the dll with one folder, but that is more involved that the discussion here.
2. Copy the %_WINCEROOT%\Public\Common\OAK\OALIOCTLfolder and paste it as a new subfolder of OALIoctlDir. This is the folder that creates OALIoctl.lib.
3. Create an new folder in OALIoctlDir named BuildDll; this is the folder that will do the linking to create OALIoctl.dll.
4. Create a dirs file OALIoctlDir that contains

DIRS=oalioctl BuildDll
This tells build to go into OALIoctl first to build the lib, then go to BuildDll to link the dll.
5. Add OEMIocltDir to its parent folder’s dirs file, which tells build to build our clone of OALIoctl.dll.
6. Modify OALIoctlDir\OALIoctl\sources to:
a. Add RELEASETYPE=PLATFORM, this tells build to put the lib in the platform build tree
b. Change the TARGETNAME to oalioctl_lib
c. Remove WINCETARGETFILE0=$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\$(DEFFILE)
7. Open a build window and change directories to OALIocltDir\BuildDll
8. Run “sysgen_capture OALIoctl” which will create a file named sources.OALIoctl. This new file contains the information that Microsoft uses to link OALIoctl.lib to create OALIoctl.dll, we need that information to build.
9. Rename souces.OALIoctl to sources, so that build.exe can use it.
10. Modify OALIoctlDir\BuildDll\sources to 
a. change $(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\OALIoctl.lib to $(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\OALIoctl_lib.lib
b. Change the DEFFILE to DEFFILE=OALIoctl.def
11. Copy OALIoctl.def from OALIoctlDir\oalioclt to OALIoctlDir\BuildDll, this is necessary so that when BuildDll is built it can find the def file. There are alternative solutions for this, but this one is easy.
12. Copy a makefile from one another folder to BuildDll, this is necessary because build.exe needs the makefile when it calls nmake.
13. Change directories to OALIocltDir and run build
14. Now you have an OALIoctl.dll in your Platform’s Target folder. When you run buildrel, this OALIoctl.dll will overwrite the one created in the Public folder.
Now you have a clone of OALIoctl that you can modify to suit the needs of your platform.

------解决方案--------------------
参考
http://blog.csdn.net/aaa_tnt/article/details/6977671
------解决方案--------------------
sysgen_capture好像
  相关解决方案