re: xx-DOS (im)possible problem!

Eric Auer <[email protected]> Tue, 12 Nov 2002 03:19:59 +0100 (MET)
Newsgroups gmane.os.freedos.devel
Message-ID <[email protected]>
Hi, INT 0x17 is indeed NOT normally handled by DOS. However,
as you use network printing, the network driver probably tries
to redirect it. But it would be better to use the PRN or LPT1
device instead of INT 0x17 to access network-redirected printers.

It is possible that the MS-Client driver does not at all modify
INT 0x17 and what you get is the status of the local printer port
instead (try to connect a printer, put the local printer in online/
offline/error states...). Windows DOES modify INT 0x17 in the DOS box
because it wants to capture DOS printing data and redirect it to the
Windows queue, to avoid that DOS programs mess with the printer
directly (AFAIK).

INT 17 - PRINTER - GET STATUS
        AH = 02h
        DX = printer number (00h-02h)
Return: AH = printer status (see #00631)

Bitfields for printer status:
Bit(s)  Description     (Table 00631)
 7      not busy
 6      acknowledge
 5      out of paper
 4      selected
 3      I/O error
 2-1    unused
 0      timeout
Notes:  If both, bit 5 "out of paper" and 4 "selected" are set, the MS-DOS/
          PC DOS kernel assumes that no printer is attached.

ACK is - I think - only a bit that flashes for a moment when the printer
tells you that it successfully received the data. With no printer attached,
it is probably stuck to a different value than the idle state of an attached
printer would be. While the timeout bit comes from the BIOS, most other bits
are just what you see at some I/O port, partially inverted by the BIOS.

Eric