[net.micro.cpm] CP/M I/O Device Status ?

mel (04/22/83)

Is there a convention for handling I/O device status in CP/M?  I have a DEC
Rainbow 100 equipped with CP/M-86 and regular CP/M 2.2, and a printer port with
handshake, a vt100 terminal emulator, and a communications port tied to the
CP/M paper tape reader/punch.  Only the keyboard has a CP/M status indicator
(BDOS call #6 with magic code 0feH returns non-zero if a keyboard character
has arrived).  I have found an 8088 address (0:02b4bH) that contains a count
of characters that have arrived and not been processed on the comm. port (paper
tape reader).  I have not been able to find any similar flagging of when the
display is ready to receive another character (only a problem on "clear
screen" at 9600 baud or faster), or when the comm. port (paper tape punch) can
accept another character, or when the printer can accept another character (a
real problem, since printers are usually very slow).  My port of YAM to the
Rainbow sometimes screws up the display in vi and emacs at 9600 baud, and
cannot handle the printer at all (CP/M hangs in BDOS call #5 and loses
characters from the comm. line).  Bugs easily fixed if the status indicators
were there to test.  Questions:
A. Does anyone know how to test for: display ready, comm. line ready, or
printer ready on the Rainbow ?
B. Assuming I find out how to test these status indicators, how should CP/M be
patched to present them ?  Another magic code to BDOS call #6 ?  Additional
BDOS calls ?  or should I just add additional BIOS jump table entries ?  or is
it hopeless, and only direct I/O kludges should be used in the programs ?
C. How did this situation come about ?  Isn't CP/M a mature system able to
support even these simple, fundamental things ?  How does MS-DOS handle I/O
device status ?        Mel Haas  ,  houxm!mel