| Home | BDM | TFTP |
ParPort 2000 - Direct I/O Access from Win32 User Mode Applications to PC Parallel Port(s) under Microsoft Windows NT 4.0, Windows 2000 & Windows XP |
| Overview | ParPort 2000
delivers the ability to access PC parallel ports from Win32 applications under Microsoft
Windows NT 4.0, Windows 2000 & Windows XP. Previously, the only way would have been to write an
device driver to perform the I/O on behalf of the application. This kernel mode driver and Win32 library combination allow Win32 applications to execute IN and OUT instructions to the parallel port device hardware I/O ports. Access is coordinated with the standard Windows parallel driver to ensure that the parallel port is only 'claimed' if no other process is currently using it. Once the port is 'claimed', other processes are blocked from using the port (assuming they also use the standard parallel port arbitration scheme). Once the application has finished using the parallel port, it may either exit or call the 'release' API and the parallel port is free for use by any other process again. Now, with one simple command, you can grant parallel port access to a specific application. The program RUNAPP.EXE comes with the ParPort 2000 and can be run to allow another application the Parallel Port. To run a 32bit app use this command: RUNAPP <Parallel Port#> <Application> To run a 16bit DOS app use this command: RUNAPP <Parallel Port#> command.com /c <Application>
|
||||||||||||||||||||||||||||||||||
| How it works | Normally,
under Windows NT / Windows 2000 / Windows XP, access is not permitted to the I/O port range of the
parallel port (and most others). Executing an IN or OUT instruction causes a privileged
instruction exception resulting in termination of the process. The driver works by changing the I/O permission map (IOPM) for the process that 'claims' the indicated parallel port. Changing the IOPM, allows the process free access to the I/O port range of the parallel port hardware. It also supports additional parallel ports added using expansion cards.
|
||||||||||||||||||||||||||||||||||
| The Details | The
API calls are provided in a Win32 DLL. One call is all that is required to use the direct
I/O functionality. The Win32 application is linked with the supplied import library and
the kernel driver is demand loaded as necessary. No tampering with the registry or
rebooting is needed. The API calls are documented here: Include the header file for definitions and function prototypes. #include "ParPort2k.h" The GetParallelPortCount API returns the number of parallel ports present in the PC. INT WINAPI GetParallelPortCount(VOID) Return value:
The GetParallelPortInfo API returns information about the a particular indicated parallel port, such as the physical I/O port address and number of I/O port addresses spanned by the hardware device. BOOL WINAPI GetParallelPortInfo( Arguments:
Return value:
typedef struct { Arguments:
Return value:
The ReleaseParallelPort API frees the parallel port for use by another process. Direct I/O should not be performed after this function is called. If this function is not called, the application will own the parallel port until the application exits or is terminated. BOOL WINAPI ReleaseParallelPort( Arguments:
Return value:
The EnableIOPortRange API allows an application to read/write to a range of I/O addresses. Specifing the start I/O address and the span enables access to the given I/O ports. BOOL WINAPI EnableIOPortRange(
Return value:
For Visual Basic users six functions are provided for input and
output as follows: VOID WINAPI OutWord( VOID WINAPI OutDWord( INT WINAPI InByte( INT WINAPI InWord( INT WINAPI InDWord( |
||||||||||||||||||||||||||||||||||
| I/O Timing | I/O instructions executing in user mode
(ring 3) will take longer than executing in kernel mode (ring 0). It is however, dependent
upon the processor, but the number of clocks taken is generally two to three times that of
comparable real-mode (i.e. MS-DOS) execution. Having said that, it is significantly
quicker than calling down to a kernel mode driver for each IN / OUT instruction as some
other NT I/O drivers require.
|
||||||||||||||||||||||||||||||||||
| Installation | ParPort 2000 developer edition consists of
a header file ParPort2k.h containing definitions and function prototypes, a Microsoft Visual C++ 6.0
compatible import library ParPort2k.lib to be linked with the application and some example test programs. Both C and
Visual Basic examples are supplied. ParPort 2000 runtime edition consists of two files, a kernel mode driver ParPort2k.sys and a dynamic link library, ParPort2k.dll. These files should be distributed with the application. The driver may either be loaded on-demand or may be loaded when the system boots. If the driver is loaded on-demand, the user running the application must have NT administrator rights. If it is envisaged that the user running the program will not have NT administrator rights, the driver can be installed to load at boot. NT administrator rights are still needed during setup, but once completed the driver can be used by non administrative users. A setup program is provided to create the necessary registry entries to load the driver at boot. It can be run in quiet mode so that it can be called from the application setup program or in interactive mode. If the driver will be loaded on-demand, the application setup program can copy the files into the application directory. Running the command setup /h show the setup program options.
To perform a quiet mode installation from another setup program, run the following command setup /q.This will copy ParPort2k.sys to the system32\drivers directory and ParPort2k.dll to the system32 directory and make the necessary registry entries to load the driver on boot. Alternatively, use the setup program in interactive mode as shown below.
|
||||||||||||||||||||||||||||||||||
| Windows 95/98 Support | Under Microsoft Windows 95/98
direct port I/O is allowed to certain I/O address ranges out of the box. The parallel
ports are one such range. When running under Windows 95/98, the library ParPort2k.dll skips the calls
to the kernel driver allowing the same code base and file set to be shipped for both
Windows NT and Windows 95/98. The bios is used to find the number of
parallel ports installed and the addresses of those ports. Two additional
dll's,
ParllI32.dll & ParllI16.dll,
are provided to look up the parallel port information in the bios segment.
Additionally,
PPort2k.vxd, is provided to allow cooperating
applications coordinated access to the parallel ports. |
||||||||||||||||||||||||||||||||||
| Price and Availability |
Unlimited distribution license is $995USD. On-line payment with PayPal For further information please email sales@zeecube.com Please email support questions to support@zeecube.com
|
||||||||||||||||||||||||||||||||||
| License Agreements | Click
here to read the development license agreement. Click here to read the run-time license agreement. |
||||||||||||||||||||||||||||||||||
| Last updated March 10th 2002 | |||||||||||||||||||||||||||||||||||
|
|