06509ab98b601fc78cd0d969587d96d87402caa9
[its.git] / sysdoc / tv.100
1 Copyright (c) 1999 Massachusetts Institute of Technology
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or (at
6 your option) any later version.
7
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 ------------------------------
17
18         A slightly revised TV-11 program is up and running.
19 There are the following features/changes:
20
21 SHIFT and SHIFT-LOCK no longer XOR.  The general reaction
22         was against that feature, so it was removed.
23
24 [ESC]D  Buzzes the ninth-floor door for three seconds and
25         then flashes your screen.  It works for free consoles
26         as well.
27
28 [ESC]Q  Generates a hardcopy, as before, but the timeout is
29         sixteen seconds, avoiding garbage output.
30
31 [ESC]L  Clears your screen.
32           NOTE:  This is the same command as [ESC]I, which
33                 is retained for old times' sake for the 
34                 moment, but will be garbage-collected
35                 soon.
36 _______________________________________________________________
37
38 A. THE WHO-LINE.
39
40 The who-line is a line that appears at the bottom of the screen
41 on a TV terminal, describing the status of either the system as
42 a whole, or a particular job. In the former case, it is said
43 that the system who-line is being displayed; in the latter, the
44 user who-line. The information is updated every 5 seconds. The
45 who-line may be turned on or off, and various modes may be
46 selected, under either user or program control.
47
48  1. WHAT APPEARS IN THE WHO-LINE.
49
50   a. The User Who-line.
51
52 The user who-line begins with system status information:
53 the version number of ITS, the time of day and the date.
54 Then comes information on the job that is selected for who-line
55 display: the job number, the uname, jname and sname,
56 a "status" that says what the job is doing,
57 the percentage of the system's time that the job is running,
58 its total run time so far, and its core size in K.
59 An example of a user who-line is:
60
61 12/31/74 21:21:30 20 RMS    NT     .INFO. TTY    5% 0:03:09.2 24K RANDOM CRUFT
62
63          ^time.      ^uname.       ^sname.       ^% runtime.  ^core size.
64 ^date.            ^job #.   ^jname.       ^status.  ^job runtime. ^user-specified stuff.
65
66   1: The Who-line Status.
67
68 STOP    means that the job has been stopped (presumably by its
69          superior). This will be the case for jobs that have
70          been ^Z'd.
71 RUN     for jobs that are running in user mode - that is,
72          neither stopped nor executing a system call.
73 PAGE    means that the job is waiting to swap a page in.
74 <device>
75         means that the job is executing an IOT (or SIOT) on that device.
76         Appended to the name of the device may be the following
77         characters:
78                 I       input.
79                 O       output.
80                 B       block mode.
81                 S       string mode.
82         For example, DSKBI means block mode input from the disk.
83 <system call name>
84         (for example, "OPEN", "CLOSE").
85          means that the job is executing the system call named.
86
87 If the job is currently executing a system call (which implies
88 that the status is not RUN or STOP), a "+" will
89 appear in front of the status if the job is actually running, as
90 opposed to waiting (for buffer space, etc). 
91 Thus, "DSKBI" indicates that the job is waiting for a disk
92 transfer to take place, while "+DSKBI" indicates that it is
93 copying information out of a system disk buffer.
94
95 The user-specified part of the who-line is controlled by the
96 .WHO1, .WHO2 and .WHO3 variables of the job described by the
97 who-line. Those variables exist so that the program running can
98 show whatever internal status information it thinks the user might
99 want to know - what page of input is being processed, for example.
100 See the description of those variables in ITS USETS for details of
101 how to use them in a program.
102
103
104   b. The System Who-line.
105
106 The items in the system who-line are as follows:
107
108 ITS XXX MM/DD/YY HH:MM:SS USERS RNBL/TJOB SWAPB PAGEW RCORE/UCORE FCORE
109
110 XXX             ITS version #
111 MM/DD/YY        today's date
112 HH:MM:SS        time of day
113 USERS           number of users logged in
114 RNBL            number of runnable jobs
115 TJOB            total number of ITS jobs
116 SWAPB           number of swap blocked jobs
117 PAGEW           number of jobs waiting for pages
118 RCORE           number of pages belonging to runnable jobs
119 UCORE           total number of pages in the system.
120 FCORE           number of user pages there is room for
121                  in real core at one time.
122
123 In addition, if ITS is being debugged, the system who-line
124 will mention that fact.
125
126
127  2. USER CONTROL OF WHO-LINES.
128
129 Currently, who-line control uses the [ESC]W command, interpreted
130 directly by the PDP11. When a command is given, it is not really
131 processed until the next time the who-lines are updated. The
132 issuing of a command triggers such updating immediately, even
133 if the normal time for updating has not arrived, but there may
134 be a delay nevertheless. In that case, a second command given
135 before the updating is done will overwrite the first.
136
137  The options are:
138
139 [ESC]W          turns off the who-line.
140 [ESC]1W         selects the user who-line, migrating with the
141                 ownership of the tty. That is, each time the
142                 who-line is updated, it will describe whichever
143                 job has the tty at that moment.
144                 This is the default status.
145 [ESC]2W         freezes the who-line on whatever job was last
146                 shown. If you are about to ^Z - ^P a job but
147                 wish the who-line to continue to show that job
148                 instead of following the tty to its superior,
149                 this is the thing to do. The who-line remains
150                 frozen until the next time it is explicitly
151                 changed. If the job selected disappears, strange
152                 things may be displayed.
153 [ESC]3W         moves the who-line to a different job with
154                 the same uname as the one previously shown.
155                 Repeated use of this command will cycle through
156                 all the jobs with your uname. The who-line is
157                 left frozen on whichever job is reached.
158 [ESC]4W         moves similarly but in the other direction. That
159                 is, it will move back to the job that [ESC]3W
160                 left.
161 [ESC]5W         selects the system who-line.
162
163 [ESC]<n>U       selects the user wholine, for job number <n>.
164                 The job need not be part of your tree.
165
166
167  3. PROGRAM CONTROL OF WHO-LINES.
168
169   a. The Variables.
170
171 Two variables, WHMODE and WHJOB, contain the information
172 about which mode of who-line display is selected.
173 WHMODE is interpreted as follows:
174
175 -1      no who-line display.
176 0       user who-line, migrating with tty.
177 1       user who-line, frozen on a particular job
178          whose job number is in WHJOB.
179 4       system who-line.
180
181 (2 and 3 are transitory states that occur while [ESC]3W or
182 [ESC]4W is waiting to be processed. [ESC]W actually works
183 by putting its argument plus 1 into WHMODE).
184
185   b. System Calls.
186
187 The WHOLIN symbolic system call is used for reading and
188 writing the two variables WHMODE and WHJOB. Its first
189 argument specifies the tty to be used. The second and third
190 arguments are optional; if present, they will be used to set
191 WHMODE and WHJOB. In any case, two values are available:
192 the previous values of WHMODE and WHJOB.
193 If only one argument is given, the tty may be specified by
194 number, since it is not being modified. If two or three args
195 are given, the tty must be specified by a channel.
196 If the tty specified is not a TV, the call will fail with a
197 "wrong type device" error.
198
199 For example, to put the old values in FOO and FOO1, and
200 freeze the who-line on the job whose number is in BAR1:
201
202         .CALL [ SETZ
203                 'WHOLIN
204                 1000,,TYIC      ;IMMEDIATE TTY CHANNEL ARGUMENT.
205                 1000,,1         ;NEW WHMODE = FREEZE ON JOB.
206                 BAR1            ;JOB TO LOOK AT.
207                 2000,,FOO       ;STORE OLD WHMODE.
208                 402000,,FOO1]   ;STORE OLD WHJOB.
209          .VALUE
210         ...
211
212   c. Use of the TCTYP Program.
213
214 The TCTYP program when asked to describe a tty fully, or when
215 a tty's WHMODE is not -1, will print out "WHOLINE=" followed by
216 one plus the value of WHMODE (in other words, the argument to
217 [ESC]W needed to put the tty in the state it is in). The command
218 "WHOLINE" is also available; it takes an argument and acts like
219 [ESC]W, except that 1) it may be put in init files and valret
220 strings, while [ESC]W cannot, and 2) giving the WHOLINE command
221 an argument of 3 or 4 does not produce useful results.
222
223 Thus, if you like having a who-line,
224 :TCTYP WHOLINE 1
225 in your init file will give you one automatically.
226
227
228 B. FEATURES FOR PROCESSING WHAT IS ON A TV SCREEN.
229
230 What is sent to an ordinary terminal is unknowable to the
231 system unless specially remembered. That is not true
232 of TV terminals. Some standard facilities for processing
233 the contents of TV screens appear below. Of course, any
234 program may examine TV screens simply by mapping their
235 pages.
236
237  1. THE HARD COPY PRINTER.
238
239 There exists a device for making a printed reproduction of
240 whatever appears on a TV screen. To use it, type [ESC]Q,
241 which causes one copy to be made immediately. If the device
242 is in use, the screen will flash and no action will be taken.
243 The process lasts 16 seconds; nothing prevents the screen from
244 changing during that period, and if such a thing happens the
245 results will be interesting.  When the copy is finished, the
246 screen will flash.  Thus [ESC]Q always flashes the screen,
247 but faster if you're losing.  If an infix argument is given as
248 for [ESC]S (see below), then the specified video input is copied.
249 This command can be used even on non-logged-in keyboards.
250
251  2. RECORDINGS.
252
253 The system program RECORD will make an ascii file out of
254 whatever is on the TV screen. To use it, just type
255 RECORD^K at DDT. The file is called RECORD >
256 and goes on your default directory (the MSNAME).
257
258 Other more sophisticated programs for handling TV bit maps
259 may be found documented in AI:.INFO.;TVXGP INFO.
260
261  3. SPYING.
262
263 When using a TV terminal, it is possible to spy on any other
264 TV terminal. This operates by routing a different video memory
265 through the video switch to your screen. Doing this does not
266 affect your programs in any way - their output continues to
267 be placed in your own video buffer and will be visible when
268 you stop spying. Also, spying does not affect the handling
269 of input in any way.
270 These commands can be used even on free keyboards.
271 [ESC]<n>S on free  keyboards, and [ESC]F on keyboards that are in use,
272 will time out after 40 seconds and an automatic [ESC]S will be done
273 to make the screen show its default picture once again.
274 Any character typed will make that happen prematurely.
275
276 The commands are:
277
278 [ESC]<n>S       begins spying. The number <n> should be the number
279                 of the terminal to spy on;  thus, [ESC]64S spies
280                 on TTY T64.  If the specified tty is not in use,
281                 the command is a no-op.
282                 <n> may also be 200 plus the number of a video buffer.
283                 This makes it possible to spy on a screen that nobody
284                 is currently using.
285                 <n> may also be a video switch input number,
286                 for those of you who are hardware hackers.
287
288 [ESC]S          stops spying. You are again viewing your own
289                 video buffer.
290
291 [ESC]F          spies on the video buffer used for logged-out consoles
292                 (this is the one with the useful information from
293                 the NAME dragon).
294
295 C. OTHER TV FEATURES.
296
297  1. COMPLEMENTING THE SCREEN.
298
299 The last PDP-10 word of every display memory is used to hold
300 various information on how the contents of the memory should
301 be modified on their way to the screen. The 200000 bit of the
302 word controls complementation of the screen; if the bit is
303 on the screen appears black on white. This bit may be complemented
304 by the user with the command [ESC]C. Programs may, of course,
305 change the bit easily by accessing the display pages.
306
307  2. CLEARING THE SCREEN COMPLETELY.
308
309 [ESC]L is guaranteed to clear every bit of the display memory,
310 and also reset the scroll-register (don't worry if you don't
311 understand that).  ^L usually does a good enough job, so this
312 command is hardly ever necessary.  If ^L doesn't clear the
313 screen (because a program has turned it off), ^_L will clear it.
314
315  3. THE REPEAT KEY.
316
317 [ESC]R is the "repeat key";  it causes the previous input
318 character to be sent to the PDP-10 8 times a second, forever,
319 or until a character is typed on the keyboard (escape commands
320 not included).  The character that stops the repeat will be
321 ignored as input, unless it is CALL.
322
323 [ESC]<n>R, where <n> is an OCTAL number, will repeat the
324 previous input character <n> times (or until stopped by
325 the typing of a character).  <n> can't be more that 177 (octal).
326
327  4.