一:
在基于windriver开发驱动来说,对于个人并不喜欢这种东西,但是效率需求,需要使用这种中间件。但是在创建工程的时候往往是创建一个64位的工程,因为我们当前电脑64位,在里面我们可能直接发布出64位版本的驱动,也可能发布出32位的版本驱动,但是注意,这个32位只能在64位平台上跑,在32位平台是跑不起来的,这和windriver有关。哪不能为了开发驱动安装俩个系统吧,然后装俩个windriver,32位版和64位版,然后使用各自的库,当然是可以的,但这样也太麻烦了。其实我们明白的是在32和64位先调用的dll是不一样的,也就是说windriver是区分了32位下的库和64位下的库,但是直接替换dll也是不行。解决方案是dll肯定是要替换,在编译的时候去掉64位工程中的一个64bit的宏然后就可以在32位平台运行了。
二:下面是官方说明:
A.2. Support for 32-Bit Applications on 64-Bit Windows and Linux Platforms
By default, applications created using the 64-bit versions of WinDriver are 64-bit applications. Such applications are more efficient than 32-bit applications. However, you can also use the 64-bit WinDriver versions to create 32-bit applications that will run on the supported Windows and Linux 64-bit platforms [A.1].
In the following documentation, <WD64> signifies the path to a 64-bit WinDriver installation directory for your target operating system, and <WD32> signifies the path to a 32-bit WinDriver installation directory for the same operating system. |
To create a 32-bit application for 64-bit Windows or Linux platforms, using the 64-bit version of WinDriver, do the following:
- Create a WinDriver application, as outlined in this manual (e.g., by generating code with DriverWizard, or using one of the WinDriver samples).
- Build the application with an appropriate 32-bit compiler for your target OS, using the following configuration:
-
Add a
KERNEL_64BIT
preprocessor definition to your project or makefile.In the makefiles, the definition is added using the -D
flag:-DKERNEL_64BIT
.The sample and wizard-generated Linux and Windows GCC makefiles and the Windows MS Visual Studio projects, in the 64-bit WinDriver toolkit, already include this definition.
-
Link the application with the specific version of the WinDriver-API library/shared object for 32-bit applications executed on 64-bit platforms —<WD64>\lib\amd64\x86\wdapi1240.lib on Windows / <WD64>/lib/libwdapi1240_32.so on Linux.
The sample and wizard-generated project and make files for 32-bit applications in the 64-bit WinDriver toolkit already link to the correct library:
On Windows, the MS Visual Studio project files and Windows GCC makefiles are defined to link with <WD64>\lib\amd64\x86\wdapi1240.lib.
On Linux, the installation of the 64-bit WinDriver toolkit on the development machine creates a libwdapi1240.so symbolic link in the /usr/lib directory — which links to<WD64>/lib/libwdapi1240_32.so — and in the /usr/lib64 directory — which links to <WD64>/lib/libwdapi1240.so (the 64-bit version of this shared object).
The sample and wizard-generated WinDriver makefiles rely on these symbolic links to link with the appropriate shared object, depending on whether the code is compiled using a 32-bit or 64-bit compiler.
-
|