CompuServe Thread

#device driver io

8 messages in this thread
#23521From: Steve CohenJan 6, 1990 9:27 AM
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?
#23531From: Jim MischelJan 6, 1990 9:07 PM
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
#23563From: Steve CohenJan 8, 1990 9:06 PM
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.
#23663From: Carl W. SumnerJan 17, 1990 10:37 PM
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.
#23676From: Ted DickensJan 18, 1990 10:21 PM
Is CDOS also multi-user?
#23692From: Steve CohenJan 19, 1990 9:12 PM
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.
#23569From: Jon EricksonJan 9, 1990 11:31 AM
Fine by me Jim. Jon
#23535From: Bruce LoflandJan 6, 1990 11:05 PM
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.