基于windriver开发驱动,64位平台和32位平台一次解决
来源:互联网 发布:儿童听故事软件 编辑:程序博客网 时间:2024/06/05 00:09
一:
在基于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].
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.-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.
- When distributing your application to target 64-bit platforms, you need to provide with it the WinDriver-API DLL/shared object for 32-bit applications executed on 64-bit platforms — <WD64>\redist\wdapi1240_32.dll on Windows / <WD64>/lib/libwdapi1240_32.so on Linux. Before distributing this file, rename the copy of the file in your distribution package by removing the _32 portion. The installation on the target should copy the renamed DLL/shared object to the relevant OS directory — \%windir%\sysWOW64 on Windows or /usr/lib on Linux. All other distribution files are the same as for any other 64-bit WinDriver driver distribution, as detailed in Chapter 14.
- An application created using the method described in this section will not work on 32-bit platforms. A WinDriver application for 32-bit platforms needs to be compiled without the
KERNEL_64BIT
definition; it needs to be linked with the standard 32-bit version of the WinDriver-API library/shared object from the 32-bit WinDriver installation (<WD32>\lib\x86\wdapi1240.lib on Windows / <WD32>/lib/libwdapi1240.so on Linux); and it should be distributed with the standard 32-bit WinDriver-API DLL/shared object (<WD32>\redist\wdapi1240.dll on Windows / <WD32>/lib/libwdapi1240.so on Linux) and any other required 32-bit distribution file, as outlined in Chapter 14.
- 基于windriver开发驱动,64位平台和32位平台一次解决
- 基于WinDriver的64位驱动开发环境配置
- PHP 内置 函数 32 位 和 64 位平台兼容性问题
- 32位和64位平台锁大小比较
- 32位与64位平台
- 64位平台转32位平台总结
- VS2013 32位平台切换到64位平台
- 32位平台代码向64位平台移植
- 32位平台和64位平台C代码的一个小差异
- 64位平台C/C++开发注意事项
- 64位平台C/C++开发注意事项
- 64位平台C/C++开发注意事项
- 64位平台C/C++开发注意事项
- 关于win64位系统与32位开发平台
- Linux 32和64位平台下支持LFS
- 使用VC6.0在32位平台上开发64位程序
- 使用VC6.0在32位平台上开发64位程序
- 使用VC6.0在32位平台上开发64位程序
- Android开源框架——Retrofit入门(一)
- DOM节点
- js工作经验笔记
- (2)栈
- vue如何导入外部js文件(es6)
- 基于windriver开发驱动,64位平台和32位平台一次解决
- ubuntu 的所有配置
- adb安装及使用
- 图像的透视变换_matlab
- bzoj 1797: [Ahoi2009]Mincut 最小割
- python写算法题:leetcode: 32. Longest Valid Parentheses
- Python字典dict
- ActiveMQ的核心使用展示
- 棋盘问题