none
Driver port to Win 7 64 bit RRS feed

  • Question

  • Firstly; not sure if I'm in the right forum here, if not, apologies

    I am currently involved in porting a driver from Win XP 32 bit to Win 7 64 bit

    We have a bespoke card using PLX 9056 PCI interface

    Two modes of access set up as follows

    1. Scatter/Gather DMA
      • C# App creates User  RAM buffers
        • Buffer pinned using GCHandle
        • Address of object taken using AddrOfPinnedObject
        • Address passed to driver via IOCTOL call
      • In IOCTL dispatch
        • Create MDL for each buffer
        • MmProbeAndLock for each MDL
      • Driver uses Scatter/Gather DMA to transfer from card to buffers
    1. Bus Master DMA
      • C# App creates a Direct X surface
        • User Virtual address along with size of surface passed to driver via IOCTL call
      • In IOCTL dispatch
        • Physical Address of the surface is passed to the card via DMPBAM & DMRR registers
          • Create MDL for surface User Virtual Address
          • MmProbeAndLock MDL
          • Get Physical Address using Scatter/Gather callback function; SGL 1<sup>st</sup> list entry (Data is assumed contiguous from base address )
          • Ensure that the Base address and range satisfy DMPBAM and DMRR criteria
      • Card may randomly access the surface

    The Scatter/Gather DMA seems to work correctly on both Windows XP 32 bit and Windows 7 64 bit but the Bus Master DMA gives us problems. We have two graphics cards that have previously been supported but now we are getting different results as follows.

    • Windows XP 32 bit
      • ATI Radeon HD4350
        • Bus Master DMA – correct operation
      • ASUS EAH5450
        • Bus Master DMA  - Correct operation

     Windows 7 64 bit

      • ATI Radeon HD4350
        • Bus Master DMA – correct operation
      • ASUS EAH5450
        • Bus Master DMA  - BSOD with no consistent cause reported (lloks like random RAm is being trashed)

     Questions:

    1. Is using the Scatter/gather callback the correct way of getting the Physical Address of the surface?
    2. If not, is there a better way?
    3. As the driver model has changed for Win 7
      1. Can we no longer rely on the MDL describing the “real” surface?
      2. Is the assumption of contiguous data from the surface incorrect?
      3. Is there a known general strategy to cope with this?
    Tuesday, March 10, 2015 9:45 AM