## The SCATGATH Sample

The SCATGATH Sample accompanies Chapter 7 and illustrates how to program a DMA transfer for a PCI bus-mastering device having scatter/gather capability.

The sample includes one component:

- SCATGATH.SYS is a WDM driver for a non-existent hardware device.

### Building SCATGATH

To build SCATGATH.SYS, follow the general instructions for building a WDM sample. The Microsoft Visual C++ project file is named SCATGATH.DSP.

### Testing SCATGATH

SCATGATH doesn’t have a test program. I put it into the book in order to verify that the code examples used in the text would actually compile successfully. A reader reports that he copied this sample without important change into a driver and found that it worked correctly.

### What to look for

ReadWrite.cpp contains the routines used for DMA using a scatter/gather list built by the system. Look at the routines named StartIo, DmaExecutionRoutine, OnInterrupt, and DpcForIsr.