Mercurial > hg > Members > kono > nitros9-code
annotate docs/nitros9guide/chap2.chapter @ 2322:61fb37b19edd
Edition #3 - for vtio instead of cc3io Willard Goosey
author | aaronwolfe |
---|---|
date | Mon, 11 Jan 2010 04:20:41 +0000 |
parents | b00cf13c9f61 |
children |
rev | line source |
---|---|
144 | 1 <chapter> |
2 <title>Basic Interactive Functions</title> | |
3 | |
1093 | 4 <section id="sec2.0"> |
144 | 5 <title>Running Commands and Basic Shell Operation</title> |
6 <para> | |
1500 | 7 The <command>shell</command> is a the part of NitrOS-9 that accepts commands from your |
144 | 8 keyboard. It was designed to provide a convenient, flexible, and |
9 easy-to-use interface between you and the powerful functions of the | |
1500 | 10 operating system. The shell is automatically entered after NitrOS-9 is |
144 | 11 started up. You can tell when the shell is waiting for input |
1011 | 12 because it displays the shell prompt. This prompt indicates that |
144 | 13 the shell is active and awaiting a command from your keyboard. It |
14 makes no difference whether you use upper-case letters, lower-case | |
1500 | 15 letters, or a combination of both because NitrOS-9 matches letters of |
144 | 16 either case. |
17 </para> | |
18 <para> | |
19 The command line always begins with a name of a program which can | |
20 be: | |
21 </para> | |
22 | |
23 <itemizedlist> | |
24 <listitem><para>The name of a machine language program on disk</para></listitem> | |
25 <listitem><para>The name of a machine language program already in memory</para></listitem> | |
26 <listitem><para>The name of an executable program compiled by a high-level | |
1011 | 27 language such as Basic09, Pascal, Cobol, etc.</para></listitem> |
28 <listitem><para>The name of a procedure file</para></listitem> | |
144 | 29 </itemizedlist> |
30 <para> | |
31 If you're a beginner, you will almost always use the first case, | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
32 which causes the program to be automatically loaded from the |
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
33 <filename class="directory">CMDS</filename> directory and run. |
144 | 34 </para> |
35 <para> | |
36 When processing the command line, the shell searches for a | |
37 program having the name specified in the following sequence: | |
38 </para> | |
39 | |
40 <orderedlist numeration="arabic"> | |
41 | |
1011 | 42 <listitem><para> If the program named is already in memory, it is run.</para></listitem> |
144 | 43 |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
44 <listitem><para> The "execution directory", usually <filename class="directory">CMDS</filename>, is searched. |
144 | 45 If a file having the name given is found, it is loaded and |
1011 | 46 run.</para></listitem> |
144 | 47 |
1011 | 48 <listitem><para> The user's "data directory" is searched. If a file having |
144 | 49 the name given is found, it is processed as a "procedure |
50 file" which means that the file is assumed to contain one | |
51 or more command lines which are processed by the shell in | |
52 the same manner as if they had manually typed in one by one.</para></listitem> | |
53 | |
54 </orderedlist> | |
55 <para> | |
56 Mention is made above of the "data directory" and the "execution | |
57 directory". At all times each user is associated with two file | |
58 directories. A more detailed explanation of directories is presented | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
59 later. The execution directory (usually <filename class="directory">CMDS</filename>) includes |
144 | 60 files which are executable programs. |
61 </para> | |
62 <para> | |
63 The name given in the command line may be optionally followed by | |
64 one or more "parameters" which are passed to the program called by | |
65 the shell. | |
66 </para> | |
67 <para> | |
68 For example, in the command line: | |
69 </para> | |
70 <screen> | |
1011 | 71 list file1 |
144 | 72 </screen> |
73 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
74 the program name is <command>list</command>, and the parameter passed to it is FILE1. |
144 | 75 </para> |
76 <para> | |
77 A command line may also include one or more "modifiers" which are | |
78 specifications used by the shell to alter the program's standard | |
1011 | 79 input/output files or memory assignments. |
144 | 80 |
81 | |
82 </para> | |
1093 | 83 <section id="sec2.0.1"> |
144 | 84 <title>Sending Output to the Printer</title> |
85 <para> | |
1500 | 86 Normally, most commands and programs display output on the Color Computer video display. The output of these programs can |
144 | 87 alternatively be printed by specifying output redirection on the |
88 command line. This is done by including the following modifier to | |
89 at the end of any command line: | |
90 </para> | |
91 <screen> | |
1011 | 92 >/p |
144 | 93 </screen> |
94 <para> | |
1093 | 95 The ">" character tells the shell to redirect output (See <xref linkend="sec4.3.2"/>) to |
1500 | 96 the printer using the Color Computer's printer port, which has the device |
97 name "/p" (See <xref linkend="sec3.2"/>). For example, to redirect the output of the | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
98 <command>dir</command> command to the printer, enter: |
144 | 99 </para> |
100 <screen> | |
1011 | 101 dir >/p |
144 | 102 </screen> |
103 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
104 The <command>xmode</command> command can be used to set the printer port's |
144 | 105 operating mode such as auto line feed, etc. For example, to examine |
106 the printer's current settings, type: | |
107 </para> | |
108 <screen> | |
1011 | 109 xmode /p |
144 | 110 </screen> |
111 <para> | |
112 To change any of these type XMODE followed by the new value. | |
113 For example, to set the printer port for automatic line feeds at the | |
114 end of every line, enter: | |
115 </para> | |
116 <screen> | |
1500 | 117 xmode /p lf |
144 | 118 </screen> |
119 </section> | |
120 </section> | |
121 | |
1093 | 122 <section id="sec2.1"> |
144 | 123 <title>Shell Command Line Parameters</title> |
124 <para> | |
125 Parameters are generally used to either specify file name(s) or | |
126 to select options to be used by the program specified in the command | |
127 line given to the shell. Parameters are separated from the command | |
128 name and from each other by space characters (hence parameters and | |
129 options cannot themselves include spaces). Each command program | |
1500 | 130 supplied with NitrOS-9 has an individual description in the last section |
144 | 131 of this manual which describe the correct usage of the parameters of |
132 each command. | |
133 </para> | |
134 <para> | |
1094 | 135 For example, the <command>list</command> program is used to display the contents of |
136 a text file on your display. It is necessary to tell to the <command>list</command> | |
144 | 137 program which file it is to be displayed, therefore, the name of the |
138 desired file is given as a parameter in the command line. For | |
139 example, to list the file called startup (the system initialization | |
140 procedure file), you enter the command line: | |
141 </para> | |
142 <screen> | |
1011 | 143 list startup |
144 | 144 </screen> |
145 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
146 Some commands have two parameters. For example, the <command>copy</command> command is |
144 | 147 used to make an exact copy of a file. It requires two parameters: |
148 The name of the file to be copied and the name of the file which is | |
149 to be the copy, for example: | |
150 </para> | |
151 <screen> | |
1011 | 152 copy startup newstartup |
144 | 153 </screen> |
154 <para> | |
155 Other commands have parameters which select options. For example: | |
156 </para> | |
157 <screen> | |
1011 | 158 dir |
144 | 159 </screen> |
160 <para> | |
161 shows the names of the files in the user's data directory. Normally | |
1011 | 162 it simply lists the file names only, but if the "-e" |
144 | 163 (for <emphasis>e</emphasis>ntire) |
164 option is given, it will also give complete statistics for each file | |
165 such as the date and time created, size, security codes, etc. To do | |
166 so enter: | |
167 </para> | |
168 <screen> | |
1011 | 169 dir -e |
144 | 170 </screen> |
171 <para> | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
172 The <command>dir</command> command also can accept a file name as a parameter which |
144 | 173 specifies a directory file other than the (default) data directory. |
174 For example, to list file names in the directory sys , type: | |
175 </para> | |
176 <screen> | |
1011 | 177 dir sys |
144 | 178 </screen> |
179 <para> | |
180 It is also possible to specify both a directory name parameter and | |
1500 | 181 the -e option, such as: |
144 | 182 </para> |
183 <screen> | |
1011 | 184 dir sys -e |
144 | 185 </screen> |
186 <para> | |
1011 | 187 giving file names and complete statistics. |
144 | 188 </para> |
189 </section> | |
190 | |
1093 | 191 <section id="sec2.3"> |
144 | 192 <title>Some Common Command Formats</title> |
193 <para> | |
194 This section is a summary of some commands commonly used by new | |
1500 | 195 or casual NitrOS-9 users, and some common formats. Each command is |
144 | 196 followed by an example. Refer to the individual command |
1011 | 197 descriptions later int his book for more detailed information and |
144 | 198 additional examples. Parameters or options shown in brackets are |
199 optional. Whenever a command references a directory file name, the | |
200 file <emphasis>must</emphasis> be a directory file. | |
201 | |
202 <screen> | |
203 CHD filename chd DATA.DIR | |
204 </screen> | |
205 Changes the current <emphasis>data</emphasis> working directory to | |
206 the <emphasis>directory</emphasis> file specified. | |
207 <screen> | |
208 COPY filename1 filename2 copy oldfile newfile | |
209 </screen> | |
210 Creates filename2 as a new file, then copies all data from | |
211 "filename1" to it. "filename1" is not affected. | |
212 <screen> | |
213 DEL filename del oldstuff | |
214 </screen> | |
215 Deletes (destroys) the file specified. | |
216 <screen> | |
1011 | 217 DIR [filename] [-e] [-x] dir myfiles -e |
144 | 218 </screen> |
1017 | 219 List names of files contained in a directory. If the "-x" option is |
144 | 220 used the files in the current <emphasis>execution</emphasis> |
221 directory are listed, | |
222 othervise, if no directory name is given, the current | |
223 <emphasis>data</emphasis> directory will be listed. | |
1017 | 224 The "-e" option selects the long format |
144 | 225 which shows detailed information about each file. |
226 <screen> | |
227 FREE devicename free /d1 | |
228 </screen> | |
229 Shows how much free space remains on the disk whose name is given. | |
230 <screen> | |
231 LIST filename list script | |
232 </screen> | |
233 Displays the (text) contents of the file on the terminal. | |
234 <screen> | |
235 MAKDIR filename makdir NEWFILES | |
236 </screen> | |
237 Creates a new directory file using the name given. Often followed | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
238 by a <command>chd</command> command to make it the new working data directory. |
144 | 239 <screen> |
240 RENAME filename1 filename2 rename zip zap | |
241 </screen> | |
242 Changes the name of filename1 to filename2. | |
243 </para> | |
244 </section> | |
245 | |
1093 | 246 <section id="sec2.4"> |
144 | 247 <title>Using the Keyboard and Video Display</title> |
248 <para> | |
1500 | 249 NitrOS-9 has many features to expand the capability of the Color Computer |
144 | 250 keyboard and video display. The video display has screen pause, |
251 upper/lower case, and graphics functions. The keyboard can generate | |
252 all ASCII characters and has a type-ahead feature that permits you | |
253 to enter data before requested by a program (except if the disk is | |
1093 | 254 running because interrupts are temporarily disabled). |
255 <xref linkend="video-display"/> of | |
144 | 256 this manual is a list of the characters and codes that can be |
257 generated from the keyboard. The keyboard/video display can be used | |
258 as a file known by the name "/TERM". | |
259 </para> | |
260 | |
261 <section> | |
262 <title>Video Display Functions</title> | |
263 <para> | |
1500 | 264 Most Color Computers use reverse video (green letters in a black box) to |
144 | 265 represent lower-case letters. Normally they are not used, so you |
266 have to turn them on if you want to use them with the command: | |
267 </para> | |
268 <screen> | |
1011 | 269 tmode -upc |
144 | 270 </screen> |
271 <para> | |
1500 | 272 However, the Color Computer 3 and certain models of the Color Computer 2 can also do true lowercase on the 32x16 video display. To see if your Color Computer can do true lowercase, type the following command: |
273 <screen> | |
274 xmode /term typ=1; display e | |
275 </screen> | |
276 If your Color Computer cannot do true lower case, your screen will show graphics garbage. | |
277 </para> | |
278 <para> | |
144 | 279 The screen pause feature stops programs after 16 lines have been |
280 displayed. Output will continue if you hit any key. Normally this | |
1053
b5ff125a1d60
Since this book was only typeset in fixed width, single-font, they used
roug
parents:
1017
diff
changeset
|
281 feature is on. It can be turned on or off with the <command>tmode</command> command as |
144 | 282 follows: |
283 </para> | |
284 <screen> | |
1011 | 285 tmode -pause turns pause mode off |
286 tmode pause turns pause mode on | |
144 | 287 </screen> |
288 <para> | |
289 The display system also has a complete set of commands to emulate | |
290 commercial data terminals, plus a complete set of graphics commands. | |
1093 | 291 These are described in detail in <xref linkend="key-definitions"/>. |
144 | 292 </para> |
293 </section> | |
294 | |
295 <section> | |
296 <title>Keyboard Shift and Control Functions</title> | |
297 <para> | |
298 Two keys are used in combination with other keys to change their | |
299 meaning. The SHIFT KEY selects between upper case and lower case | |
1014
d9ed9d44b70c
Some character entities had missing semicolons. It's &CPU;
roug
parents:
1011
diff
changeset
|
300 letters or punctuation, and the &ctrlkey; key can be used to generate |
1011 | 301 control characters. |
144 | 302 </para> |
303 <para> | |
304 The keyboard has a shift lock function similar to a typewriter's, | |
305 which is normally "locked". The keyboard's shift lock may be | |
1092 | 306 reversed by depressing the control key and <keycap>0</keycap> keys |
144 | 307 simultaneously. The shift lock only affects the letter (A-Z) keys. |
308 When the keyboard is locked, these keys generate upper case letters, | |
309 and lower case only if the SHIFT key is depressed. When the | |
310 keyboard is unlocked, the reverse is true, e.g., lower case letters | |
311 are generated unless the SHIFT key is depressed at the same time as | |
312 a letter key. | |
313 </para> | |
314 </section> | |
315 | |
1093 | 316 <section id="sec2.4.3"> |
144 | 317 <title>Control Key Functions</title> |
318 <para> | |
319 There are a number of useful control functions that can be | |
320 generated from the keyboard. Many of these functions use "control | |
1014
d9ed9d44b70c
Some character entities had missing semicolons. It's &CPU;
roug
parents:
1011
diff
changeset
|
321 keys" which are generated by simultaneously depressing the &ctrlkey; key |
144 | 322 plus some other key. For example, to generate the character for |
1092 | 323 <keycap>CONTROL</keycap> <keycap>D</keycap> press the &ctrlkey; and <keycap>D</keycap> keys at the same time. |
144 | 324 </para> |
325 <variablelist> | |
326 <varlistentry> | |
1092 | 327 <term><keycombo action="simul"> |
328 <keycap>CONTROL</keycap> <keycap>A</keycap></keycombo></term> | |
144 | 329 <listitem> |
330 <para> | |
331 Repeat previous input line. The last line entered will be redisplayed but | |
332 <emphasis>not</emphasis> processed, with the cursor positioned at the end of | |
333 the line. You may hit return to enter the line, or edit the line by | |
334 backspacing, typing over characters to correct them, and entering | |
335 control A again to redisplay the edited line. | |
336 </para> | |
337 </listitem> | |
338 </varlistentry> | |
339 <varlistentry> | |
1092 | 340 <term><keycombo action="simul"> |
341 <keycap>CONTROL</keycap> <keycap>D</keycap></keycombo></term> | |
144 | 342 <listitem> |
343 <para> | |
344 Redisplay present input on next line. | |
345 </para> | |
346 </listitem> | |
347 </varlistentry> | |
348 <varlistentry> | |
1092 | 349 <term><keycombo action="simul"> |
350 <keycap>CONTROL</keycap> <keycap>W</keycap></keycombo></term> | |
144 | 351 <listitem> |
352 <para> | |
353 Display Wait - This will temporarily halt output to the display so | |
354 the screen can be read before the data scrolls off. Output is | |
355 resumed when any other key is hit. | |
356 </para> | |
357 </listitem> | |
358 </varlistentry> | |
359 <varlistentry> | |
1092 | 360 <term><keycombo action="simul"> |
361 <keycap>CONTROL</keycap> <keycap>0</keycap></keycombo></term> | |
144 | 362 <listitem> |
363 <para> | |
364 Shift lock. Reverses present shift lock state. | |
365 </para> | |
366 </listitem> | |
367 </varlistentry> | |
368 <varlistentry> | |
1092 | 369 <term><keycap>BREAK</keycap> (or <keycombo action="simul"> |
370 <keycap>CONTROL</keycap> <keycap>E</keycap></keycombo>)</term> | |
144 | 371 <listitem> |
372 <para> | |
373 Program abort - Stops the current running program | |
374 </para> | |
375 </listitem> | |
376 </varlistentry> | |
377 <varlistentry> | |
1092 | 378 <term><keycombo action="simul"> |
379 <keycap>SHIFT</keycap> <keycap>BREAK</keycap></keycombo> (or <keycombo action="simul"> | |
380 <keycap>CONTROL</keycap> <keycap>C</keycap></keycombo>)</term> | |
144 | 381 <listitem> |
382 <para> | |
383 Interrupt - Reactivates Shell while keeping program running as | |
384 background task. | |
385 </para> | |
386 </listitem> | |
387 </varlistentry> | |
388 <varlistentry> | |
1092 | 389 <term><keycombo action="simul"> |
390 <keycap>CONTROL</keycap> <keycap>BREAK</keycap></keycombo> (<keycap>ESCAPE</keycap>)</term> | |
144 | 391 <listitem> |
392 <para> | |
393 End-of-File - This key is used to send an end-of-file to programs | |
394 that read input from the terminal in place of a disk or tape file. | |
395 It must be the first character on the line in order for it to be | |
396 recognized. | |
397 </para> | |
398 </listitem> | |
399 </varlistentry> | |
400 <varlistentry> | |
1092 | 401 <term><keycap>LEFT ARROW</keycap> (OR <keycombo action="simul"> |
402 <keycap>CONTROL</keycap> <keycap>H</keycap></keycombo>)</term> | |
144 | 403 <listitem> |
404 <para> | |
405 Backspace - erase previous character | |
406 </para> | |
407 </listitem> | |
408 </varlistentry> | |
409 <varlistentry> | |
1092 | 410 <term><keycombo action="simul"> |
411 <keycap>SHIFT</keycap> <keycap>LEFT ARROW</keycap></keycombo> (or <keycombo action="simul"> | |
412 <keycap>CONTROL</keycap> <keycap>X</keycap></keycombo>)</term> | |
144 | 413 <listitem> |
414 <para> | |
415 Line Delete - erases the entire current line. | |
416 </para> | |
417 </listitem> | |
418 </varlistentry> | |
419 </variablelist> | |
420 </section> | |
421 </section> | |
422 | |
423 </chapter> |