Leonsoft
驱动小牛
驱动小牛
  • 注册日期2003-05-08
  • 最后登录2012-08-11
  • 粉丝1
  • 关注0
  • 积分21分
  • 威望281点
  • 贡献值1点
  • 好评度103点
  • 原创分0分
  • 专家分0分
阅读:2222回复:9

有哪位写过AMD64BITs下的driver,并在Windows XP 64bit上运行的?

楼主#
更多 发布于:2005-02-05 11:29
我现在要将以前的Windows XP(32bit)driver 移植到AMD64bit Windows Xp 64bit平台下,有谁做这方面的开发工作?
因为我的driver里面用了不少C++得class,所以我把数据类型变成64bit,还有pointer一定要用64bit,但是我用windows 2003 AMD64DDK
 build,没有成功啊,而且没有生成任何.obj文件。
还有,安装64BIT driver相关的.inf文件有什么不同?
谢谢哦

各位新年快乐。
I will do the best with what the God gave me.
bmyyyud
驱动老牛
驱动老牛
  • 注册日期2002-02-22
  • 最后登录2010-01-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望130点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2005-02-05 12:34
问wowocock
滚滚长江东逝水 浪花淘尽英雄 是非成败转头空 青山依旧在 几度夕阳红 白发渔樵江渚上 惯看秋月春风 一壶浊酒喜相逢 古今多少事 尽付笑谈中
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
板凳#
发布于:2005-02-06 09:44
数据无所谓,还是用32位即可.AMD64默认的数据类型就是32位.
但指针必须为64位,也就是说你不能用DWORD来表示指针了,应该用P*
32位移植到64位要遵守一些准则.可以到AMD的网站上下来看看.
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
xuzheng318
驱动牛犊
驱动牛犊
  • 注册日期2005-01-24
  • 最后登录2005-03-04
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2005-02-06 15:01
建议楼主看看amd64处理器的帮助文档,了解一下指令集,其实没有很大的区别!
shenming365
驱动牛犊
驱动牛犊
  • 注册日期2004-04-08
  • 最后登录2008-06-27
  • 粉丝0
  • 关注0
  • 积分157分
  • 威望18点
  • 贡献值0点
  • 好评度13点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2005-02-06 15:51

重新编译就可以了
我用INF没安装成功
但用SCM安装成功过.
www.software168.com
Leonsoft
驱动小牛
驱动小牛
  • 注册日期2003-05-08
  • 最后登录2012-08-11
  • 粉丝1
  • 关注0
  • 积分21分
  • 威望281点
  • 贡献值1点
  • 好评度103点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2005-02-07 17:16
数据无所谓,还是用32位即可.AMD64默认的数据类型就是32位.
但指针必须为64位,也就是说你不能用DWORD来表示指针了,应该用P*
32位移植到64位要遵守一些准则.可以到AMD的网站上下来看看.

请教Wowocock大虾

1。MS的AMD64DDK自带的compiler可以编译C++ class代码吗?
2。而且我source code里面有些子目录,我用自带的编译器,build后,没有一个.objt文件,而且每个目录下都生成了一个新的目录。这是为什么?
3。我code里面还有asm引用的汇编代码,请问可以直接这么用吗?

谢谢
新年好运。
I will do the best with what the God gave me.
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
6楼#
发布于:2005-02-07 19:26
1。MS的AMD64DDK自带的compiler可以编译C++ class代码吗?
应该可以,不过我不用C++ CLASS来写驱动,因为我自认功力不够.

2。而且我source code里面有些子目录,我用自带的编译器,build后,没有一个.objt文件,而且每个目录下都生成了一个新的目录。这是为什么?
什么目录??我没有碰到过该情况.

3。我code里面还有asm引用的汇编代码,请问可以直接这么用吗?
不可以,AMD64的MS的CL不支持内部汇编,但提供了一些INSTRINC的函数来代替汇编的功能,可以到AMD的网站下,或者你用ML64手动编写纯汇编代码然后和你的C代码驱动连接.
由于AMD64下函数不使用STDCALL所以注意参数的传递.
RAX,RCX,RDX,R8~R11可以随意使用,其他的注意保存,同时AMD64下没有类似PUSHAD的指令,所以只能分开保存,,,,,,
花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
bmyyyud
驱动老牛
驱动老牛
  • 注册日期2002-02-22
  • 最后登录2010-01-21
  • 粉丝0
  • 关注0
  • 积分1000分
  • 威望130点
  • 贡献值0点
  • 好评度106点
  • 原创分0分
  • 专家分0分
7楼#
发布于:2005-02-08 11:40
大家都有64位处理器了吗?惨啊!!!我还没有,郁闷!
滚滚长江东逝水 浪花淘尽英雄 是非成败转头空 青山依旧在 几度夕阳红 白发渔樵江渚上 惯看秋月春风 一壶浊酒喜相逢 古今多少事 尽付笑谈中
Leonsoft
驱动小牛
驱动小牛
  • 注册日期2003-05-08
  • 最后登录2012-08-11
  • 粉丝1
  • 关注0
  • 积分21分
  • 威望281点
  • 贡献值1点
  • 好评度103点
  • 原创分0分
  • 专家分0分
8楼#
发布于:2005-02-17 09:36
1。MS的AMD64DDK自带的compiler可以编译C++ class代码吗?
应该可以,不过我不用C++ CLASS来写驱动,因为我自认功力不够.

2。而且我source code里面有些子目录,我用自带的编译器,build后,没有一个.objt文件,而且每个目录下都生成了一个新的目录。这是为什么?
什么目录??我没有碰到过该情况.

3。我code里面还有asm引用的汇编代码,请问可以直接这么用吗?
不可以,AMD64的MS的CL不支持内部汇编,但提供了一些INSTRINC的函数来代替汇编的功能,可以到AMD的网站下,或者你用ML64手动编写纯汇编代码然后和你的C代码驱动连接.
由于AMD64下函数不使用STDCALL所以注意参数的传递.
RAX,RCX,RDX,R8~R11可以随意使用,其他的注意保存,同时AMD64下没有类似PUSHAD的指令,所以只能分开保存,,,,,,
 


那么在Windows XP下安装driver,和Win32下有什么不一样?.inf文件有什么不一样的?谢谢!!
I will do the best with what the God gave me.
wowocock
VIP专家组
VIP专家组
  • 注册日期2002-04-08
  • 最后登录2016-01-09
  • 粉丝16
  • 关注2
  • 积分601分
  • 威望1651点
  • 贡献值1点
  • 好评度1227点
  • 原创分1分
  • 专家分0分
9楼#
发布于:2005-02-18 09:52
  
 Microsoft.com Home | Site Map
 
  
 Search Microsoft.com for:

 
    

WHDC Home | WHDC Site Map  

Search WHDC for
 
 
 
Getting StartedPC FundamentalsDevice FundamentalsDriver FundamentalsDevelopment Tools and TestingWindows Logo ProgramWHQL TestingDriver MaintenanceResources and SupportDriver DevConWinHEC

 Driver Fundamentals > Device and Driver Installation
INF Requirements for 64-bit Systems
Changes to INF Requirements for the Microsoft Windows Server 2003 Service Pack 1 Operating System
Updated: January 6, 2005
Microsoft Windows Server 2003 SP1 and later versions of Windows do not install driver packages with undecorated INF sections on x64-based systems. For compatibility with Intel Itanium systems, Windows Server 2003 SP1 will install driver packages with undecorated INF sections; however, INF decorations are required by the "Designed for Windows" Logo Program for Hardware, so a driver package with undecorated INF sections cannot qualify for the Logo.

This paper describes changes to INF requirements that affect device installation on non-x86-based 64-bit systems (Intel Itanium and AMD64). In this paper, "x64" refers to 64-bit architecture used in AMD64 and Intel Extended Memory 64 Technology systems.

Future versions of this preview information will be provided in the Windows Server 2003 SP1 Driver Development Kit.



On This Page
 Introduction
 How INF Decorations Affect Driver Package Installation
 INF Files for Multiple Platforms
 Installing Undecorated INFs on X64-based Systems
 Checklist: Summary Actions for Driver Developers

Introduction
Windows XP introduced the ability to specify a TargetOsVersion decoration for the INF [Models] section name, although these decorations were not mandatory. Support for INF decorations for the Intel Itanium platform was introduced in Windows XP to support installation of device drivers on both 32-bit and 64-bit systems.

On Windows Server 2003 and earlier versions of Windows, when a user attempts to install a driver package with an undecorated INF file on an Itanium-based system, PnP allows the attempt, because current INF syntax rules allow undecorated sections to be installed on all platforms. When the platform mismatch is detected on the service binary, the installation fails in an unintuitive way and it is unclear to the user why it failed.

Consumers do not necessarily understand the differences in 32-bit and 64-bit Windows operating systems or the differences among x64-based, Itanium-based, and x86-based architectures.

To protect users against attempting to install INF-based device driver packages on the wrong system platform and to help manufacturers avoid the associated support costs, INF syntax requirements have changed as follows for Windows Server 2003 SP1:

Driver INF files on Windows Server 2003 SP1 and later versions of Windows must decorate entries in the [Manufacturer] section and [Models] section names with .ntia64 or .ntamd64, as appropriate, to specify operating system versions on non-x86 based systems. This change does not affect INFs for x86-based systems.

Important: The operating system will enforce this change for x64 versions of Windows Server 2003 SP1, beginning with Release Candidate 1. Manufacturers should update non-decorated INF files for all 64-bit platforms (x64 and Intel Itanium) as described in this paper.

Top of page
How INF Decorations Affect Driver Package Installation
An INF section is considered to be decorated when its name contains a TargetOSVersion suffix that identifies a particular platform and operating system. Decorated sections contain installation information that is relevant only to the platform and operating system specified by TargetOSVersion.

Installation Behavior for Windows Server 2003 and Earlier
This section describes how the operating system treats decorated and undecorated INFs during installation for the original release of Microsoft Windows Server 2003 and earlier versions of Windows. The following example shows how typical undecorated [Manufacturer] sections and [Models] section names might look in a device driver package INF file:

[Manufacturer]
%mycompany% = MyCompanyModels

[MyCompanyModels]
%MyDev% = mydevInstall,mydevHwid
This example does not use TargetOsVersion decorations. Device matching syntax rules for Windows Server 2003 and earlier versions of Windows allow these statements to be parsed to install on any platform. Ideally, the user would not be given the choice of installing this device package unless it was certain that the package had the correct binary files, but this INF file would not prevent such an installation.

The following sample shows the same [Manufacturer] section and [Models] section name with a TargetOSVersion decoration that specifies the x64-based platform, where "x64" refers to the 64-bit architecture used in AMD64 and Intel Extended Memory 64 Technology systems. The .ntamd64 decoration in the INF is used for all x64-based systems.

[Manufacturer]
%mycompany% = MyCompanyModels,NTamd64

[MyCompanyModels.NTamd64]
%MyDev% = mydevInstall,mydevHwid
When this driver package is installed, the INF parser builds up a section name including the decoration, and then checks to see whether the section name applies to the platform being targeted. If so, then the INF parser looks for that section name within the INF and uses that section if it exists.

On Windows Server 2003 and earlier versions of Windows, if the decorated section does not exist, the INF parser then checks any undecorated sections for a match. Because these decorations are not commonly used, if there is a device match, PnP would attempt to install the driver on the wrong platform.

Installation Behavior for Non-x86-Based 64-bit Platforms for Windows Server 2003 SP1 and Later
On Windows XP and the original release of Windows Server 2003, the INF parser uses the decorated section name if a decorated section name is specified; otherwise, it uses the undecorated section. However, in Windows Server 2003 SP1 and later versions, the INF parser does not look for undecorated section names on x64-based platforms.

On non-x86-based platforms running Windows Server 2003 SP1 and later versions, the INF parser requires the TargetOsVersion decoration for the [Models] section name. For example, if a user attempts to install an undecorated driver package on an x64-based system, PnP does not find a decorated [Models] section name and therefore does not try to match any device IDs.

Note: Storage drivers that use undecorated INFs will initially load using F6 but will generate bug check 7B when the system restarts for the last time after GUI Mode setup, because the F6 mechanism does not use SetupAPI logic to load the storage drivers. To install such drivers, either get a newer version of the driver that uses 64-bit INF decorations, or decorate the INF manually as described in "Installing Undecorated INFs on x64-based Systems" later in this article. It is not possible to recover from bugcheck 7B; instead, you must update the storage driver as described and restart the setup process using F6.

Summary of Installation Behavior by Windows Platform
The following table summarizes the behavior of decorated and undecorated INFs on various platforms and Windows versions.

Table 1. INF Decorations and Installation Behavior by Platform and OS Version

  Undecorated Decorated for x86 Decorated for Itanium Decorated for x64
Windows 2000
x86-based platform
 •
 X
 n/a
 n/a
 
Windows XP
x86-based platform
 •
 •
 X
 n/a
 
Windows Server 2003 SP1
x86-based platform
 •
 •
 X
 X
 
Windows Server 2003 SP1
Itanium-based platform
 •/X*
 X
 •
 X
 
Windows Server 2003 SP1
x64-based platform
 X
 X
 X
 •
 


• Device models within the corresponding INFs are found and matched for potential installation.

X Device models within the corresponding INF are not found; installation does not occur.

* Undecorated INFs for Itanium-based platforms are allowed to avoid breaking released driver packages. New driver packages for Itanium-based platforms must use decorated sections to qualify for the "Designed for Windows" Logo.

Top of page
INF Files for Multiple Platforms
Multiple-platform INFs can be created by including decorated sections for x64- and Itanium-based systems and either undecorated or ntx86-decorated sections for x86-based systems.

Note: Driver packages with decorated INFs will not install on Windows 2000. Decorations were implemented for the first time on Windows XP.

Two approaches can be used to support driver packages for multiple platforms:

• Method 1: Provide an individual INF for each platform

 
• Method 2: Provide a single multiple-platform INF for all supported platforms
 

Method 1 is preferred, because at a minimum it requires only a single decoration on the [Models] section name. With Method 2, the INF parser provides the available syntax to decorate different sections and create a single INF. However, the resulting INF is more complex and might be more difficult to maintain.

The following example shows a multiple-platform INF.

[Manufacturer]
%mycompany% = MyCompanyModels,NTx86,NTia64

[MyCompanyModels.NTx86]
%MyDev% = mydevInstallx86,mydevHwid

[MyCompanyModels.NTia64]
%MyDev% = mydevInstallia64,mydevHwid
For more information, see "Creating INF Files for Multiple Platforms and Operating Systems" in the Windows DDK documentation.

Top of page
Installing Undecorated INFs on X64-based Systems
The following workarounds can be used to install undecorated INFs on x64-based systems. These workarounds are intended only for use on test systems and are not recommended for production drivers.

Method 1. Turn off the undecorated models check for AMD64. To turn off the undecorated models check for AMD64-based systems only, create the following non-zero numeric registry value:

HKLM\Software\Microsoft\Windows\CurrentVersion\Setup:
REG_DWORD: DisableDecoratedModelsRequirement

Set the key to a non-zero value (such as 1) and restart the system, then install the driver.

Method 2: Edit the INF to add decorations. You can manually add decorations to the INF as described in this article or as shown by decorated INFs for other 64-bit driver packages. This will break the signature of a signed driver, but allow the driver to be installed (subject to the signed driver policy in effect on the local machine).

Top of page
Checklist: Summary Actions for Driver Developers
[Manufacturer] section entries and [Models] section names of INFs must be decorated for driver packages to install on x64-based systems, and they should be decorated for Intel Itanium-based systems. These decorations are supported on all versions of Windows later than the original release of Windows XP; therefore, an INF decorated in this way will work on all released NT-based Windows operating systems for the respective non-x86-based platforms.

If Windows 2000 compatibility is required, then INF sections should remain undecorated, but can be decorated if the driver installation package is targeted for Windows XP or later.

Call to Action for INF Files for 64-bit Windows

• Update INFs as soon as possible for driver installation packages for x64- and Itanium-based platforms by implementing decorated [Manufacturer] section entries and [Models] section names.
 
• Ensure that drivers and installation routines developed for x64- and Itanium-based systems include 64-bit kernel-mode drivers and 64-bit class installers and coinstallers, as described in this article and in the Windows DDK.
 

References

• New INF Platform Extension for 64-bit Versions of Windows XP
 
• Device and Driver Installation topics on Windows Hardware and Driver Central
 
• Windows DDK
Creating INF Files for Multiple Platforms and Operating Systems
INF Manufacturer Section
INF Models Section
INF Version Section
 

Top of page
 
   Printer-Friendly Version Send This Page Add to Favorites Comments

Manage Your Profile |WHDC Newsletter |WHDC Japan |WHDC Taiwan |WHDC Icon Key
?2005 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement  
  

花开了,然后又会凋零,星星是璀璨的,可那光芒也会消失。在这样 一瞬间,人降生了,笑者,哭着,战斗,伤害,喜悦,悲伤憎恶,爱。一切都只是刹那间的邂逅,而最后都要归入死亡的永眠
游客

返回顶部