New README File for Generic Port I/O Driver

ID: Q155341


The information in this article applies to:


SUMMARY

The README file in the Windows NT DDK genport contains insufficient data. This article contains a new README file designed to assist inexperienced NT developers. It can also be a useful reference tool for experienced developers.


MORE INFORMATION

Generic Port I/O Driver

Included with this file are:

The following sample is based on an x86 machine. If you use a Power PC, a MIPS, or an Alpha machine, just replace the processor <i386> with <PPC> or <MIPS> or <ALPHA>.

NOTE: This device driver provides an example of a minimal driver. Neither it nor the sample programs are intended to be used in a production environment. Rather, they are intended as a skeleton driver for those devices that do not use interrupts or DMA.

Building the Driver and its Test Programs

To compile the device driver:

  1. Click the "Free Build Environment" or "Checked Build Environment" icon under your "Windows NT DDK" program's group to set basic environment variables needed by NT.


  2. Change to the directory containing the device source code, such as cd SRC\GENERAL\PORTIO.


  3. Run "BUILD -cef," or use the macro "BLD." This behavior invokes the Microsoft make routines that produce log files called BUILD.LOG, BUILD.WRN, and BUILD.ERR. The WRN file will contain warnings. If the build succeeds, the driver will be named "genport.sys," and it can be found in the I386 subdirectory of your DDK directory. The gpdRead.exe and gpdWrite.exe will be built and placed in the same <i386> output directory.


Driver Installation Examples

  1. Copy the genport.sys file from the <DDK>\Lib\I386\<Free or checked build> subdirectory created by BUILD to the <NTROOT> \SYSTEM32\DRIVERS directory where all the NT device drivers are stored. If the system responds "ACCESS DENIED," a previous version of the file is currently in use and NT will not let you replace it. You can unload it by typing "net stop genport."


  2. Copy gpdREAD.exe and gpdWRITE.exe from the <DDK>\Lib\I386\<Free or checked build> subdirectory created by BUILD to your target \<Test directory> where you will exercise the read and write test.


  3. To install the Generic Port I/O driver (GENPORT):

    1. Copy <ddkroot>\src\general\portio\sys\genport.ini to anywhere in your target machine so you can initialize the registry for this genport driver.


    2. Use the REGINI utility to create the entries listed in the genport.ini file. For example:

      Regini genport.ini
      (You must do this with "Administrator" privilege)

      NOTE: This adds a GENPORT driver key to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\GenPort's tree in the registry. You can verify this by running REGEDT32.EXE and looking in this mentioned location.


    3. Reboot a machine under test.

      When testing the gpdRead.exe or gpdWrite.exe, note that your driver is not loaded if an the error "Can't read from a device" appears on your screen. gpdRead and gpdWrite are defaulted to port address 300h.

      If this port has been claimed by another device, then the driver "genport.sys" won't be loaded and gpdRead and pgdWrite will not function. You can run "winmsd" to see if port address 300h is being used. If it is, go into the "genport" register entry to modify its port address to an unused address, and then reboot your machine. There should also be a message in the event log indicating that the driver didn't load if the conflict did occur.


    4. To test your genport driver, do the following:
      
             gpdRead  -b 1   {This reads a byte from port 0301H }
             gpdWrite -b 1   {This writes a byte to port 0301H }
           




Additional query words: 3.51 4.00 kbdsh Genport


Keywords          : NTDDKKMode 
Version           : 3.50 3.51 4.00
Platform          : NT WINDOWS 
Issue type        : 

Last Reviewed: March 4, 1999