flat assembler
Message board for the users of flat assembler.

Index > Windows > IOPL under XP for DOS applications.

Author
Thread Post new topic Reply to topic
edfed



Joined: 20 Feb 2006
Posts: 4320
Location: Now
edfed 06 Jan 2009, 21:09
hello, i am guessing how to modify the IOPL for DOS applications under XP in order to use for example an old program who will print on a serial printer.

otherwise, is it possible to replace all references to serial port by a WIN32 service in a DOS under XP?

thanks in advance.
Post 06 Jan 2009, 21:09
View user's profile Send private message Visit poster's website Reply with quote
Grom PE



Joined: 13 Mar 2008
Posts: 114
Location: i@grompe.org.ru
Grom PE 06 Jan 2009, 22:01
edfed wrote:
otherwise, is it possible to replace all references to serial port by a WIN32 service in a DOS under XP?


Yes, using VDD calls I think.

There also was a driver that allowed port I/O in WinNT family, I don't remember the name.
Post 06 Jan 2009, 22:01
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 07 Jan 2009, 07:02
Here's a program that may help:
Quote:
The WinIo library allows 32-bit Windows applications to directly access I/O ports and physical memory. It bypasses Windows protection mechanisms by using a combination of a kernel-mode device driver and several low-level programming techniques.


Here's a link:
http://www.internals.com/utilities_main.htm
Post 07 Jan 2009, 07:02
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier 07 Jan 2009, 08:51
Or,

You can use standard Win32/64 API's to open, configure, write to, and read from both serial ports and parallel ports. Using CreateFile to "open" the port and ReadFile and WriteFile for input/output. See:

http://msdn.microsoft.com/en-us/library/ms810467.aspx

hth,

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 07 Jan 2009, 08:51
View user's profile Send private message Reply with quote
DJ Mauretto



Joined: 14 Mar 2007
Posts: 464
Location: Rome,Italy
DJ Mauretto 07 Jan 2009, 11:29
The best way is use a driver or Windows API for that,anyway i have posted some code to modify IOPL under XP professional with user privilege ( RING 3) and let you use ALL I/O ,but i have removed the code because it's not safe Wink

_________________
Nil Volentibus Arduum Razz
Post 07 Jan 2009, 11:29
View user's profile Send private message Reply with quote
Japheth



Joined: 26 Oct 2004
Posts: 151
Japheth 07 Jan 2009, 18:55
edfed wrote:
hello, i am guessing how to modify the IOPL for DOS otherwise, is it possible to replace all references to serial port by a WIN32 service in a DOS under XP?


There is a Win32 API supplied by NTVDM - VDDInstallIOHook() - which allows to catch any accesses to specific ports. It's supposed to be used by VDDs, which are Win32 dlls. So the answer to your question is yes - theoretically. In practice the ports of the legacy serial/parallel devices are already hooked when your VDD is loaded.

To see if a port is hooked just use DEBUG.COM. If

-I <port>

returns anything different than FF, then there is some emulation installed already.
Post 07 Jan 2009, 18:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.