Version information:
V2.01         Fixed a bug which always disabled interrupts 15..31 when
              any interupt was setup to be auto disabled
V2.02         Fixed a bug when interrupt information was exhanged.
              Bug can cause a 'bad pool' error (e.g. error 0xC5)
V2.03         Minor changes to compile with Windows Server 2003 DDK
V3.00         Changes to make 32-bit processes under a 64-bit environment
              also abe to use the driver

Directory overview:

SAA7146A
  Debug       The DEBUG version of the driver.
  DEBUGVIEW   Run DBGVIEW this to see the debug information the driver
              generates. Makes it possible to debug-check without
              having a second system (debug-system).
              GREAT UTILITY!! Saves a tremendous amount of time!
  DELPHI      Delphi 5 sample application and driver interfacing.
  Release     The RELEASE version of the driver.
  WDMBOOK     The book 'Programming the Windows Driver Model'
              including samples and the electronic version of the book
              (use for reference only! DO NOT COPY)

  The SAA7146A directory itself contains the driver source code itself.


Windows 2000 Device Driver Development Kit ('old')
==================================================
The driver source code can be build using Microsoft Visual C++ 6.
Note: for the driver to compile you need to have a WDM DDK installed!
It is based upon the 'Programming the Windows Driver Model' book by
Walter Oney (which also includes a templeta for building drivers
using Visual C++).
The driver was build using the *standard* version, which generates
2 warnings:
  "Command line warning D4002 : ignoring unknown option '/Os'"

According to Microsoft you can not use the standard edition to create
a driver....
Also according to Microsoft WDM drivers for different systems (98/ME/2000)
are *not* binary compatible (only source code compatible). This would
mean that you have to build a driver for each of those different systems
using the correct DDK for that system.

Having said that. I have not encountered any problems (yet) using the
*standard* edition of Visual C++. I used the Windows 2000 DDK to build
the driver and have installed the driver on a Windows ME system.


Steps for installation of development programs
Note: Relates to rather old MSDN package


1. Install MS Visual Studio c++ 6.0
   Use a directory name WITHOUT spaces!

2. Install the latest service pack (SP3)
   MSDN Development platform English Disc 8

3. Run Visual Studio at least 1 time

4. Install platform SDK
   MSDN Development Platform English Disc 3

5. Install W2000 DDK
   MSDN Development Platform English Disc 14

6. You might have to manuall add the DDKPATH environment variable:
   SET DDKPATH=.....


When compiling you will get two warnings (which you can ignore):
"Command line warning D4002: ignoring unknown option '/Os'"

Also you will get a warning about a missing SIWPATH (which is for
a Soft-Ice/W debugger).


What does the driver do?
All communication with the driver is through device-IO control
codes.
It supports the following (see source code for more details):
  GET_VERSION
    Returns the version information (major and minor version).
  GET_STATUS
    Return the status (number of interrupts, last status of ISR register,
    DMA buffer information).
  SAA7146_READ
    Read a SAA7146 register.
  SAA7146_WRITE
    Write to a SAA7146 register.
  WAIT_NOTIFY
    Wait for an interrupt to occur
    Note: make sure that the caller has its own handle to the driver.
          If not, others using the same handle will be stalled too.
          Only one (1) caller is allowed to use this call at any time!
    Use GENERATE_EVENT if you want the wait to be terminated manually.
  GENERATE_EVENT
    Generate an event so the WAIT_NOTIFY will be ended manually
  DMA_ALLOCATE
    Allocate DMA memory. The driver can handle a total of 32 allocations.
  DMA_RELEASE
    Release DMA memory.



Windows Server 2003 Driver Development Kit
==========================================
The code can also be build with the Windows Server 2003 Driver Development Kit.
This kit also contains the compiler to build the driver. This kit can be requested
on CDROM from Microsoft. At the moment this kit is free of charge (you only pay
some transport/handling fees).

For compilation you do the following:
. Start up the required build environment (use 'free' for driver without debug
  code).
. Execute 'build -cZ'