Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

raw mode vs cooked mode

11 views
Skip to first unread message

Ajit Rasiah

unread,
Feb 19, 1991, 7:43:58 PM2/19/91
to
Hello,

I would like to write a program which will get characters from the terminal
in "raw" mode. The default is "cooked" mode. Can someone point me in the
right direction? I am using a Sun Workstation running UNIX 4.2 BSD.

Please reply to A.J.R...@massey.ac.nz

Many thanks in advance.

Guy Harris

unread,
Feb 26, 1991, 2:19:19 PM2/26/91
to
>>I would like to write a program which will get characters from the terminal
>>in "raw" mode. The default is "cooked" mode. Can someone point me in the
>>right direction? I am using a Sun Workstation running UNIX 4.2 BSD.
>
>This should be in a FAQ somewhere. If your system groks termio, then
>here is what you could have:

It's what he should have *if*, by "raw mode", he means "a mode in which
the parity and bits-per-character are the same as 'normal', characters
are made available to a program reading from the device as they're
typed, and the only characters that are treated specially are the XON
and XOFF characters."

That happens to be what a lot of people who want some flavor of "less
cooked" mode want. Others may want a raw 8-bit data path with *no*
characters treated specially (for, say, binary data transfer), or may
want the interrupt characters to be treated specially. I have no idea
what the person who asked the question wanted; they didn't give any
details, they just asked for "raw" mode.

The "old" tty driver (V7, and its pre-4.3-reno BSD descendant)
had RAW for the raw 8-bit data path, and CBREAK for "make characters
available as they're typed, and don't treat the erase/kill/<RETURN>/etc
characters specially." To turn of the interrupt characters as well, you
could set them to '\377', as in CBREAK mode input was stripped to 7 bits
(unless you turned PASS8 on, in 4.3BSD or later).

(RAW also turned off any special character handling on *output*.)

The "new" tty driver (S3, S5, 4.3-reno and successors, POSIX) does a
better job of specifying those modes; you have much finer control over
what the driver does.

(Also, since they said the Sun was running "UNIX 4.2 BSD", I suspect it
was running a SunOS release prior to 4.0, which means that, unless he
was working in the S5 environment, the system *doesn't* grok "termio" -
it has the "old" tty driver.)

Chris Torek

unread,
Mar 1, 1991, 9:37:44 PM3/1/91
to
In article <63...@auspex.auspex.com> g...@auspex.auspex.com (Guy Harris) writes:
>(Also, since they said the Sun was running "UNIX 4.2 BSD", I suspect it
>was running a SunOS release prior to 4.0 ...)

No doubt.

Please note that:

1. 4.2BSD does not run on Suns. 4.2BSD runs on the
VAX 11/780 (and /785), the 11/750 (and variants),
and the 11/730 (and variants).

2. 4.3BSD does not run on Suns either. 4.3BSD run on
the same set of VAXen, plus the VAX 630 (MicroVAX II)
and VAX 8600. It does not run on Suns.

3. 4.3BSD-tahoe runs on the same set of VAXen, plus the
VAX 8200 and 8250 (and 83x0, but uses only one CPU).
It also runs on the `Tahoe' series of computers
(sold by CCI, Sperry, Harris, and ICL). It does not
run on Suns.

4. 4.3BSD-reno runs on the above set plus the HP 9000/300
series. It does not run on Suns.

5. 4.4BSD does not exist. Believe no claims about it (not
even this one :-) ).

6. Various versions of SunOS run on Suns and VAXen, but you
cannot get the VAX versions.
--
In-Real-Life: Chris Torek, Lawrence Berkeley Lab EE div (+1 415 486 5427)
Berkeley, CA Domain: to...@ee.lbl.gov

Guy Harris

unread,
Mar 2, 1991, 4:58:00 PM3/2/91
to
> 6. Various versions of SunOS run on Suns and VAXen, but you
> cannot get the VAX versions.

And, unless you think SunOS 3.0 was the acme of SunOS development, you
probably don't want the VAX version, either - nobody bothered porting it
to the VAX after 3.0. (And "sunvax" was, I think, retired a while ago,
so I don't expect anybody *to* port it.)

0 new messages