The code in drivers/line-discipline.cc moved around a lot, and as a result the comment trying to explain the purpose of this file got moved to the middle of the file, and referred to no longer existing functions.
This patch moves and updates the comment. No actual code changes. Signed-off-by: Nadav Har'El <[email protected]> --- drivers/line-discipline.cc | 52 ++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/drivers/line-discipline.cc b/drivers/line-discipline.cc index 4e21769..082c392 100644 --- a/drivers/line-discipline.cc +++ b/drivers/line-discipline.cc @@ -4,6 +4,33 @@ * This work is open source software, licensed under the terms of the * BSD license as described in the LICENSE file in the top-level directory. */ + +// Console line discipline thread. +// +// The "line discipline" is an intermediate layer between a byte- +// oriented console driver (e.g., a serial port) and the Unix tty device +// implementing features such as input echo, line editing, etc. In OSv, this +// is implemented in a thread (see read_poll()), which is also responsible +// for read-ahead (input characters are read, echoed and buffered even if +// no-one is yet reading). +// +// The code below implements a fixed line discipline (actually two - canonical +// and non-canonical). We resisted the temptation to make the line discipline +// a stand-alone pluggable object: In the early 1980s, 8th Edition Research +// Unix experimented with pluggable line disciplines, providing improved +// editing features such as CRT erase (backspace outputs backspace-space- +// backspace), word erase, etc. These pluggable line-disciplines led to the +// development of Unix "STREAMS". However, today, these concepts are all but +// considered obsolete: In the mid 80s it was realized that these editing +// features can better be implemented in userspace code - Contemporary shells +// introduced sophisticated command-line editing (tcsh and ksh were both +// announced in 1983), and the line-editing libraries appeared (GNU Readline, +// in 1989). Posix's standardization of termios(3) also more-or-less set in +// stone the features that Posix-compliant line discipline should support. +// +// We currently support only a subset of the termios(3) features, which we +// considered most useful. More of the features can be added as needed. + #include "line-discipline.hh" #include <osv/sched.hh> #include <osv/poll.h> @@ -39,31 +66,6 @@ void LineDiscipline::read(struct uio *uio, int ioflag) { } } -// Console line discipline thread. -// -// The "line discipline" is an intermediate layer between a physical device -// (here a serial port) and a character-device interface (here console_read()) -// implementing features such as input echo, line editing, etc. In OSv, this -// is implemented in a thread, which is also responsible for read-ahead (input -// characters are read, echoed and buffered even if no-one is yet reading). -// -// The code below implements a fixed line discipline (actually two - canonical -// and non-canonical). We resisted the temptation to make the line discipline -// a stand-alone pluggable object: In the early 1980s, 8th Edition Research -// Unix experimented with pluggable line disciplines, providing improved -// editing features such as CRT erase (backspace outputs backspace-space- -// backspace), word erase, etc. These pluggable line-disciplines led to the -// development of Unix "STREAMS". However, today, these concepts are all but -// considered obsolete: In the mid 80s it was realized that these editing -// features can better be implemented in userspace code - Contemporary shells -// introduced sophisticated command-line editing (tcsh and ksh were both -// announced in 1983), and the line-editing libraries appeared (GNU Readline, -// in 1989). Posix's standardization of termios(3) also more-or-less set in -// stone the features that Posix-compliant line discipline should support. -// -// We currently support only a subset of the termios(3) features, which we -// considered most useful. More of the features can be added as needed. - static inline bool isctrl(char c) { return ((c<' ' && c!='\t' && c!='\n') || c=='\177'); } -- 2.9.3 -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
