Link to home
Start Free TrialLog in
Avatar of rossmcm
rossmcmFlag for New Zealand

asked on

Parallel port direct access under DOS on WinXP machine

I have a legacy app written in DOS Turbo Pascal that talks to hardware over a parallel printer port - i.e the printer port is used as 8-bit ports.  Under Win98 it works fine in a DOS box but I need to run the same app in a DOS box on a WinXP machine.  WinXP of course does not permit direct access to ports.

Does anyone know of a solution that works?.  I've tried a couple that involve running an app to reset the permissions or such like but these hang my machine.
Avatar of SysExpert
SysExpert
Flag of Israel image

DOS compatability mode may work.
windows Xp DOS programs compatability

http://www.sysopt.com/tutorials/article.php/12034_3532691_2

I hope this helps !
Avatar of rossmcm

ASKER

There is no mention of DOS compatibility in that dialog, only Win95, 98, NT, 2k.  I will try it under Win98 however.

Avatar of JohnnyCanuck
JohnnyCanuck

I believe this will help you.

http://www.dosprn.com/

Avatar of rossmcm

ASKER

JohnnyCanuck:

It's not a printing problem I'm having.  Before  Windows the printer port was implemented as a hardware addressed 8-bit port at address $378 etc. and you accessed it via x86 In and OUT instructions. This worked in Win3x, and Win9x platforms but WinXP prevented applications from directly addressing the I/O space, so DOS programs that use the printer port in this way don't work.

SysExpert:

Putting the DOS box into Win98 compatible mode didn't work either
ASKER CERTIFIED SOLUTION
Avatar of JohnnyCanuck
JohnnyCanuck

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rossmcm

ASKER

Thanks Johnny.  DIrect I/O did the trick, but not without some head-scratching.  However the support I got from Michael at Direct-io.com was responsive and helpful, even after I had paid up my $29 !

The main issue that had me stumped was that (in XP anyway) the range of port addresses you need to specify for access to LPT1 is not what you would expect from reading the printer base address from the DOS BIOS at 0000:0408.
 
There are some other snags you have to watch for but these are all covered in the knowledge base.