Commands and Keys
You already put OS-9 to work with commands such as FORMAT
and BACKUP. In these cases the manual told you exactly what to
do to accomplish a very specific task. If you want to strike out on
your own, you should know some additional background
information.
Typing Commands
As explained earlier, some OS-9 files are programs. You tell OS-9
to execute these programs by typing the program (file) name and
pressing
ENTER
. You are then issuing a command to OS-9. That's
all a command is, the name of a program for the system to execute. The following are some rules about commands:
0
You can enter a command whenever the screen displays
the system prompt
(o s
9 :) .
A command consists of one word, the command name. A
command line
consists of one or more command names
and their associated
parameters
and
modifiers.
Parameters and modifiers are special information you include
with a command that provide necessary data for the command to operate, or that affect the command's operation.
- A command line can have a maximum of 198 characters
including any combination of upper- or lowercase letters.
To execute a command, press
ENTER
. For example, to clear
the screen, type:
display 0c ENTER
Editing Commands
OS-9 is very particular about the commands you type. If you
make any mistake, OS-9 either does not understand (and tells you
so with an error message) or does the wrong thing.
If you see that you made a mistake before you press
ENTER , you
0
have two choices: (1) use
E) or
CTRL
0
to move the cursor to the
mistake, and retype that portion of the line, or (2) press
CTRL
x0
or
sH~ ~ to
erase the line you are typing, and start over.
5-1
Getting Started With OS-9
Command Parameters
You can follow a command name with one or more parameters
that give OS-9 more specific instructions. For example, in the
command line:
1 i 5 t f i 1 e 1 ENTER
LIST is the name of the command that displays the contents of a
text file.
Filel,
the specified parameter, is the name of the file
that you want displayed.
Note: In a command line, always use spaces to separate
parameters from their command, and from each other.
Parameters cannot contain spaces. Chapter 6 discusses
parameters for each OS-9 command.
Some commands have more than one parameter. For instance,
COPY requires two parameters: the name of the file being copied, and the name of the new file you want COPY to create. If you
want to copy a file called Startup, and call the copy Newstartup,
your command line reads:
COPY, the command
name.
The name of the file
to copy
The name of the copy
You press
ENTER
to
cause the command
line to execute.
copy
Startup new5tartup ENTER
Using Options
-
Command lines can also contain another type of parameter, called
an option. An option changes the way a command performs. For
instance, the command DER, without parameters, shows the name
of all files in the current data directory.
5-2
Commands and Keys / 5
However, if you add the E option as a parameter to the command, like this:
d i r e ENTER
the output includes not only the names of the files, but also complete statistics about each file-the date and time created, size,
security codes, and so forth.
To display complete information about each file in SYS, type:
d i r s y s e ENTER
Using Commands
As described in Part 1, OS-9 acts in much the same manner as
an office manager. It looks after the operation of your computer
and equipment. Because OS-9 is only a manager, it expects you to
make the necessary decisions.
For example, suppose you have an important file named Hotstuff
that you want to copy. Before giving it to your office manager
(OS-9), you must make executive decisions, such as:
·
Do you want the copy on disk, paper, or the computer
screen?
·
If you want the copy on disk, which disk?
·
If you want the copy on the same disk, what name do you
want to give the second copy so OS-9 is not confused?
·
If you want the copy on the computer screen, do you want
the display to pause when it fills the screen?
You make the decisions, OS-9 manages the job. For instance, if
your decision is to copy Hotstuff from one diskette to to another,
you might type the following command line:
copy /d0/hot5tuff /d1 /hotcopy ENTER
5-3
Getting Started With OS-9
This is how OS-9 sees your command:
The name of the
command
The disk drive
containing the file to be
copied
The name of the file to
copy
The disk drive that is to
receive the new file
The name of the copy
copy /d0/hot5tuff /d1/hotcopy
This command line tells OS-9 to copy a file named Hotstuff from
your floppy disk Drive /DO to a second floppy Drive /D1. The file
copy is given the new name, Hotcopy.
You only need to know the name of the file you want to copy, on
which disk it is located, and the disk on which you want the new
copy. OS-9 manages the operation for you.
Accessing Commands
OS-9 has two ways to access commands. Some commands reside
on a disk. When you type the command name and press
ENTER ,
OS-9 must look on the disk, load the program into the computer's memory, and then execute it.
Other commands are loaded into your computer's memory at
startup, or you can load them into memory later. When you call
a command that is in memory, it is executed immediately. There
is no delay while OS-9 finds it on disk.
5-4
Commands and Keys / 5
Commands from Disk
When you give OS-9 a command that it cannot find in memory, it
looks for the command in the current execution directory. If it
cannot find it there, it checks the current data directory. If it still
cannot find it, the system issues Error Message #216, Path Name
Not Found. If the command you want executed is in a directory
other than the current directory, you must tell OS-9 where to find
it. Remember, when initialized, OS-9 sets the CMDS directory of
the system disk to be the execution directory.
For instance, suppose you booted your system using a diskette
configured like the example we used in Chapter 4:
ROOT DIRECTORY
OS9Boot
Startup
CMDS FAMILY SYS
PLEASURE WORK
mom mom
dad dad
joe
doe
5-5
Getting Started With OS-9
When the system starts, the ROOT directory is the data directory, and the CMDS directory is the execution directory. Now,
suppose you had a program named Expenses in the family
directory:
ROOT DIRECTORY
OS9Boot
Startup
CFAMILY SYS
expenses
PLEASURE WORK
mom
dad
joe
mom
dad
joe
(Remember that a program and a command are really the same
thing.)
You can now access (use) the expenses program in two ways. One
way is to specify a pathlist from the ROOT directory to execute
Expenses, such as:
/d0/fami ly/expenses ENTER
Another way is to change the execution directory.
Changing the Execution Directory
To change the execution directory to the FAMILY directory, type:
chx /d0/fami ly ENTER
Or specify a pathlist relative to the current execution directory,
such as:
chx . . /fami ly ENTER
To execute the Expenses program, you now only need to type
expenses ENTER .
5-6
Commands and Keys / 5
However, after you change the execution directory, to use a command in the COMMANDS directory, you must tell OS-9 where to
find it. For example, to format a new diskette in Drive /D1, type:
/d0/cmds/format /d1
Changing the Data Directory
Suppose that the Expenses program keeps track of work and
pleasure expenses for Mom, Dad, and Joe. Unless you tell OS-9
otherwise, it looks for data files in the current data directory, the
ROOT directory. To tell OS-9 to look for data files in the PLEASURE directory, type:
chd family/pleasure
The slash between FAMILY and PLEASURE tells the system that
PLEASURE is a branch of FAMILY. Subordinate directories and
files are always separated from their parent in this way.
Now, when Expenses needs data, it knows to look in the PLEASURE directory.
Changing System Diskettes
Although it is preferable to leave the system diskette in place
while the system is running, particularly with multiuser systems, there might be times when you need to use another
diskette. Only remove the current diskette when the screen displays the OS-9 prompt, followed by the cursor. If you do remove
the system diskette and begin to use another one, use the CHD
and CHX commands to tell OS-9 where you want to be located on
the new diskette. (For directions, see Chapters 2 and 6.) Those
commands set both directory pointers, data and execution, for the
new diskette.
While using a program or command, do not remove a diskette and
insert another unless the program or command asks you to. -You
can lose data, or entire files, if you do.
5-7
Getting Started With OS-9
Video Display and Keyboard Functions
OS-9 has many features that expand the capability of the Color
Computer's video display and keyboard.
The video display has upper-/lowercase, screen pause,
graphics functions, and 80 column displays if you have a
monitor connected.
t
The
mT
key provides an alternate key function. Holding
down
mT
while pressing another key sets the high order
bit of the character pressed. That is, it adds 128 to the
normal ASCII value produced by that key. Holding down
nm while pressing any other key produces a graphics
character on the standard VDG screen. If you are using
windows, nm lets you produce international characters.
(See OS-9 Windowing System Owner's Manual for more
information).
· The keyboard has an auto-repeat function. Holding down
a key causes the character to repeat until you release the
key. This function operates properly only when the disk
drives are not in use by a program.
You can deal with the video display and keyboard together
as though they are a file. You can receive input from the
keyboard and send output to the video screen using the
device name /TERM.
Special Keys
The following keys and key sequences have special significance to
OS-9.
nn Produces graphic characters on a stan
dard VDG screen or international
characters with windows. Press
mT
char where char is a keyboard charac
ter).
CTRL
A control key.
BREAK
Or Stops the current program execution.
CTRL DE
0
or Moves the cursor to the left one space.
CTRL OH
5-8
Commands and Keys l 5
CTRL
Q Generates an underscore character. The
underscore displays as a left arrow.
CTRL
0 Generates a left brace ({).
CTRL
~ Generates a right brace (}).
CTRL
0 Generates a tilde (').
CTRL
ID Generates a backslash ( \ ).
CTRL BREAK
Performs an ESCAPE function, and
or
CTRL
c~ sends an end-of-file message to a pro
gram receiving keyboard input. To be
recoenized,
CTRL BREAK
must be the
first thing typed on a line.
SHIFT BREAK
Performs a CONTROL C function by
interrupting the video display of a pro
gram. The program runs as a back
ground task.
CLEAR
* Selects the next video window.
SHIFT CLEAR
* Selects the previous video window.
* You must have established windows
for this function key to have any
effect. See "Using Windows" in
Chapter 7.
CTRL CLEAR
Toggles the keyboard mouse on and off:
The keyboard mouse uses the arrow
keys and the two function keys (Fl and
F2) to simulate an external mouse.
When keyboard mouse is on, the nor
mal functions for the arrow and func
tion keys is suspended.
sHm for Deletes the current line.
CTRL X~
CTRL
o~ Activates or deactivates the shift lock
function.
CTRL
Q Generates a vertical bar
( 1
).
CTRL
C D Generates an up arrow W.
CTRL
aQ Generates a left bracket ([).
5-9
Getting Started With OS-9
CTRL
s~ Generates a right bracket ( ] ).
CTRL
~ Redisplays the last line you typed and
positions the cursor at the end of the
line, but does not process the line.
Press
eNTER
to process the line, or edit
the line by backspacing. If you edit,
press
cTR~
~ again to display the
edited line.
CTRL
0
Redisplays the current command line.
CTRL
w0
Temporarily halts video output. Press
any key to resume output.
ENTER
Performs a carriage return or executes
the current command line.
5-10