Help with line disciplines

Dave Shepperd shepperd at dms.UUCP
Sat Apr 15 14:01:01 AEST 1989


I've written a command line editor (an interactive "screen mode" type
editor) and installed it as a line discipline in a Xenix/386 2.3.1
system and it works...mostly. I have some meaty questions about the
inner workings of the kernel that I hope someone out there can answer.

What does the kernel expect the line discipline routines to do EXACTLY?
I mean what bits in what structures does it want twiddled and, more
importantly, what bits does it want left alone? I'm concerned the most
about the l_open, l_close and the l_ioctl functions. I have made
assumptions about what the others do and apparently guessed right
because the editor works. This question may be best answered by suggesting
a book on the subject.

The problems I am having are when multiple streams are established to
the terminal. It seems some utilities call l_ioctl before calling l_open
(such as stty), while others call l_open before calling l_ioctl (such as
shl). I want the ld to keep separate structures for each stream for
edit functions and input history so it's necessary to distinguish between
them. It's not clear to me how to do that.

Is it always correct for the l_open and l_ioctl routines to assume the
u structure has meaningful data in it (or that it is even accessible)?

How does a driver, given the process group number, access the list of
processes belonging to that group? (ps does it somehow). I believe I will
need to access this list at interrupt time.
-- 

Dave Shepperd.	    shepperd at dms.UUCP or weitek!dms!shepperd
Atari Games Corporation, Sycamore Drive, Milpitas CA 95035.
(Arcade Video Game Manufacturer, NOT Atari Corp. ST manufacturer).



More information about the Comp.unix.xenix mailing list