[ Pobierz całość w formacie PDF ]

8046: \t state" is set to show the le is \open", so
mitter interrupt. It should be compared with
that the next three lines will not be executed
\pcpint" (8739) and \lpint" (8976). Note that the
if the le is opened a second time, possibly
parameter \dev" is a masked version (loworder ve
undoing the e ect of a \stty" system call:
bits preserved) of the \new processor status" word
\t state" is also set to show \CARR ON" in the interrupt vector. Provided the vector was
(\carrier on"). This is a software ag which properly initialised, the minor device number will
shows that the terminal is logically enabled, be properly identi ed.
regardless of the true hardware status of the The second part of the test on line 8074 will be
terminal. If \CARR ON" is reset for a termi- discussed at the end of the next chapter.
nal, the system should ignore all input from
the terminal.
24.17 klrint (8078)
(This does not seem to be entirely true, and
This procedure is executed in response to a re-
this point will be taken up again later.)
ceiver interrupt. It is not so readily compared with
8047: The standard terminal is assumed to be un-
\pcrint" (8719) although similarities certainly ex-
able to interpret horizontal tabs, to support
ist.
only the 64 character ASCII subset, to run in
full duplex mode and to require both \car-
8083: Read the input character from the Receiver
riage return" and \line feed" characters to
Data Bu er register
provide normal \new line" processing. (Could
this be a Model 33 teletype?) 8084: Enable the receiver for the next character
8085: The comment says \hardware botch". Bet-
ter believe it
8086: Pass the character to \ttyinput" to insert it
into the appropriate \raw" input queue.
25 The File \tty.c" les referencing the terminal are closed i.e. usually
only when the user logs o .
In this, the last chapter, the intricacies of interac-
It is also called by \ ttystty" (8589) just before
tive terminal handlers are nally unveiled, includ-
the terminal environment parameters are adjusted.
ing:
25.3 Character Input
(a) the handling of the \erase" and kill characters
For a program requesting input from a terminal,
(b) the conversion of characters during input and
there is a chain of procedure calls which extends to
output for upper case only terminals
\ttread" ...
(c) the insertion of delays after various special
characters such as \carriage return".
25.4 ttread (8535)
The routines \gtty" (8165), \stty" (8183), \sgtty"
8541: Check that the terminal is logically active
82a1) and \ttystty" (8577) were dealt within the
8543: If there are characters in the \cooked" input
previous chapter.
queue or a call on \canon" (8274) is successful
...
25.1 ushtty (8252)
8544: transfer characters from the \cooked" input
The purpose of this procedure is to \normalise" the
queue until either it is empty or enough char-
queries associated with a particular terminal. Its
acters have been transferred to suit the user's
e ect is to terminate transmission to the terminal
requirements.
forthwith and to throwawayany accumulated input
characters.
25.5 canon (8274)
8258: Throw away everything in the \cooked" in-
This procedure is called by \ ttread" (8543) to
put queue
transfer characters from the \raw" input queue to
8259: ditto for the output queue
the \cooked" input queue (after processing \ erase"
and \kill" characters and, in the case of upper
8260: Wakeup any process waiting to extract a
case only terminals, processing \escaped" charac-
character from the \raw" input queue
ters, i.e. characters preceded by the character `\').
\canon" returns a non-zero value if the \cooked"
8261: ditto for the output queue
input queue is no longer empty.
8263: Raise the processor priority to prevent an
interrupt from the terminal while ...
8284: If the number of delimiters in the \raw" in-
put queue is zero then ...
8264: the \raw" input queue is ushed,
8285: if the terminal is logically inactive, then just
8265: the \delimiter count" is properly set to zero.
return
\ ushtty" is called by \w ushtty" (see below) and
8286: otherwise go to \sleep".
\ttyinput" (8346, 8350) when either:
Note that delimiters in this context are characters
(a) the terminal is not operating in \raw" mode
of all ones (octal value is 377) and are inserted by
and a \quit" or \delete" character is received
\ttyinput" (8358).
from the terminal or
8291: Set \bp" to point to the third character of
(b) the \raw" input queue has grown unreasonably
the work array, \ canonb"
large (presumably because no process is read-
ing input from the terminal)
8292: Begin a loop (extending to line 8318) which
removes one character from the \ raw" queue
25.2 w ushtty (8217)
per cycle
This procedure waits until the queue of characters
8293: If the character is a delimiter, reduce the
for a terminal is empty (because they've all been
delimiter count by one and exit the loop i.e.
sent!) and then calls \ ushtty" to clean up the
go to line 8319
input queues.
\w ushtty" is called (3053) by \ klclose". This 8297: If the terminal is not operating in \raw"
does not happen very often { in fact only when all mode ...
8298: If the previous character (note the \bp[{1]" 25.6 Notes
notation!) was not a backslash, `\', execute
(A) The reason why \bp" starts (8291) at the third
the code from line 8299 to 8307, otherwise
character of \canonb" can be found on line
execute the code beginning at line 8309.
8310.
Previous character was not a backslash
(B) Anumber of subtleties in the handling of back-
slashes (which the reader will no doubt have
encountered in his practical use of UNIX)
8299: If the characters is an \erase" and ...
are still not immediately apparent. Since
\maptab[c]" is zero for \ c == `\' " (octal
8300: if there is at least one charater to erase,
value of 134), all backslashes get copied into
backup the pointer \bp"
\canonb". A single backslash will be subse-
quently overwritten if the following character
8302: Start on the next cycle of the loop beginning
is to be asserted (as in the case of `#' or `@'
at line 8292
or eot (004), or if the case of an alphabetic
character is to be changed for an upper case [ Pobierz całość w formacie PDF ]

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • janekx82.keep.pl