[comp.os.cpm] CP/M Devices

SAC.HQSAC-DOCT@E.ISI.EDU ("John A. Wright") (12/16/87)

I am somewhat confused.  I have downloaded two terminal pgms for my
Osborn I that are supposed to run off the serial port.  Neither does.

In my reading, I have come across the explanation of the "STAT"
command which allows me to assign any physical device to a logical
device.  My problem is that I can't figure out form the book exactly
what that means.

According to the Ref manuel I have the following logical devices:

  CON: >> Keyboard + screen
  RDR: >> serial/parallel/ieee  (Can anyone tell me what a "reader" is)
  PUN: >>   "        "      "   (Can anyone tell me what a "punch" is)
  LST: >>   "        "      "

I have the following physical devices:

  TTY:
  CRT:
  BAT:
  UC1:
  PTR:
  UR1:
  UR2:
  PTP:
  UP1:
  UP2:
  LPT:
  UL1:

Does anyone have a simple explanation for all this, or even a not so
simple one would be a help.

From what I have found, the RS-232 (Serial) port and the 9 pin (modem)
port have about the same functions.  Book says "the modem and RS-232
interfaces are basically one and the same; the primary difference is
that many of the signal levels on the RS-232 connector are help
constant, while you can manipulate them using the modem connector."

It goes on further to say: "If all you need to do is read to and from
the modem/or serial port, simply change the IO BYTE indirectly by
using the CP/M STAT command..."

Seems to me I should be able to run a standard modem off the RS-232
port if I can change the IO BYTE.  Any ideas?

Thanks in advance.

binder@fizbin.DEC.COM (That's not just *any* racket, it's Brahms' Third Racket.) (12/17/87)

From SAC.HQSAC-DOCT@E.ISI.EDU (John A. Wright):
 
> In my reading, I have come across the explanation of the "STAT"
> command which allows me to assign any physical device to a logical
> device.  My problem is that I can't figure out form the book exactly
> what that means.
 
I may not be able to answer all your questions, but I'll take a shot at
what I can.

>   RDR: >> serial/parallel/ieee  (Can anyone tell me what a "reader" is)
>   PUN: >>   "        "      "   (Can anyone tell me what a "punch" is)

These are from the days of my relative youth, John, back when much computer
I/O was done with paper tape.  Much, but not all, of that paper tape was
run through Teletype Model ASR-33 terminals, which were a) reasonably cheap
and b) about the only terminals available.  The ASR-33 is really three
devices in one:  a hardcopy terminal (keyboard and printer), a paper tape
reader, and a paper tape punch.  The three devices all share the same
serial line, which can be wired either half- or full-duplex.

Because a given program may need to talk at different times to various
physical devices whose characteristics may differ widely, CP/M allows you
an easy way to do that.  It embodies the concept of "logical" devices,
which exist only in software.  CON:, KBD:, RDR:, and PUN: are the CP/M
logical devices.  Think of them as black boxes.  It is the task of  the
BIOS to translate the communications to and from the proper formats. 
Inside each of the black boxes, the translation is made between the
program's data transfer protocol and that of the physical device to which
the logical device is assigned.  For example, suppose you want to sell
bread in cases of 12 loaves.  People buying bread want only one loaf at a
time.  You hire a person to take the loaves out of the cases and sell them
one at a time.  You are transferring bread to a logical device named
"Middleman" who is in turn transferring it to physical devices named
"people".

In the case of RDR: and PUN:, these logical devices can be assigned to
physical device TTY: along with logical devices CON: and KBD: -- the result
is that you can then use the paper tape stuff on the Teletype simply by
knowing the right time to stop and start the reader or punch.  Or they can
be assigned to PTR: and PTP:, which are most likely the RS232 port.

> From what I have found, the RS-232 (Serial) port and the 9 pin (modem)
> port have about the same functions.  Book says "the modem and RS-232
>interfaces are basically one and the same; the primary difference is
> that many of the signal levels on the RS-232 connector are help
> constant, while you can manipulate them using the modem connector."
 
On your RS232 connector, signals like DSR (Data Set Ready), CTS (Clear to
Send), and DCD (Data Carrier Detect) are probably wired true so that the
connector will look like a fully functional and ready modem to any printer
that you may attach.  

Other signals such as DTR (Data Terminal Ready) and RTS (Request to Send)
may be wired true so that you can connect a modem without having to
manipulate all the complex RS232 protocol.  Doing this, however, does limit
your ability to monitor system faults, because your hardware won't see it
if the modem goes south.

> It goes on further to say: "If all you need to do is read to and from
> the modem/or serial port, simply change the IO BYTE indirectly by
> using the CP/M STAT command..."
 
> Seems to me I should be able to run a standard modem off the RS-232
> port if I can change the IO BYTE.  Any ideas?
 
Seems to me that you're probably right.  But changing the I/O Byte may not
be necessary.  You may be able to just assign RDR: and PUN: to the
appropriate port.

Cheers,
Dick Binder   (The Stainless Steel Rat)

DEC Easynet:	FIZBIN::BINDER
uucp:		{ decvax, allegra, ucbvax... }!decwrl!fizbin.dec.com!binder
Internet:	binder%fizbin.DEC@decwrl.DEC.COM