*BSD News Article 15366


Return to BSD News archive

Xref: sserve comp.unix.questions:33729 comp.unix.wizards:29335 comp.unix.internals:5758 comp.unix.bsd:11940 comp.sys.3b1:5611 alt.folklore.computers:36292
Newsgroups: comp.unix.questions,comp.unix.wizards,comp.unix.internals,comp.unix.bsd,comp.sys.3b1,alt.folklore.computers
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!agate!howland.reston.ans.net!zaphod.mps.ohio-state.edu!ub!galileo.cc.rochester.edu!rochester!rit!isc-newsserver!ultb!nmw1638
From: nmw1638@ultb.isc.rit.edu (N.M. Williams)
Subject: I need info on line discipline programming
Message-ID: <1993Apr29.192653.8006@ultb.isc.rit.edu>
Sender: news@ultb.isc.rit.edu (USENET News System)
Nntp-Posting-Host: ultb-gw.isc.rit.edu
Reply-To: nmw1638@ultb.rit.edu ()
Organization: Rochester Institute of Technology
Date: Thu, 29 Apr 1993 19:26:53 GMT
Lines: 55

[Note cross-posting]

Hi, I need information on how line disciplines interact with tty drivers
and the kernel in SVR3.x. I include here a copy of the linesw definition
in <sys/conf.h>.

Any help would be greatly appreciated. (BTW, I have a 3b1 running
SVR3.51m, this is the target system).

******<sys/conf.h> extract*********

#include <sys/types.h>
#include <sys/iobuf.h>

/*
 * Line discipline switch.
 */
struct linesw {
	int	(*l_open)();
	int	(*l_close)();
	int	(*l_read)();
	int	(*l_write)();
	int	(*l_ioctl)();
	int	(*l_input)();
	int	(*l_output)();
	int	(*l_mdmint)();
};
extern struct linesw linesw[];

extern int (*ldmisc[])();

extern int	linecnt;

******end conf.h extract*****

From what I know so far every tty driver on my sys uses the line
discipline linesw[0]; a PD/free package implements select(2) on this
system by preempting linesw[0].l_input, it checks some stuff, calls some
select(2) related routines if necessary, and then returns control to the
original l_input function.

I have some projects for which I would need to know how the functions in
linesw interact with the drivers and with the kernel so I can program my
own.

Again, I would really appreciate any pointers, anything on this stuff,

thanks in advance,

Nick
-- 
                                                                 ______         
E-mail: nmw1638@cs.rit.edu nmw1638@ultb.isc.rit.edu              \ \/ /       
Snail Mail: CPU 645, 25 Andrews Memorial Dr, Rochester, NY 14623  \/\/
DOSophobic, VMSophobic, UNIXphile (exAMIGAphile). Standard Disclaimers apply.