From: "Matthias Paul" Organization: Rechenzentrum RWTH Aachen To: opendos AT delorie DOT com Date: Wed, 22 Nov 2000 17:01:44 +0100 Subject: Re: changing maximal number of printers X-mailer: Pegasus Mail v3.22 Message-ID: <819875B7423@reze-1.rz.rwth-aachen.de> Reply-To: opendos AT delorie DOT com On Thu, 16 Nov 2000 Patrick Moran wrote: > As far as I know, you can only have 3 printer ports and 4 comm > ports with DRDOS without special drivers for more. These drivers > generally come with multi serial port cards. I suppose the same > would be true for parallel cards. But with all the stuff already > loaded into memory for a server, who needs more drivers!:-) While this is true in general, Multiuser DOS as well as DR-OpenDOS 7.02 & DR-DOS 7.02 make an exception of the rule: Multiuser DOS usually provides an LPT4: device similar to the LPT1:..LPT3: devices and also allows to redefine the default device for PRN: (which is usually the same as LPT1:). It also provides AUX1:..AUX8: (or more?) devices for serial ports. DR-OpenDOS 7.02 introduced the LPT4: device as well, but this was unfortunately removed with DR-DOS 7.03, since reportedly it caused compatibility problems with EGA cards. I doubt, removing LPT4: could have fixed any problems with EGA cards, but if, the problem for sure was with the EGA card, not with the implementation of the LPT4 device: LPT4: worked similar to LPT1:..LPT3:, that is, IBMBIO.COM would pass the request down to the ROM-BIOS. (It might be interesting to know, that IBMBIO's LPT4: support did not cost a single byte of resident memory, while it would, of course, cost a few hundred bytes for an external driver to implement all the necessary device driver functions.) If the ROM-BIOS would know how to handle a fourth printer, it would succeed. If not, you would get an error message as if for a non-existing printer port or off-line printer (depending on the ROM-BIOS). IBMBIO.COM does not directly talk to the hardware. Well, fact is, most ROM-BIOSes do NOT know how to handle a fourth printer, because the ROM-BIOS usually looks up the corresponding I/O base addresses at the start of segment 40h. With PCs and PC/XTs there have been 4 WORDs to hold these addresses such as 3BCh, 378h, and 278h (there is no standard- address for a fourth printer, but some add-on cards can be jumpered to 270h - just to give you an example). The BIOS Data Area also holds a variable named "BIOS Equipment" which contains bit flags indicating the *count* of serial and parallel ports and other devices. However, the problem is that many ROM-BIOSes store wrong information in there, as IBM's original definition of the flags was quite confusing (see Ralf Brown's Interrupt List INTER61 MEMORY.LST for details)... With the introduction of the PC/AT the entry for the fourth printer was reserved for other purposes (and usually is set to 0). PS/2 machines used it to store a pointer to the Extended BIOS Data Area (XBDA), this use has been adapted by most other current machines since a few years. Alright, since the ROM-BIOS does not know of any parallel ports on non-standard addresses (such as 270h) it will not find any additional ports during its initial scan for them. But under DR-DOS 7.02 you can still add support for a fourth printer by loading a tiny TSR, that extends the ROM-BIOS INT 17h and redirects output to port 4 to an I/O address internally known to that driver (if the segment 40h entry for the 4th parallel port is not used for other purposes (that is, zero), you could store the I/O address there, so other programs have a chance to get the address, too). You do not need to implement the whole LPT4: device as this is provided by IBMBIO.COM itself. If your ROM-BIOS does not discard requests for port 4 and attempts to look up the I/O address in the traditional entry in the segment 40h, you do not even need to load such a TSR, all you need is to use the CONFIG.SYS LPT4= directive provided with DR-OpenDOS 7.02+. The syntax is: LPTn=[x][,t] or LPT4=x[,t] whereby n=1..3 logical port number x=1..4 logical port number | 200..3Fx immediate port address (in hex) t=timeout value in fractions of a second (right now, I'm not sure about the unit, but it could well be 1/18 sec.) (The LPT4= directive is a special case, as you cannot give the timeout value without also giving the x value for security reasons. Otherwise it works identical to LPT1=..LPT3=.) So, in above example, inserting: LPT4=270,10 in CONFIG.SYS would be sufficient to fully enable the LPT4: device in DR-DOS 7.02. If you give invalid I/O addresses or the corresponding entries in the BIOS Data Area are already in use for other purposes, you will receive an error message. These directives can also be used to chance the logical order or assign other physical ports than those found by the ROM-BIOS. The ROM-BIOS will continue to use the chanced entries, e.g. LPT1=378 LPT2=278 LPT3=3BC or, in this case (1=3BCh, 2=378h, 3=278h), just LPT1=2 (1=378h, 2=378h, 3=278h) LPT2=3 (1=378h, 2=278h, 3=278h) LPT3=3BC (1=378h, 2=278h, 3=3BCh) if you want to swap some of your ports. Please note, that while the LPT4: device itself was removed from DR-DOS 7.03, the LPTn= and LPT4= directives are not. Even LPT4= is still functional, but you will need to provide the LPT4: device by a device driver (DEVICE=). (Future issues of DR-DOS may possibly reintroduce the LPT4: device, but then it will only be linked into the visible device chain, when the CONFIG.SYS LPT4= directive was also used. Otherwise the LPT4: will be non-visible to external components (that is, not show up with MEM /A). This would fix any possible compatibility problems while still providing the maximum possible support for any count of parallel ports used in a system.) Similar directives named COMn=[x][,t] exist for serial ports: They are useful in particular if your old ROM-BIOS only finds COM1: and COM2:, while you have more serial ports installed. Or, on modern machines with accellerated SVGA cards, the previous standard-address for COM4 (2E8h) is conflicting with the video card hardware, and the ROM-BIOS will still not find any serial ports on non-standard addresses (that is, not 3F8h, 2F8h, 3E8h, 2E8h), so you can use COM4= to point the BIOS to that I/O address... (for example COM4=260) Furthermore, you can change the default assignment of PRN: (to LPT1:) and AUX: (to COM1:) by using the PRN= and AUX= directives. Their syntax is: PRN=0 | 1..3 | 4 AUX=0 | 1..4 The default when not using these directives is 0, which enables a "high-speed" bypass of the redirection code (saving a few clock cycles). If your default printer is on LPT3:, but you do not want to change the logical order of ports for some reason, you could still use PRN=3 to redirect your default printing to LPT3: instead of LPT1: (Please note, that due to the ill-advised removal of the LPT4: device, you must not use the PRN=4 value with DR-DOS 7.03+. This may hang the machine.) For further info on these (and other undocumented directives please have a look at the README.TXT file in the IBMBIOA3.ZIP archive available from the "OpenDOS" pages on my web-site.) Hope it helps, Matthias ------------------------------------------------------------------- Matthias Paul, Ubierstrasse 28, D-50321 Bruehl, Germany eMail: Web : http://www.rhrz.uni-bonn.de/~uzs180/mpdokeng.html -------------------------------------------------------------------