🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2268

Re: connecting Win30 (386 enh) programs to devices

#2268
From: Doug McDonald
Date: Wed, 24 Apr 1991 17:59
38 lines
2079 bytes
In article <1991Apr19.195538.23441@ux1.cso.uiuc.edu> mcdonald@aries.scs.uiuc.edu (Doug McDonald) writes:
>I want to use Windows 3.0 (386 enhanced mode) to talk to a device
>(an ADC convertor) that requires interrupts. I got this to work
>just fine by writing a DOS character device driver .sys file, and
>sending commands to it with ordinary DOS writes and getting data
>with ordinary DOS reads. But this appears to only transfer ONE byte at 
>a time. Its inefficient.
>
>
>So I tried using the DOS IOCTL calls - which can transfer several bytes per
>call. I used the MSC 5.1 intdos call. Works fine in real mode -
>bombs in standard and 386 mode.
>
>
>How does one do this? Tools I have: MSC5.1, the Windows 2.11 SDK, 
>and assembler. I also run Qemm386.
>
>
>Doug McDonald (mcdonald@aries.scs.uiuc.edu)


Thanks for the help, folks. Yes, it can be done. You just have to do it right:
open the file with the MSC "open" call, do the IOCTL with the MSC "intdos"
call, then close with MSC close. The handle generated by "open" works
with the direct DOS call. 

Some combination of using "int86" instead of "intdos" and trying to use
"intdos" to call in 44h to do the open caused the bomb. Sigh.

This method of writing your own character mode driver and communicating
this way appears to work fine and be efficient. (Even so-called
character mode devices can happily pass data blocks using this method.) 
A near panacea for connecting Windows 3.0 to things like data collection
devices.


Doug McDonald
Technical Details
Message-ID: <1991Apr24.175931.2198@ux1.cso.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!kuhub.cc.ukans.edu!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!usenet
References: <1991Apr19.195538.23441@ux1.cso.uiuc.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!kuhub.cc.ukans.edu!maverick.ksu.ksu.edu!ux1.cso.uiuc.edu!usenet
From: mcdonald@aries.scs.uiuc.edu (Doug McDonald)
Newsgroups: comp.windows.ms.programmer,comp.lang.pascal
Subject: Re: connecting Win30 (386 enh) programs to devices
Message-ID: <1991Apr24.175931.2198@ux1.cso.uiuc.edu>
Date: 24 Apr 91 17:59:31 GMT
References: <1991Apr19.195538.23441@ux1.cso.uiuc.edu>
Sender: usenet@ux1.cso.uiuc.edu (News)
Organization: University of Illinois at Urbana
Lines: 38