[mod.unix] Unix Technical Digest V1 #31

Ron Heiby (The Moderator) <unix-request@cbosgd.UUCP> (03/26/85)

Unix Technical Digest       Tue, 26 Mar 85       Volume  1 : Issue  31

Today's Topics:
                            Administrivia
                 _avenrun symbol in UniSoft's kernel
                       async disk I/O on Sys V*
                     groups and group permissions
          How can you look at the u.area of another process?
                   BSD4.2 tty flags quick reference
                           Passwd on PC/IX
                         UNIX Device Drivers
                    Which IPC for passing control?
----------------------------------------------------------------------

Date: Tue, 26 Mar 85 18:37:12 GMT
From: Ron Heiby (The Moderator) <unix-request@cbosgd.UUCP>
Subject: Administrivia

Due to popular request, I am changing the treatment of the "Keywords:"
header line with this digest.  The main use for that line will now be to
select what to read, rather than to let "rn" automatically kill what
you do not want.  I will still include NETUNIX for digests made up of
such articles (exclusively).  Thanks for your input.  Ron.
P.S.  The rest of this digest is made up of articles from net.unix and
net.unix-wizards, so "NETUNIX"!  RH.

------------------------------

Date: 24 Mar 85 22:38:01 GMT
From: mts@utai.UUCP (Martin Stanley)
Subject: _avenrun symbol in UniSoft's kernel

Does anyone have any info on the proper interpretation
of the _avenrun symbol in the UniSoft kernel? I have tried interpreting
them (_avenrun+0, _avenrun+1, _avenrun+2) as floats (as on the Vax - BSD4.2),
and as ints (as on the Sun - BSD4.2), but neither seem to make sense.

The system in question is a 68000 Uniplus+ port.
Any help would be appreciated.
-- 

 Martin Stanley, Department of Computer Science, University of Toronto
 Toronto, ON M5S 1A4

 USENET:  {cornell,decvax,ihnp4,linus,utzoo,uw-beaver}!utcsri!utai!mts
 CSNET:	  mts@toronto
 ARPANET: mts.toronto@csnet-relay

------------------------------

Date: 24 Mar 85 04:13:27 GMT
From: boylan@dicomed.UUCP (Chris Boylan)
Subject: async disk I/O on Sys V*

I am thinking about imbedding System V in a product but
need a method of doing overlapped I/O (async).  Is there
such a facility in SV?  We currently have a SIII license
only and there doesnt appear to be anything in the SIII
manuals...

Alternatively, what kind of disk throughput can you get
out of SV?  I need about 75-125K/second (two sequential processes)
an st506 drive on a 68K or pdp-11/[24,73,84].  Can anyone quote
real numbers?

Knowledge based comments greatly appreciated,
-- 
Chris Boylan
{mgnetp | ihnp4 | uwvax}!dicomed!boylan

------------------------------

Date: 21 Mar 85 22:43:59 GMT
From: jwp@uwmacc.UUCP (jeffrey w percival)
Subject: groups and group permissions

I am just about to switch from 2.8BSD to 2.9BSD on my 11/70, and I am a
little confused about groups.  I see in the group file that came on the
distribution tape that there are groups like superuser, bin, sys, uucp,
and so on.  What is the strategy for dealing with these groups?  Are
there standard conventions?  For example:
1. Is bin supposed to own files in /bin?  If root owns the source files,
   do they change ownership upon installation?
2. Why is the user "bin" a member of the group "sys" and vice versa?
3. What is "sys" used for?  How does "sys" differ from "superuser"?
4. Is there any significance to single digit UID's other than 0?

Basically, I am looking for the "standard" interpretation of uid/gid,
and a "conventional" strategy for managing my new system.

-- 
	Jeff Percival
jwp@uwmacc.UUCP  (...!{allegra,ihnp4,seismo,...}!uwvax!uwmacc!jwp)
uwmacc!jwp@wisc-rsch.ARPA
POST: Space Astronomy; UW-Madison; 1150 University Ave; Madison, Wi 53706; USA

------------------------------

Date: 21 Mar 85 13:12:01 GMT
From: srradia@watmath.UUCP (sanjay Radia)
Subject: How can you look at the u.area of another process?

We are creating a new kernel call that requires looking at the u. area
of another process (given its pid) in 4.2BSD.
Is there a convenient function in 4.2 to do this (we haven't been able
to find it)? Or has someone out there done something like this.

Thanks in advance.

-- 
sanjay
UUCP:	...!{ utzoo,decvax,ihnp4,allegra}!watmath!srradia
ARPA:	srradia%watmath%waterloo.csnet@csnet-relay.arpa
CSNET:	srradia%watmath@waterloo.CSNET

------------------------------

Date: 16 Mar 85 09:15:54 GMT
From: chris@umcp-cs.UUCP (Chris Torek)
Subject: BSD4.2 tty flags quick reference

This has all been gone over several times, but here it is again in
condensed format.  (Reference cards anyone?)

SUMMARY OF 4.2BSD TTY DRIVER FLAGS
----------------------------------

TANDEM		4.2 will send ^S to terminal when 4.2's buffers get full
		(use only in CBREAK or RAW, or you'll never get ^Q!)
CBREAK		4.2 will pass characters back to programs one at a time
LCASE		4.2 will simulate lowercase on uppercase only terminal
ECHO		4.2 will echo your typing
CRMOD		4.2 will print "\r\n" for "\n" and will accept both
		"\r" and "\n" as end of line
RAW		none of terminal's output is special in any way to 4.2
		(in particular, 4.2 will hand ^S/^Q to user programs
		regardless of other stty settings)
ODDP		4.2 will accept odd parity and (iff EVENP is off) generate
		odd parity
EVENP		4.2 will accept even parity and will generate even parity
ANYP		4.2 will accept any parity and probably generate even parity
NLDELAY		4.2 will use 1 of 4 time delays after "\n" (control J):
		NL0 => none; NL1,NL2,NL3 increasing
TBDELAY		4.2 will use 1 of 3 time delays after "\t", or (if
		set to XTABS) will expand tabs to right number of spaces:
		TAB0 => none; TAB1, TAB2 increasing
CRDELAY		4.2 will use 1 of 4 time delays after "\r" (control M):
		CR0 => none; CR1,CR2,CR3 increasing
VTDELAY		4.2 will use 1 of 2 time delays after "\f": FF0 => none,
		FF1 => some
BSDELAY		4.2 will use 1 of 2 time delays after "\b": BS0 => none,
		BS1 => some
ALLDELAY	just == NLDELAY|TBDELAY|CRDELAY|VTDELAY|BSDELAY
CRTBS		4.2 will print "\b" character to back up cursor on CRT when
		terminal sends "erase" character (usually DEL or BS or #)
PRTERA		4.2 will print original text inside \/ to "erase" on printer
		when terminal sends "erase" character
CRTERA		4.2 will print "\b \b" to remove text from CRT when terminal
		sends "erase" character
TILDE		4.2 will print backquote instead of tilde (hazeltine kludge)
MDMBUF		4.2 will treat carrier drop as ^S, raise as ^Q.  BEWARE:
		depends on driver; standard DZ driver does not support it
LITOUT		4.2 will send user's 8 bit bytes from write() syscalls
		directly to terminal (no parity, no \n=>\r\n etc).  BUG:
		depends on driver; (re)setting baud rate typically necessary
		to force LITOUT to take effect
TOSTOP		4.2 will stop background processes that attempt to write
		to terminal (sends SIGTTOU; <sys/ioctl.h> comment is wrong)
FLUSHO		4.2 is flushing output to terminal (^O key normally toggles)
NOHANG		4.2 won't send SIGHUP when carrier drops
CRTKIL		4.2 will print "\b \b" to remove line from CRT when terminal
		sends "line kill" character (usually ^U or ^X or @)
CTLECH		4.2 will echo control characters as ^, char (^A, ^D etc)
PENDIN		4.2 will retype input line on next char from terminal
DECCTQ		4.2 will only restart output for ^Q after ^S (other input
		accepted but not yet echoed)
NOFLSH		4.2 will not flush output on signals


NOTES
-----

All of these are settable via stty(1) and TIOCGET/TIOCSET ioctl(2)s.
Some of these have aliases starting with L; these aliases are for
use with TIOCLGET, TIOCLSET, etc.

This is not a comprehensive list of ioctls.

I haven't included local additions for ^T, and hope I haven't included
any other local changes.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland

------------------------------

Date: 19 Mar 85 21:52:30 GMT
From: km@emory.UUCP (Ken Mandelberg)
Subject: Passwd on PC/IX

I just noticed that the PC/IX login command will accept
the superuser passwd as valid for any user. This is not
the case on BSD systems, and I don't know if it comes
from System III (or V), or is special to PC/IX.

The login man page doesn't mention the feature, although
it does discuss items with a similar audience (restricting
root logins on certain terminals, and a logfile of root
logins).

[Ed note:  If true, then this would represent a security problem, not
a feature.  RWH.]

-- 
Ken Mandelberg, Emory University, Dept of Math and CS, Atlanta, Ga 30322
{akgua,sb1,gatech,decvax}!emory!km   USENET
km@emory                      CSNET
km.emory@csnet-relay          ARPANET

------------------------------

Date: 14 Mar 85 14:16:57 GMT
From: espo@bpa.UUCP (Bob Esposito)
Subject: UNIX Device Drivers

Where can I find information on who to write device drivers
for UNIX????

Routines like open, close, read, write, strategy, etc. and
how these routines are built would be great.

Thanks in advance,

Bob Esposito { sb6, burdvax, sjuvax } !espo

[Ed note: Assuming you have the proper source licensing, some options
include the training offered by AT&T (Internals, and Device Drivers)
and the tutorial sessions offered at Usenix Meetings (next this summer
in Portland, OR).  RWH.]

------------------------------

Date: 20 Mar 85 07:40:51 GMT
From: speck@cit-vax.ARPA (Don Speck)
Subject: Which IPC for passing control?

    What is the fastest way to "hand off the torch" from one
cooperating user process to another?

    Scenario:  I have two processes, A and B, which are running
a relay race, so to speak.  "A" is running, and "B" is waiting for
"A"; the goal is for "B" to begin its part of the task as soon as
possible (a couple of milliseconds?) after A finishes its part.
What IPC mechanism should A use to inform B that it's B's turn to
work?  Three mechanisms spring to mind:

1)  Make "A" be a child of "B", have B wait() for A, and let A
    exit.  This is not acceptable, process A must run the next
    leg of the race very soon, and needs to be there to do it.

2)  Connect them with a pipe or socket, and have "A" send a one-
    byte message to "B".
	Question:  after "A" sends the byte, which process is
    running?  The write() on the pipe/socket is not expected to
    block - the pipe was empty - so it seems that "A" will continue
    running until blocked for some unrelated reason.  Meanwhile "B"
    cannot run until "A" relinquishes the CPU.	Is this a correct
    analysis?  This is what I've tried so far, and it's not as fast
    as I first expected; according to vmstat, the processes switch
    context 2-3 times as often as expected.

3)  Have "B" pause() waiting for "A" to send a signal.	Question
    again:  when "A" signals "B", does this trigger the scheduler?

    To be as fast as I'm looking for, it is not sufficient for "B"
    to be awakened quickly:  "A" must immediately stop running.
    "A" will require CPU time to recover for the next round, but
    that should wait until after "B" has gotten started.  Sleep(1)
    will do that, but one second is much too long a pause.

4)  Others?

This is not a real-time process - if the time goal is not met, the
process simply takes longer - so please no flames about real-time
kernel hacks.  I intend to stick to user-mode C code.  I am using
4.2bsd, but would also love to hear how it works on earlier Unixes.

[Ed note:  I'm sure some insights on this matter on System V would be
interesting, as well.  RWH.]

    Don Speck	    speck@cit-vax.arpa	ihnp4!cithep!cit-vax!speck

------------------------------

End of Unix Technical Digest
******************************
-- 
Ronald W. Heiby / ihnp4!{wnuxa!heiby|wnuxb!netnews}
AT&T Information Systems, Inc.
Lisle, IL  (CU-D21)