|
|
1.1 root 1: Generic Port I/O Driver
2:
3: Included with this file:
4: a Windows NT device driver to provide simple access to 8/16/32 bit IO
5: ports using IOCTL calls.
6:
7: some simple test programs which read from ports and write to them.
8:
9: This sample is based on a driver submitted by Robert R. Howell, which in turn
10: was based on the adlib driver in the DDK. We cleaned up the comments, tested
11: dynamic loading/unloading and added registry support. Any questions regarding
12: this sample should be directed to Microsoft.
13:
14: This driver provides an example of a minimal driver. Neither it, nor the
15: sample programs are intended to be used in a production environment. Rather,
16: they are intended as a skeleton driver for those devices which do not use
17: interrupts or DMA.
18:
19: ===============================================================
20: BUILDING THE DRIVER AND EXAMPLES:
21: ---------------------------------------------------------------
22: To compile the device driver:
23:
24: 1) Run the "SETENV.BAT" which should be in the MSTOOLS directory. This
25: sets basic environment variables needed by NT. The program does not
26: require any arguments.
27:
28: 2) Run the "SETENV.BAT" which should be in the DDK directory. This sets
29: the environment variables needed by the DDK programs. It does require
30: command line arguments. It will print out instructions if run without
31: arguments.
32:
33: 3) Run "BUILD". This invokes the Microsoft make routines.
34: They produce log files called BUILD.WRN, and BUILD.LOG.
35: The WRN file will contain warnings that no components have been
36: extracted from certain libraries, even if the build succeeds.
37: If it does succeed the driver will be named genport.sys and
38: can be found in the I386 subdirectory created by BUILD.
39:
40: 4) Copy the genport.sys file from the obj\I386 subdirectory created by
41: BUILD to the \WINNT\SYSTEM32\DRIVERS directory where all the NT device
42: drivers are stored. If the system responds "ACCESS DENIED" then a
43: previous version of the file is currently in use, and NT will not let
44: you replace it. You can unload it by typing "net stop genport".
45:
46: ---------------------------------------------------------------------------
47: To compile the NT test programs:
48:
49: 2) Run "SETENV.BAT" which is in the MSTOOLS directory. It sets the
50: environment variables needed by the SDK programs.
51:
52: 3) Run "NMAKE -f gptest.mak". It will build two programs: gpdread and
53: gpdwrite. If you just type the program name without any parameters,
54: they will print instructions.
55:
56: ------------------------------------------------------------------------
57: To install the Generic Port I/O driver (GENPORT) use the REGINI utility to
58: create the entries listed in the genport.ini file.
59:
60: --------------------------------------------------------
61: To use the IOCTL directly, see the comments in the example programs.
62:
63: They
64: 1) Open "\\.\GpdDev" using CreateFile.
65: 2) Read from the port by placing the relative address (0, 1, 2, .. )
66: into a buffer, calling an IOCTL, then reading a buffer.
67: 3) Write to the port by placing the relative address and a
68: value into a buffer then calling an IOCTL.
69: 4) Close the device with CloseHandle.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.