#device driver io
8 messages in this thread
I work for an outfit that sells an application written in assembly language
one of whose hallmarks is the ability to have five printers hooked up at
once to LPT1,2,3 and COM 1 and 2. Output is done direct to hardware ports.
There are some disadvantages to this. Two in particular. One, our users
want output to file. With our current setup it is very hard to do this.
Two, we have a multi-user version but you have to use capture commands to
get the output onto the network printers and on Novell 2.15 you can't
capture more than 3 printers
Something tells me device drivers are the solution. In MS-DOS, you can
direct output to LPT1 by using the Write to File function with 4 in the bx
register because 4 is the predifined DOS file handle for LPT1. Similarly, I
think, you can write to COM1 with the Write to file function using the
predefined DOS handle of 3. Question: what do you have to do in order to
enable the same set up for parallel ports LPT2 or LPT3, or serial port
COM2? Do you need to write device drivers for them or what? I think I
could do this in Turbo Pascal, but I need to do it on the Assembler level
and I am not sure of all that TP is doing "under the hood". The books I
have seen mention interrupt 21h, service 44h, device i/o but have no
concrete examples of their usage. Any ideas of suitable references?
Steve
If you haven't yet read Ray Duncan's "Advanced MS-DOS", run to the store
right now and get it. It's got about the best discussion of device drivers
that I've seen.
I'll get back to you on the device I/O. I've done it but don't have my
reference (i.e. Duncan) with me…..I think I lent it to someone
(grrrrrrr…).
No, you do not have to write device drivers for COM2 or LPT2 or LPT3.
Those device drivers are already installed and all you have to do is access
them.
I've written a program that walks the device driver chain in your machine
and reports on what it finds. I've (ahem….Jon, are you listening?) sent
it to Jon Erikson along with an article. If he says it's OK to give it to
you before it's published, I'll zip you a copy.
Good luck.
JIM
Thanks, I'd like to see the article. Through the good offices of people
here and CLMFORUM, I have learned that it is quite easy to open files with
names of LPT2 etc. and that DOS already supports these. That is all I
needed to get going, though the idea of device drivers is something I'll
need to learn more about. Will check out the Duncan book. My boss has it.
Steve, check out the capabilities of the Digital Research operating
system "Concurrent DOS". We have been using it for about 5 years
and it is great for multi-task control applications. It has built
in interrupt driven device drivers for serial printer ports, and
the Concurrent controls,inc versions can have 8 or 16 serial ports
(or more). "GO DRFORUM" to find out more info.
We are using JPI Modula-2 and others say they use turbo-pascal
and turbo-c, so tools should not be any problem.
Hope this helps. Carl.
Is CDOS also multi-user?
Carl, thanks for the info, but you're not the only one I've talked to who
misunderstands the problem we have, so I guess I'm not explaining it well.
Concurrent DOS may be a fine system and I have heard that is so but I am
not just trying to solve the networking problems in my shop but to write a
program to run on various networks that our customers may be using. Such a
program must be hardware-independent as well as independent of any given
network software's unique methods, regardless of how good they may be. Now
it may be that there is no other method besides what I regard as the
kludgey method of capture that is hardware and network independent , but
that is what I want to find out and to know.
Fine by me Jim. Jon
Have you tried opening a file handle called "LPT2"? This is DOS function
3D. This will allow you to use the Write to File function 40 with the
handle returned from the open instead of predefined handles.