首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 嵌入开发 > WinCE >

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

2012-02-16 
WINCE6.0怎么把PUBLIC的代码移植到自己的BSP下我想修改storage的代码,我把这个文件夹复制到我的BSP下,然后

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好像


[解决办法]
我遇到过这种情况,是因为source文件中引用到mdd库部分还是用到public下面到,结果编译到不是自己添加注释到那部分,所以没有输入自己添加到打印信息。
[解决办法]
Public Code 是在 Phase 1(Sysgen) 生成, 看來LZ只改到了 library 這地步, 請將其 sources 中TARGETTYPE 改為Build成 dll, 並參考 %_WINCEROOT_%\PUBLIC\COMMON\CESYSGEN\makefile, , 將其需要的 library 寫入 TARGETLIBS 中.

Paul, Chao @ Techware

[解决办法]
public 下的storage目录都复制到bsp下,然后修改BSP下相应dirs文件,
storage的bot下的source文件参考以下修改:
TARGETNAME=usbmsfn

TARGETTYPE=DYNLINK
RELEASETYPE=PLATFORM
SYNCHRONIZE_DRAIN=1
DLLENTRY=DllEntry
DEFFILE=usbmsfn.def

SOURCELIBS=

INCLUDES= \
..\inc; \
..\..\inc; \


TARGETLIBS=\
$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\scsi2dad.lib \
$(_SYSGENOAKROOT)\lib\$(_CPUINDPATH)\ufnclientlib.lib \
$(_PUBLICROOT)\common\oak\lib\$(_CPUINDPATH)\storeapi.lib \
$(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib
# $(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\usbmsfn_lib.lib \

SOURCES= \
bot.cpp


$(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib这一项ce5和ce6路径可能有点差别,你看着改就行了

热点排行