System Command Descriptions
This chapter contains alphabetical descriptions of the commands
supplied with OS-9. Ordinarily, you call the commands from the
shell, but you can also call them from most other programs in
the OS-9 family-including BASIC09 and the Macro Text Editor.
Warning:
Do not attempt to use OS-9 Level One commands
with the OS-9 Level Two system or to use Level Two com
mands with the Level One system.
Organization of Entries
Each command entry includes:
The name of the command
A
syntax
line, which shows you the format and spelling
to use when you type the command
A brief definition of what the command does
Information about any options available with the
Notes about the command and how to use it
One or more examples of command use
Command Syntax Notations
OS-9 requires that you enter the various parts of a command in
the correct order and in the correct format. An example of the
proper
syntax
follows the command name.
The syntax line always begins with the name of the command.
Occasionally, that's all you need (except for pressing
ENTER
). But
other commands either require, or can accept, parameters (vari
ables that give instructions to OS-9).
Some syntaxes include
variables
(shown in italics) that you
replace with specific parameters. For instance, the BUILD com
mand syntax is:
build
filename
ENTER
6-1
OS-9 Commands Reference
BUILD is the command name. You type it exactly as shown.
However,
filename
is a variable. Replace it with the actual name
you want to give to the file you are creating. If you want to cre
ate a file named Myfile, type:
build myfile ENTER
Pressing
ENTER
executes the command.
Common variables are:
arglist
arglist (argument list) is similar to
paramlist,
but it includes command names as well as
command parameters.
devname
device name (/P, /TERM, /M1)
commandname
command name
dirname
directory name
filename
file name
hex
a hexadecimal number
hhlmmlss
hour/minutes/seconds
modname
name of a memory module
n
a decimal number
number
a numeric value
opts
options
paramlist
a list of parameters
pathlist
a complete path to a directory or file
permission
file permission abbreviations
procID
process ID number
text
a string of characters
tickcount
a numeric value representing system clock
ticks
value
a numeric value
yy/mm/dd
year/month/day
6-2
System Command Descriptions / 6
[ ] Brackets indicate that the material within them is optional
and not necessary for the execution of the command .
... An ellipsis indicates that you can repeat the material imme
diately preceding the ellipsis. For instance,
[filename][...]
means
that you can specify more than one fiIename to the command.
Following is the syntax for the DISPLAY command:
display
hex[
...I
ENTER
This means you can include more than one hex number with
DISPLAY, such as:
display 54 48 49 53 20 49 53 20 41 20 53 45 43
52 45 54 20 4D 53 53 41 47 45 ENTER
Command syntaxes do not include the shell's built-in options (for
instance I/O redirection) because the shell fiIters out its options
before it passes the command line to the program being called.
Command Summary
This section describes the format and use of OS-9 commands.
The following list is a summary of these commands:
ATTR . . . . . . . . Changes a file's attributes
BACKUP . . . . . Makes a copy of a diskette
BUILD . . . . . . . Builds a text file
CHD . . . . . . . . . Changes the working data directory
CHX . . . . . . . . . Changes the working execution directory
CMP . . . . . . . . . Compares fiIes
COBBLER . . . Makes a bootstrap file
CONFIG . . . . . Creates a system diskette to your specifications
COPY . . . . . . . . Copies data
DATE . . . . . . . . Displays the system date and (optionally) the
DCHECK . . . . Checks a disk file structure
DEINIZ . . . . . . Deinitializes a device previously initialized with
DEL . . . . . . . . . Deletes a file or files
DELDIR . . . . . Deletes a directory's files, then deletes the
DIR . . . . . . . . . . Displays the names of all fiIes in a directory
DISPLAY . . . . . Displays the characters represented by hexadeci
DSAVE . . . . . . . Generates a procedure file to copy fiIes
6-3
OS-9 Commands Reference
EDIT . . . . . . . . Calls the OS-9 Macro Text Editor
ERROR . . . . . . Displays a description of the last error code
ECHO . . . . . . . Echoes text to the screen
EX . . . . . . . . . . . Causes the shell process to execute another
process
FORMAT . . . . Prepares a disk for data storage
FREE . . . . . . . . Displays the amount of free space on a disk
HELP . . . . . . . . Displays the syntax and use of commands
IDENT . . . . . . . Displays OS-9 module identifilcation
INIZ . . . . . . . . . Initializes and attaches devices
KILL . . . . . . . . Terminates a process
LINK . . . . . . . . Links a module into memory
LIST . . . . . . . . . Lists the contents of disk data files
LOAD . . . . . . . . Loads a module into memory
MAKDIR . . . . Creates a directory
MDIR . . . . . . . . Displays the names of the modules in memory
MERGE . . . . . . Copies and combines files
MFREE . . . . . . Displays a list of free RAM
MODPATCH . . Makes changes to a module in memory
MONTYPE . . . Establishes the type of monitor in use
OS9GEN . . . . . Builds and links a bootstrap file
PROCS . . . . . . Displays the names of the current processes
PWD . . . . . . . . . Displays the name of the current data directory
PXD . . . . . . . . . Displays the name of the current execution
directory
RENAME . . . . Changes the name of a fille or directory
SETIME . . . . . Activates and sets the system clock
SETPR . . . . . . . Sets a process's priority
SHELL . . . . . . Creates a child shell to process one or more
commands
TMODE . . . . . . Changes the terminal's operating mode
TUNEPORT Adjusts the loop delay for the baud rate of /P or
/T devices
UNLINK . . . . . Unlinks memory modules
WCREATE . . . Creates a window
XMODE . . . . . . Displays or changes a device's initialization
parameters
6-4
System Command Descriptions / 6
ATTR
Syntax: attr filename [permission]
Function: Lets you examine or change a file's security
permissions.
Parameters:
filename The name of the file you want to examine or
change.
permission One or more of the following attribute options.
Options:
The file permission abbreviations you can use are:
d Specifies that a file is a directory.
s Specifiies that the file is not shareable and can serve
only one user at a time.
r Specifies that only the owner can read the file.
w Specifies that only the owner can write to (change)
the file.
e Specifies that only the owner can execute the file.
pr Specifies that the public (anyone) can read the file.
pw Specifies that the public (anyone) can write to the file.
pe Specifies that the public (anyone) can execute the file.
-a Tells ATTR not to display the attributes. Use this
option when you wish to change attributes without
displaying them.
6-5
OS-9 Commands Reference
Notes:
To use ATTR, type the command name followed by the
name of the file you want to change. Next, type a list of the
permissions to turn on or off. Turn a permission on by typ
ing its abbreviation or off by typing its abbreviation pre
ceded by a minus sign. ATTR has no effect on permissions
If you do not specify any permissions, ATTR displays the
file's current attributes.
You cannot change the attributes of a file you don't own.
User 0 can change the attributes of any file in the system.
Use ATTR to change a directory into a file after deleting
all the directory's files. You cannot change a file to a direc
tory with ATTR. (See MAKDIR.)
Examples:
To remove public read and write permission from a file
attr myfile -Pr -Pw ENTER
To give read, write, and execute permission to everyone for
attr myfile r w e pr pw pe ENTER
To display the current permissions of a file named Datalog,
attr datalo9 ENTER
6-6
System Command Descriptions / 6
BACKUP
Syntax: backup
[opts][devnamel][devname2]
Function: Copies all data from one disk to another.
Parameters:
deanamel The drive containing the disk files you want to
back up.
Seuname2 The drive containing the disk to which you
want to transfer the fiIes.
opts One or more of the following options.
Options:
e Cancels the backup if a read error occurs.
s Lets you backup a diskette using only one
drive.
-v Tells BACKUP not to verify the data written
to the destination diskette.
#nK Increases to n the amount of memory that
BACKUP can use. Increasing the amount of
memory assigned to BACKUP speeds the pro
cedure. n can be either in pages of 256 bytes
or in kilobytes (1024 bytes). Include K to indi
cate kilobytes.
Notes:
BACKUP performs a sector by sector copy, ignoring file
structures. In all cases, the devices specified must have the
same format (size, density, and so forth) and the destina
tion disk must not have defective sectors.
6-7
OS-9 Commands Reference
If you omit both device names, the system assumes you are
copying from /DO to /D1. If you omit only the second device
name, OS-9 performs a single-drive backup on the specifiled
· The following demonstrates a complete backup of /DO to
/D1. In the example, the diskette in Drive /D1 is a format
ted diskette with the name MYDISK.
Scratched,
which
appears in one of the following messages, means erased.
b a c k u p ENTER
The screen display and your input are:
Ready to BACKUP from /D9 to /D1 ?: ENTER
MYDISK
is being scratched
?·
0
Sectors copied: $0276
Verify pass
Sectors verified: $0276
Following is an example of a single-drive back up. BACKUP
reads a portion of the source diskette (the diskette you are
copying) into memory. It then prompts you to remove the
source diskette and put the destination diskette (the
diskette receiving the copy) into the drive.
After BACKUP writes to the destination diskette, remove
the destination diskette and put the source diskette back
into the drive. Continue swapping as prompted until
BACKUP copies the entire diskette.
Giving BACKUP as much memory as possible means you
have to make fewer diskette exchanges. If enough free mem
ory is available, you can assign up to 56 kilobytes for the
backup operation. An Error 207 means that your computer
does not have the specified amount of memory free. To
assign 32 kilobytes to backup, type:
backup /de #32k ENTER
6-8
System Command Descriptions l 6
The screen display and your responses are as follows:
Ready to BACKUP from /D0 to D0 ?:
El
Ready Destination, hit a key:
ENTER
MYDISK
is being scratched
?·
0
Ready Source, hit a key:
ENTER
Ready Destination, hit a key:
ENTER
Ready Source, hit a key:
ENTER
Ready Destination, hit a key:
ENTER
y
Ready Destination, hit a key:
ENTER
Sectors copied: $0276
Verify pass
Sectors verified: 80276
In this procedure, the dollar symbol ($) indicates hexadeci
mal numbers. BACKUP copied 276 hexadecimal (or 630
decimal) sectors.
Examples:
To back up the diskette in Drive /D2 to the diskette in
Drive /D3, type:
backup /d2 /d3
ENTER
To back up from Drive /DO to Drive /D1, without verifica
tion, type:
backup -v
ENTER
6-9
OS-9 Commands Reference
BUILD
Syntax:
build filename
Function:
Builds a text file by copying input from the stan
dard input device (the keyboard) into the file specified by
filename.
Parameters:
filename
The name of the file you are creating.
Notes:
BUILD creates a file, naming it
filename.
It then displays a
question mark (?) and waits for you to type a line. When
you type a line and press
ENTER
, BUILD writes the line to
the disk.
When you finish entering the lines for the new file, press
ENTER
, without any preceding text, to close the file and ter
minate the operation.
The following example demonstrates how to build a text file
named Newfile:
build newfile ENTER
? THE POWERS OF THE OS-9
ENTER
? OPERATING SYSTEM ARE TRULY
ENTER
? FANTASTIC.
ENTER
? ENTER
To view the newly created file, type:
list newfile ENTER
6-10
System Command Descriptions / 6
The screen displays:
THE POWERS OF THE OS-9
OPERATING SYSTEM ARE TRULY
FANTASTIC.
Examples:
To create a new file called Small-fiIe and put into it what
ever you type at the keyboard, type:
build small_file ENTER
To direct whatever you type to the printer, type:
build / P ENTER
You can use BUILD to transfer, or redirect, data from one
file to another. Instead of the keyboard, this example uses a
file named Mytext file for the input device. The output
device is Terminal 1.
build <mytext /t1 ENTER
6-11
OS-9 Commands Reference
CHD
CHX
Syntax: chd pathlist
chx pathlist
Function:
CHD changes the current working (data) directory,
and CHX changes the current execution directory.
Parameters:
pathlist Specifies the directory for the current working
or execution directory.
Notes:
CHD and CHX do not appear in the CMDS directory
because they are built into the shell.
Examples:
To change the current working (data) directory to the PRO
GRAMS data directory located on the diskette in Drive
/D1, type:
chd /d1 /Programs
ENTER
· To change the execution directory to the parent directory of
the current execution directory, type:
c h x . . ENTER
To change the execution directory to TEXT-PROGRAMS,
a subdirectory of BINARY-FILES, type:
chx
binary-files/text-Programs
ENTER
6-12
System Command Descriptions / 6
To return the execution directory and the data directory
back to the default directories, type:
chx /d9/cmds; chd /d9 ENTER
Or, if you are using a hard disk, type:
chx /h0/cmds; chd /h0 ENTER
6-13
OS-9 Commands Reference
CMP
Syntax: cmp filenamel filename2
Function:
Opens two fiIes and compares the binary values of
corresponding data bytes in the fiIes. If CMP encounters any
differences in the file, it displays the file offset (address) and
the values of the bytes from each file.
Parameters:
filenamel
are the fiIes to compare.
filename2
Notes:
The comparison ends when CMP encounters an end-of-fiIe
marker in either file. CMP then displays a summary of the
number of bytes compared and the number of differences
found.
Examples:
0
To compare two fiIes named Red and Blue, type:
cmp red blue ENTER
Following is a sample screen display:
Differences
byte #1 #2
00000013 00 01
00000022 H0 H1
0000002A 93 AB
00000028 39 36
0000002C 6D 65
Bytes compared: 0000002D
Bytes different:00000005
6-14
System Command Descriptions / 6
To compare two fiIes that are identical, such as Redl and
Red2, type:
cmp redl red2 ENTER
The screen display might be:
Differences
None
...
Bytes compared: 0000002D
Bytes different: 00000000
6-15
OS-9 Commands Reference
COBBLER
Syntax: cobbler
devname
Function:
Creates the OS9Boot file required on any OS-9 boot
Parameters:
deuname
The disk drive containing the diskette on
which you want to create a new OS9Boot file.
Notes:
COBBLER creates the new OS9Boot file with the
same
modules loaded during the most recent bootstrap. (To add
modules to the bootstrap file, use OS9GEN.) COBBLER
also writes the OS-9 kernel on Track 34 and excludes these
sectors from the diskette allocation map. If any files are
present on these sectors, COBBLER displays an error
The new boot file must be contiguous on the diskette. For
this reason, you should use COBBLER only with a newly
formatted diskette. If you use COBBLER on a diskette that
does not have a storage block large enough to hold the boot
file, COBBLER destroys the old boot file, and OS-9 cannot
To change device attributes permanently, use XMODE
Examples:
To save the attributes of the current device on the system
cobbler /d0 ENTER
6-16
System Command Descriptions / 6
If you use COBBLER on a diskette that is not newly format
ted, the screen displays:
WARNING - FILE(S) OR KERNEL
PRESENT ON TRACK 34 - THIS
TRACK NOT REWRITTEN
6-17
OS-9 Commands Reference
CONFIG
Syntax: config
Function: Lets you create a system diskette that includes only
the device drivers and commands you select. CONFIG auto
matically adjusts its screen display for either 32- or 80-column
Notes:
· When executed, CONFIG displays menus of all I/0 options
and system commands. You select only those options and
commands you want to include on a new system diskette.
Creating such a system diskette lets you make the most
efficient use of computer memory and system diskette
· The CONFIG utility is on the BASIC09/CONFIG diskette.
Copy this diskette, using the OS-9 BACKUP command.
Make the copy your working diskette. Keep the original in
a safe place to use for future backups. After you boot your
system, you can put the working copy of the BASIC09/
CONFIG diskette in drive /d0. Then, type these commands:
chx /d0/cmds; chd /d0 ENTER
CONFIG does not require initial parameters. You establish
parameters during the operation of the command. Be sure
the execution directory is /DO/CMDS before executing
· You could save time by using BACKUP to create a system
disk, using CONFIG to create a new boot file, and then
deleting unwanted commands. However, this process causes
fragmentation of diskette space and results in slower disk
access. CONFIG causes no fragmentation.
6-18
System Command
Descriptions / 6
0
The MODULES directory of the BASIC09/CONFIG diskette
contains all the device drivers and device descriptors sup
ported by OS-9. The fiIename extension describes the type
of file, as noted in the following table:
Extension Module Type
Ad Device Descriptor module
.dr Device Driver module
.io Input/Output subroutine module
.hp Help file
.dw Window Device Descriptor module
At Terminal Device Descriptor module
Examples:
The following steps take you through the complete CONFIG
process:
1. With the BOOT/CONFIG diskette in the current drive,
c o n f i 9
ENTER
2. CONFIG asks whether you want to use one or two disk
drives. Press
[fj
for single- or C2 for two-drive operation.
If you specify one drive, continue with Step 3.
If you specify two drives, a display asks you to:
ENTER NAME OF SOURCE DISK:
A display now asks you to:
ENTER NAME OF DEST> DISK:
3. After a pause to build a descriptor list, the program dis
plays a list of the various devices from the MODULES
directory. Use
0
and
[E
to move to a device. To include
the device on the system diskette, press
s0
once. CONFIG
displays an X by the selected device. To exclude a selected
device, press
s0
again to erase the X.
6-19
OS-9 Commands Reference
A special help command provides information about each
device. To display information about the current device (the
device indicated by the arrow (-~)), press
0.
The list of devices might require more than one screen. Use
0
to move ahead page by page and ~ to move back.
The devices you can select and their descriptions are listed
in Chapter 2 under the section "Device Names."
To use your computer keyboard and video display, you must
select either TERM-VDG or TERM-WIN. You use
TERM-VDG for a 32-column display. For windows that
enable you to select character displays up to 80-columns,
select TERM-WIN. You must select a "DO" device as your
first disk drive. Select from the list of D devices for other
floppy disk drives. Select P to use a printer with OS-9, TI
to use a terminal, M1 to use a modem, and so on.
4. After selecting the devices you desire, press
o0.
The screen
displays,
ARE
You
SURE (Y/N)
? If you are satisfied with
your selections, press
E).
If you want to make changes,
5. CONFIG builds a boot list from the selected devices and
their associated drivers and managers in the ROOT direc
tory of the current drive. It next displays two clock options:
1 - 69hz (American)
2 - 50hz (European)
6. If you live in the United States, Canada, or any other coun
try with 60hz electrical power, press
[D.
If you live in a
country with 50hz power, press
[2 .
If you have a single disk drive, a screen prompt asks you to
swap diskettes and press ©. When asked for the SOURCE
diskette, insert the BASIC09/CONFIG diskette. When
asked for the DESTINATION diskette, insert the diskette
that is to be your new OS-9 system diskette.
If you have more than one drive, a screen prompt asks you
to insert a blank formatted diskette (the DESTINATION
diskette) in the destination drive. The rest of the boot file
6-20
System Command Descriptions / 6
7. After creating the boot file, CONFIG displays a menu of the
commands you can include on your system diskette. You
have the following choices:
o commands, Stop Now
- Do not add any commands
F 7 u 11 Command Set
- Add all OS-9 commands
from the current CMDS
directory
I l n d i v i d u a 1 1 y Select - Select
commands one by
one
[H] Receive Help
- Get help on the command
set
Press
[K)
if you want to transfer a new boot file to a
diskette on which you have previously copied the OS-9 sys
tem. If you have only one disk drive, this procedure is
quicker than using the CONFIG utility to complete the
entire system transfer, because it requires fewer disk
swaps.
Press
[D
to make an exact copy of the CMDS directory on
your source diskette with a new boot file.
Press
Cj
to individually select commands to copy on the
new diskette. The
[D
option displays a menu similar to the
device selection screen. Press
sM
to select or exclude com
mands, and use the arrow keys to move among the com
mands in the menu. CONFIG selects fiIes marked with an
X for inclusion on the new system diskette. If a command
does not have an X beside it, CONFIG excludes it from the
new system diskette.
8. If you have a multi-drive system, a prompt appears asking
you to insert your OS-9 system diskette in the destination
drive. Press the space bar. The process finishes the CON
FIG operation, and returns to OS-9.
If you have a single-drive system, you swap diskettes dur
ing the final process. This time, the SOURCE diskette is
the OS-9 System diskette. The DESTINATION diskette is
the system diskette you are creating. The number of swaps
depends on the number of options you select.
Note: When using CONFIG you do not have to use
your system diskette as the source diskette to install
the commands. The program can use any diskette
that contains a CMDS directory.
6-21
OS-9 Commands Reference
COPY
Syntax: copy [opts] pathlistl pathlist2
Function:
Copies data from one file or device to another file or
device.
Parameters:
pathlistl The name of the existing file or device from
which you want to copy.
pathlist2 The name of the device or file to receive the copy.
If you are copying data to a file, the file must not
already exist.
Options:
-
-s Causes COPY to perform a single-drive copy
operation. pathlist2 must be a full pathlist if you
use -s. In a single-drive procedure, COPY reads
a portion of the source disk into memory and
then asks you to exchange the source and the
destination diskette and press ©. COPY might
ask you to exchange diskettes several times
before it completes duplicating the entire file.
#n[K] Allows
the use of more memory for the COPY
procedure. If you specify
K, n
represents the
amount of memory you want to use, in units of
1024 bytes. If you do not specify
K, n
represents
the number of 256-byte memory pages. Using
this option can increase speed and reduce the
number of diskette swaps required for single
drive copies.
6-22
OS-9 Commands Reference
DATE
Syntax: date [t]
Function:
Displays the current date.
Options:
t Causes the time to appear with the date.
Notes:
Following is an example of how to use SETIME to set a new
date and time for the system and how to use DATE to
check system date and time:
set i m e
ENTER
A possible screen display and your responses follows:
yy/mm/dd hh.mm.ss
TIME? 86/08/22 14.19.00 ENTER
date
ENTER
August
22, 1986
date t
ENTER
August
22,1986 14.20.20
Examples:
To display the system date and time, type:
date t
ENTER
To direct the DATE command's output to the printer, type:
date t > / P
ENTER
6-24
OS-9 Commands Reference
DATE
Syntax: date [t]
Function:
Displays the current date.
Options:
t Causes the time to appear with the date.
Notes:
Following is an example of how to use SETIME to set a new
date and time for the system and how to use DATE to
check system date and time:
s e t i me
ENTER
A possible screen display and your responses follows:
yy/mm/dd hh.mm.ss
TIME? 86/08/22 14.19.00 ENTER
date
ENTER
August
22, 1986
date t
ENTER
August
22, 1986 14.20.20
Examples:
To display the system date and time, type:
date t
ENTER
To direct the DATE command's output to the printer, type:
date t >/P
ENTER
6-24
System Command Descriptions / 6
DCHECK
Syntax: dcheck [-opts]
devname
Function: Checks a disk's file structure.
Parameters:
demame
The disk drive to check.
opts One or more of the following options.
Options:
-s Counts the number of directories and fiIes and
displays the results. This option causes
DCHECK to check only the file descriptors for
accuracy.
-b Suppresses listing of unused clusters (clusters
allocated but not in the file structure).
-p Prints pathlists for questionable clusters.
-w=pathlist Specifies a path to a directory for work fiIes.
-m Saves allocation map work files.
-o Prints DCHECK's valid options.
Notes:
Sometimes the system allocates sectors on a disk that are
not actually associated with a file or with the disk's free
space. This situation can happen if you remove a disk from
a drive while files are open. You can use DCHECK to
detect this condition, as well as check the general integrity
6-25
OS-9 Commands Reference
After verifying and printing some vital file structure
parameters,
DCHECK
follows pointers down the disk's file
system tree to all directories and fiIes on the disk. As it
does so, it verifies the integrity of the file descriptor sec
tors, reports any discrepancies in the directory/fiIe links,
and builds a sector allocation map from the segment list
associated with each file. If any file descriptor sectors
(FDS)
describe a segment with a cluster not within the file
structure of the disk,
DCHECK
displays a message like
**· Had FD segment ($xxxxxx-$yyyyyy) for file:
(pathlist)
This message indicates that a segment starting at sector
xxxxxx and ending at sector yyyyyy is not on the disk. If
any of the file descriptor sectors are bad, the entire
FD
might be defective.
DCHECK
does not update the alloca
tion map for corrupt
FDS.
While building the allocation map,
DCHECK
also ensures
that each disk cluster appears once and only once in the file
structure. If it discovers duplication,
DCHECK
displays a
Cluster $xxxxxx was previously allocated
This message indicates that
DCHECK
has found cluster
xxxxxx more than once in the file structure.
DCHECK
reprints the message each time a cluster appears in more
Then,
DCHECK
compares the newly created allocation map
with the allocation map stored on the disk and reports any
differences with messages like these:
Cluster $xxxxxx in allocation map but not in file
structure
Cluster $xxxxxx in file structure but not in
allocation map
The first message indicates that sector number xxxxxx
(hexadecimal) is not part of the file system, but the disk's
allocation map has assigned it.
FORMAT
might exclude
some sectors from the allocation map because they are
6-26
System Command Descriptions / 6
The second message indicates that the cluster starting at
sector xxxxxx is part of the file structure, but the disk's
allocation map has not assigned it. Later operations might
allocate this cluster, overwriting the contents of the cluster
with data from the newly allocated file. (Clusters that
DCHECK previously allocated can have this problem.)
DCHECK builds its disk allocation map in a file called
pathlistlDCHECKppO, where pathlist is specified by the -w
option and pp is the process number in hexadecimal. Each
bit in this bitmap file corresponds to a cluster of sectors on
the disk. If you use the -p option, DCHECK creates a sec
ond bitmap file (pathlist2/DCHECKppl) that has a bit set
for each cluster DCHECK finds as "previously allocated" or
"in file structure but not in allocation map." DCHECK
then makes another pass through the directory structure to
determine the pathlists for these questionable clusters. You
can save the bitmap work fiIes by specifying the -m option
For best results, DCHECK should have exclusive access to
the disk being checked. Otherwise, the command might be
fooled by a change in the disk allocation map while
DCHECK is building a bitmap file. DCHECK cannot pro
cess disks with more than 39 levels of directories.
-p causes DCHECK to make a second pass through the file
structure and print pathlists for clusters that are not in the
allocation map but are allocated or existing in a file
-w tells DCHECK where to place its allocation map work
file(s). The specified pathlist must be a full pathlist for a
directory. (DCHECK uses directory /DO if you do not spec
ify -w.) If you doubt the structure integrity of the diskette
being checked, do not place the allocation map work files on
Examples:
The following two examples demonstrate DCHECK
dcheck /d2 ENTER
6-27
OS-9 Commands Reference
A sample screen display might be:
Volume - 'My system disk' on device /D2
$009A bytes in allocation map
1 sector per cluster
$000276 total sectors on media
Sector
$000002 is start of ROOT directory
FD
$0010 sectors used for id, allocation map
and ROOT directory
Building allocation map work file...
Checking allocation map file...
'My system disk' file structure is intact
1 directory
2 files
dcheck -mpw=/d2 /d0 ENTER
A sample screen display might be:
Volume - 'System diskette' on device /D0
$0046 bytes in allocation map
1 sector per cluster
$00022A total sectors on media
Sector $000002
is start of ROOT directory
FD
$0010 sectors used for id, allocation map
and ROOT directory
Building allocation map work file
Cluster #00040 was
previously allocated
*** Had FD segment ($111111-$23AGF0) for
file: /D0/TEXT/junky.file
Checking allocation map file
Cluster
$000038 in file structure but not
in allocation map
Cluster $00003H in file structure but not
in allocation map
Cluster $0001 H9 in allocation map but not
in file structure
Cluster $0001HH in allocation map but not
in file structure
6-28
System Command Descriptions / 6
Pathlists for questionable clusters:
Cluster $000038 in path: /d0/OS9boot
Cluster 800003H in path: /d0/OS9boot
Cluster $000040 in path: /d0/OS9boot
Cluster $000040 in path: /d0/test/
double.file
1 previously allocated clusters found
2 clusters in file structure but not in
allocation map
2 clusters in allocation map but not in
file structure
1 bad file descriptor sector
'System diskette' file structure is not
intact
5 directories
25 files
6-29
OS-9 Commands Reference
DE INIZ
Syntax: deiniz
devname [...]
Function:
Deinitializes and detaches a device.
Parameter:
deuname The name of one or more devices you want to
deinitialize.
Notes:
Use DEINIZ with INIZ. For example, you can use INIZ to
initialize a window, then redirect information to the win
dow. View the information by pressing ~ until it
appears. When you no longer need the window, use DEINIZ
to remove the window and return its memory to the
DEINIZ performs an OS-9 I$Detach call for all specified
Example:
To deinitialize the /wl (Window 1) device after it has been ini
tialized, type:
deiniz w1 ENTER
6-30
System Command Descriptions / 6
DEL
Syntax: del [-x] filename [...]
Function:
Deletes the files) specified.
Parameter:
filename
The name of the file to delete. Include as many
filenames as you want.
Option:
-x Causes DEL to assume the file is in the cur
rent execution directory.
Notes:
You can delete only files for which you have write
You can delete a directory in two ways: (1) Delete all the
fiIes in the directory, change it to a non-directory file using
ATTR, then use DEL to remove the directory, or (2) Use the
The following example shows what appears on the screen
when you display a directory, delete one of the directory's
files, then display the directory again:
d i r / d 1 ENTER
directory of
/D1 14.29.46
myfile newfile
del newfile ENTER
d i r / d 1 ENTER
directory of
/D1 14.30.37
myfile
6-31
OS-9 Commands Reference
Examples:
· To delete files named Text-program and Test-program,
type:
del text-Program test-program ENTER
To delete a file on a drive other than the current working
drive, use a complete pathlist, such as:
del /d1/number-five ENTER
· To delete a file named Cmds.subdir in the current execu
tion directory, type:
del -x cmds.subdir ENTER
6-32
System Command Descriptions / 6
DELDIR
Syntax: deldir
dirname
Function:
Deletes all subdirectories and files in a directory;
then, deletes the directory itself.
Parameter:
dirname
The pathlist to the directory you want to
delete.
Notes:
DELDIR is a convenient alternative to individually deleting
all the files and subdirectories from a directory before
deleting the directory itself.
When DELDIR runs, it displays a prompt after the com
deldir oldfiles ENTER
Deleting directory file.
List directory, delete directory, or quit ?
Pressing © causes a DIR E command to run so you can
see the directory files before DELDIR removes them.
Pressing ~o starts the deletion process.
Pressing © cancels the command.
The directory to be deleted might include other directories,
which in turn might include other directories, and so forth.
In this case, DELDIR begins with the lower directories and
You must have write permission to delete any files and
directories in this substructure. If not, DELDIR terminates
when it encounters the first file for which you don't have
6-33
OS-9 Commands Reference
0
DELDIR automatically calls DIR and ATTR. Therefore,
these fiIes must reside in the current execution directory.
6-34
System Command Descriptions / 6
DIR
Syntax:
dir
[opts][dirname
or
pathlist]
Function:
Displays a formatted list of fiIenames in a directory.
The output format adjusts itself for 80- or 32-column displays.
Parameters:
dirname
The name of the directory you want to view.
pathlist The pathlist to the directory you want to view.
opts Either or both of the following options.
Options:
If you don't specify any parameters, DIR shows the current
data directory.
x Displays the current execution directory.
e Displays the entire description for each file:
size, address, owner, permissions, date and
time of last modification.
Examples:
To display the current data directory, type:
d i r ENTER
To display the current execution directory, type:
d i r x ENTER
To display the entire description of all files in the current
execution directory, type:
d i r x e ENTER
6-35
OS-9 Commands Reference
To display the parent of the current data directory, type:
d i r . . ENTER
To display a directory named NEWSTUFF, type:
dir newstuff
ENTER
Following is a sample 80-column DIR display using the e
option:
d i r e
ENTER
The screen might display:
Directory of , 16;59:12
Dwner Last modified Attributes Sector Bytecount Name
----- ------------- ---------- ------ --------- --------
2F 85/95/29 1631 ------wr A 3A6C DS93oot
9 85/95/29 1345 d-ewrewr 48 649 CMDS
9 85/95/29 1359 d-ewrewr 177 A9 SYS
9 85/95/29 1351 ----r-wr 192 E startup
9 85/95/29 1351 d-ewrewr 194 E9 DEFS
Following is an 80-column DIR display using no options:
d i r
ENTER
The screen might display:
Directory of . 16:50:37
OS9Boot CMDS SYS startup
DEFS
6-36
System Command Descriptions l 6
Following is a 32-column DIR display using the a option:
d i r e
ENTER
Directory of . 16:52:04
Modified on Owner Name
ATTR Sector Size
85/05/20 1643 2F OS9Boot
------wr A 3AGC
85/05/20 1345 0 CMDS
d-ewrewr 48 640
85/05/20 1350 0 SYS
d-ewrewr 177 A0
85/05/20 1351 0 startup
----r-wr 192 E
85/05/20 1351 0 DEFS
d-ewrewr 194 E0
Following is a 32-column DIR display using no options:
d i r
ENTER
Directory of . 16:52:29
OS9Boot CMDS SYS
startup DEFS
6-37
OS-9 Commands Reference
DISPLAY
Syntax: display hex [...]
Function: Reads one or more hexadecimal numbers (you type
as parameters), converts them to ASCII characters, and
writes them to the standard output (normally the screen).
Parameters:
hex
A list of one or more hexadecimal numbers.
Notes:
Use DISPLAY to send special characters (such as cursor
and screen control codes) to terminals and other I/O
devices.
Following is an example of a command and the resulting
output. ABCDEF are ASCII characters corresponding to
hex 41 42 43 44 45 46.
display 41 42 43 44 45 46 ENTER
ABCDEF
Examples:
To reroute a form
feed
(hex OC) to the printer, type:
display 6C >/P ENTER
· To ring the
bell
through the video speaker, type:
display 07 ENTER
6-38
System Command Descriptions / 6
DSAVE
Syntax: dsave
[opts] [devname][dirname] > pathlist
Function:
Copies or
backs up
all files in one or more
directories.
Parameters:
deuname
The drive on which the source directory exists.
If you do not specify
deuname
DSAVE assumes
Drive /D0.
dirname
The name of the destination directory. Use
CHD to make the current directory the direc
tory to receive the copies.
pathlist A
command procedure file in which DSAVE
stores its output.
opts
One or more of the following options.
Options:
-b Makes the destination or target diskette a sys
tem diskette by copying the source diskette's
OS9Boot fille, if present.
-i Indents for directory levels.
-1 Tells DSAVE not to process directories below
the current level.
-m Tells DSAVE not to include MAKDIR com
mands in the procedure file it creates.
-sinteger
Sets memory for the copy parameter to
integer
kilobytes.
-v Verifies copies by forking to CMP after copying
each file.
6-39
OS-9 Commands Reference
Notes:
DSAVE does not directly affect the system. Instead, it gen
erates a procedure file that you execute later to do the
When you run DSAVE, it creates a procedure fille (a file of
commands). You then execute the newly created file by typ
ing its pathlist. The procedure contains all the commands
to create and change directories as needed in order to copy
the specified directory. DSAVE copies the fiIes in the cur
rent data directory. It also copies the current data direc
tory subdirectories, unless you specify the -1 option.
To use DSAVE, first change the data directory to the direc
tory you wish to copy. Execute DSAVE by specifying the
drive from which to copy and then redirecting output to a
file to receive the copy commands. Be sure to name a file
that does not already exist.
When DSAVE completes the procedure, use CHD to change
to the data directory to receive the copied fiIes. Then, exe
If DSAVE encounters a directory file, it automatically
includes MAKDIR and CHD commands in the output
before generating COPY commands for files in the subdirec
tory. The procedure file exactly replicates all levels of the
file system from the current data directory downward.
If the current data directory is the ROOT directory of the
disk, DSAVE creates a procedure file that backs up the
entire disk file by file. This is useful when you need to copy
a number of fiIes from either disks formatted differently or
from floppy diskettes to a hard disk.
Examples:
In the following series of commands, CHD positions you in
the ROOT directory of /D2, the directory to be copied.
Then, DSAVE makes the procedure file Makecopy. Using
CHD /D1 causes the copy to go in the /D1 ROOT directory.
The final command executes the procedure file.
6-40
System Command Descriptions / 6
c h d / d 2
ENTER
dsave /d2 >/d0/makecopy
ENTER
c h d / d 1
ENTER
/d0/makecopy
ENTER
The following command copies all files from /DO to /D1. It
pipes the procedure file output of DSAVE into a shell for
immediate execution.
d5ave /d0 /d1 !shell
ENTER
The following command lets you view the output generated
by a DSAVE command. It uses 48 kilobytes of memory and
indents directories. Because output goes to the screen, this
command does not create a procedure file to copy any files:
d5ave -548
-i ENTER
This command operates in the same manner as the pre
vious command. However, because it specifies a procedure
file pathlist, it stores the generated commands in a proce
dure file rather than displaying them on the screen:
dsave -548 -i > copyfile
ENTER
6-41
OS-9 Commands Reference
ECHO
Syntax: echo text
Function:
Echoes text to the screen.
Parameters:
text The character or characters you type.
Notes:
Use ECHO to generate messages in shell procedure files or
to send an initialization character sequence to a terminal.
The text should not include punctuation characters used by
the shell.
The following example prints the message
L I S T I N G E R R 0 R
M E S S A G E S
to the screen and lists the file SYS/errmsg to the
printer as a background task.
echo LISTING ERROR MESSAGES; list sys/
errmsg >/P&
ENTER
Examples:
To display a message on the screen, type:
echo This text is echoing
ENTER
· To echo text to the console, type:
echo >/term -WARNING DATA ON DISK WILL HE
LOST!
ENTER
· The following combines the ECHO and LIST commands to
echo the entered text to the printer and to direct the con
tents of the Trans file to the printer.
echo >/p LISTING OF TRANSACTION; list trans
> / P & ENTER
6-42
System Command Descriptions / 6
ERROR
Syntax: error errnumber [...]
Function:
Displays the text error message that corresponds
with the specified OS-9 error number.
Parameters:
errnumber
Is an OS-9 error code in the range 1-255.
Notes:
ERROR opens the Errmsg file in the SYS directory and
reads through the file for an error code that matches the
specified number. It then displays the text that corresponds
to the error code.
· The Errmsg file contains descriptions of the standard OS-9
errors. The order of the file is arranged to provide quick
access to operation system error descriptions.
Example:
To display a description of the OS-9 error Numbers 215 and
216, type:
error 215 216 ENTER
The screen displays:
215 - Had Path Name
216 - Path Name Not Found
6-43
OS-9 Commands Reference
EX
Syntax: ex filename
Function: Starts a process by chaining from the current shell
to the new process. Chaining means that execution control is
turned over to the new process.
Parameters:
filename The name of the program or module you want
to execute.
Notes:
Using EX causes the shell from which you are operating to
terminate. If the new process also terminates and you do
not have another shell running on another terminal or win
dow, OS-9 is left without any processes, and you must
reboot your computer and OS-9.
If a shell is running on another window or device, you can
restart a new shell from that window or device. For
instance, if you use EX to initialize BASIC09 from /TERM
then exit BASIC09, /TERM is dead and cannot accept key
board input. However, if you also have a shell operating in
a window, you can type the following from that window:
shell i=/term6 ENTER
This reinitializes a shell on /TERM. It can now accept key
board input and OS-9 commands.
Use EX to save memory when the shell is not needed, for
instance when using BASIC09.
6-44
System Command Descriptions / 6
0
If you use EX on a command line with other commands, it
must be the last command. Any commands following EX
are not processed.
Example:
To run BASIC09 without a resident shell, type:
ex basic09 ENTER
6-45
OS-9 Commands Reference
FORMAT
Syntax: format
devname [opts]
Function:
Establishes and verifies an initial file structure on
a floppy diskette or a hard disk. You must format all disks
before you can use them on an OS-9 system.
Parameters:
deaname
The drive name of the disk you want to
format.
name
The name you want to assign the newly for
matted disk. Enclose the disk name in double
quotation marks.
opts One or more of the following options.
Options:
r Causes the format to proceed automatically,
without issuing prompts.
1 Formats single-sided. Use with single-sided
drives or single-sided diskettes in double-sided
drives.
2 Causes a double-sided format. Use with
double-sided drives and double-sided diskettes.
`cylinders'
The number of cylinders (in decimal) that you
want formatted.
:interleave: The number of the sector interleave value (in
decimal).
6-46
System Command Descriptions / 6
Notes:
· Be sure the disk you want to format is NOT write
protected. Otherwise, FORMAT generates error code #242
(write protect), and the system returns to the OS-9 prompt
without formatting the diskette.
If you are formatting a hard disk, first type:
tmode -Pause ENTER
This command turns off the screen pause function. Other
wise, the process stops whenever the sector verification pro
cess fiIls the display screen. If you forget to turn off the
screen pause, press the space bar whenever the screen fills.
Execution then continues.
When formatting finishes, type:
tmode pause ENTER
This re-establishes the screen pause function.
The formatting process works this way:
1. FORMAT physically initializes a disk and divides
its surface into sectors.
2. FORMAT reads back and verifies each sector. If a
sector fails to verify after several attempts, FOR
MAT excludes it from the initial free space on the
diskette. As verification proceeds, the process dis
3. FORMAT writes the disk allocation map, ROOT
directory, and identification sector to the first few
sectors of Track 0. These sectors must not be
FORMAT asks for a disk volume name, which can be up to
32 characters long and can include spaces or punctuation.
(Later, you can use the FREE command to display the
6-47
OS-9 Commands Reference
0
For step-by-step instructions on formatting, refer to
Getting
Started With OS-9.
Examples:
· To format a diskette in Drive /D1, type:
format /d1
ENTER
· To format a diskette in Drive /D1 with the name Test Disk
and without prompts, type:
format /d1 r "test disk"
ENTER
· To format hard Disk /H0, type:
tmode -pause
ENTER
format /h0
ENTER
tmode pause
ENTER
To format a double-sided diskette in Drive /D2 with 27 cyl
inders and the name Database, type:-...
format /d1 2 d "database" '27'
ENTER
6-48
System Command Descriptions / 6
FREE
Syntax: free drive
Function: Displays the number of unused sectors (256-byte
storage areas) on a disk drive. These sectors are available for
new fiIes or for expanding existing files.
Parameters:
drive
The disk drive for which you want to display
the number of free sectors.
Notes:
· The device name you specify must be a disk drive. FREE
also displays the disk's name, creation date, and cluster
size. If you don't specify a drive, FREE selects the drive
that contains the current data directory.
The cluster size for the Color Computer is one sector.
Examples:
To display the number of free sectors on the current disk,
f r e e ENTER
The screen is similar to this:
"COLOR COMPUTER DISK" created on: 83/0S/28
Capacity: 630 sectors C1-sector clusters)
1S Free sectors, largest block 12 sectors
To display the number of free sectors on the diskette in
free /d1 ENTER
6-49
OS-9 Commands Reference
A sample screen display is:
DATA DISK created on: 83/06/16
Capacity: 630 sectors C1-sector clusters)
445 Free sectors, largest block 442 sectors
6-50
System Command Descriptions / 6
HELP
Syntax: help
command name
Function:
Displays the use and syntaxes of OS-9 commands.
Parameters:
command The command(s) for which you want help.
name Include as many command names as you want.
Notes:
HELP uses a file named Helpmsg, which is located in the
SYS directory on your system diskette.
Examples:
To obtain help for the BACKUP command, type:
help backup
ENTER
The screen displays:
BACKUP 1e11511-vl[devl[devl
Copies all data from one device to another
If you try to obtain help for a non-existent command, HELP
displays an error message. For instance, if you type:
help m e
ENTER
ME Help not available
You can also obtain help for the HELP command. To do so,
type:
help
ENTER
The screen displays:
HELP [command name][ ...1
6-51
OS-9 Commands Reference
IDENT
Syntax: ident name [opts]
Function:
Displays header information for memory modules.
Parameters:
name
The name of the file or module for which you
want to view identifilcation information.
opts One or more of the following options.
Options:
-m Causes IDENT to assume that
filename is
a
module in memory
-v Tells IDENT not to verify module cyclic redun
dancy check
-x Causes IDENT to assume that
filename
is in
the execution directory
-s Displays the following module information on a
single line: the edition byte (first byte after
module name), the type/language byte, the
module CRC and the module name. A period
(.) indicates that the CRC verifies. A question
mark (?) indicates that the CRC does not
verify.
Notes:
0
IDENT displays the module size, CRC bytes (with verifica
tion), and-for program and device driver modules-the exe
cution offset and the permanent storage requirement bytes.
6-52
System Command Descriptions / 6
IDENT displays and interprets the type/language and
attribute revision bytes. IDENT displays the byte immedi
ately following the module name because most Microware®
supplied modules set this byte to indicate the module
IDENT displays all modules contained in a disk file.
Examples:
To display header information for a file named Ident that
resides in computer memory, type:
ident -m ident ENTER
The screen might display:
Header for:IDENT
Module size: $06E7 x1767
Module CRC: $S40HH2 (Good)
'~ Hdr parity: $C9
Exec. off: $0230xS73
Data size: $099Ca2460
Edition: $07 x7
Ty/La At/Rv$11 $81
Prog mod, 6809 obj, re-en, R/0
In the example, Hdr parity = header parity; Exec. off =
execution offset; Data size = permanent storage require
ments; Edition = first byte after module name; Ty/La/At/
Rv = type/language/attribute/revision; and Prog mod, 6809
obj, re-en = module type, language, attribute.
To display header information for the OS9Boot file,type:
ident /D0/OS9boot -s ENTER
6-53
OS-9 Commands Reference
The display might include:
17 $C0 8F2922F . OS9p2
67 $CO $0B2322 . Init
12 $C1 $2E9EDH . IOMan
27 $D1 $13665E3 . RHF
6 8E1 $055580 . CC3Disk
82 $F1 $FC1918 . D0
82 $F1 $9F4210 . D1
82 $F1 $E68118 . DD
11 8D1 $10A3FA . SCF
14 $E1 $8524F1 .CC310
1 $C1 $H53D94 . VDGInt
3 $C1 8792B7E . GrfInt
83 $F1 $AHSAE5 . TERM
83 $F1 $7AH2DH . W
83 $F1 8C3E38A . W1
83 8F1 $948878 . W2
83 $F1 $36016H . W3
83 $F1 $0AE2B6 . W4
83 $F1 812389A . W5
83 $F1 81CF164 . W6
83 $F1 $H71DF5 . W7
11 $E1 $C8F073 . ACIAPAK
82 $F1 $9E655D . T2
12 8E1 8CC3EA4. PRINTER
83 8F1 $FE3HAE . P
4 8D1 $AD6718 . PipeMan
2 $E1 $5B2B56 . Piper
80 8F1 8CC06AF . Pipe
9 $C1 $HE93F4 . Clock
3 $11 8CA1F99 . CC3Go
Since the -s option appears in the command line, IDENT
displays each module's information on a single line. In the
first line of the output, for instance, 1 = edition byte (first
byte after name), $CO = type/language byte, $A366DC =
CRC value, . = OK CRC check, and OS9p2 = module
6-54
System Command Descriptions / 6
INIZ
Syntax: iniz
devname [...]
Function: Initializes the specified device driver.
Parameters:
devnarne
The name of one or more devices to initialize.
Notes:
You can use INIZ in the Startup file or at the system start
up to initialize devices and allocate their static storage at
the top of memory to reduce memory fragmentation.
INIZ attaches the specified device to OS-9, places the device
address in a new device table entry, allocates the memory
needed by the device driver, and calls the device driver ini
tialization routine. INIZ does not reinitialize a device that
you or the system previously installed.
If you change the printer (/p) to a non-shareable device (a
device that is not re-entrant), do not initialize it with INIZ.
Examples:
To initialize the /P (printer) and /T2 (terminal 2) devices,
i n i z P t 2 ENTER
6-55
OS-9 Commands Reference
KILL
Syntax: kill procID
Function: Terminates the process specified by proclD.
Parameters:
procID The ID number of the process to kill.
Notes:
Unless you are the Super User (User Number 0), you can
only terminate a process that has your user number. (Use
PROCS to obtain the process ID numbers.) The Super User
can terminate any process.
If a process is waiting for 1/O, you cannot cancel it until the
current I/O operation terminates. Therefore, if you KILL a
process and PROCS shows it still exists, it is probably wait
ing to receive a line of data from a terminal.
Because KILL is a built-in shell command, it does not
appear in the CMDS directory.
Examples:
To KILL the process with the ID number 5, type:
kill 5 ENTER
The following commands: (1) use PROCS to determine that
the ID number of the process to be killed is 3, (2) termi
nate process 3, and (3) use PROCS to confirm that KILL
has cancelled the process.
6-56
System Command Descriptions l 6
Proce ENTER
User Mem Stack
Id Pld Number Pty Age Sts Sign1 Siz Ptr Primary Module
--- --- ------- --- --- --- ----- --- ----- ----------------
2 1 0 128 128 $80 0 3 87882 Shell
3 5 0 128 128 $80 0 2 874AC Tsmon
4 5 0 128 128 880 0 6 805F3 ProC5
5 0 0 128 129 880 0 3 $6FE2 Shell
kill 3 ENTER
procs ENTER
User Mem Stack
Id PId Number Pty Age Sts Signl Siz Ptr Primary Module
--- --- ------- --- --- --- ----- --- ----- ----------------
2 1 0 128 128 $80 0 3 $7882 Shell
3 5 0 128 128 $80 0 6 $05F3 Proc5
5 0 0 128 129 $80 0 3 36FE2 Shell
6-57
OS-9 Commands Reference
LINK
Syntax: link
modname
Function:
Locks a previously loaded module into memory.
Parameters:
nwdnanze
The name of the memory module to link.
Notes:
If the module is not already in memory, you must use
LOAD prior to using LINK. The link count of the module
increases by one each time the system
links
it. Use
UNLINK to
unlock
the module when you no longer need it.
---
Examples:
To lock the Edit module into memory, type:
link edit ENTER
6-58
System Command Descriptions / 6
LIST
Syntax: list filename [...]
Function:
Lists the contents of a text fille or fiIes.
Parameters:
filename
The name of the fille you want to list. Include
as many filenames on one line as you want, up
to the maximum line length of 199 characters.
Notes:
LIST copies text lines from a file to the standard output
path. The program terminates upon reaching the end-of-file
of the last input path. If you specify more than one file,
LIST copies the files in the order in which you list them.
Use LIST to examine or print text files.
Do not LIST executable fiIes. Doing so can cause your sys
tem to lock or crash. To view executable files, use DUMP.
Examples:
To list the contents of the Startup file to the printer, type:
list /d0/startup >/P&
ENTER
The ampersand makes the printing job a concurrently exe
cuted task.
· To list three files to the screen, type:
list /d1/userS/document /d0/myfile /d0/
bob/text
ENTER
· To copy everything you type at the keyboard to the printer,
type:
list /term >/P
ENTER
6-59
OS-9 Commands Reference
To go back to the standard output path (the video display)
press
CTRL BREAK .
0
The following commands create a file called Animals, con
sisting of six entries. LIST, with the fiIename Animals as a
parameter, displays the contents of the new file.
build animals
ENTER
? cat
ENTER
? cow ENTER
? dog
ENTER
? elephant
ENTER
? bird
ENTER
? fish
ENTER
? ENTER
list animals
ENTER
The screen displays:
cat
cow
dog
elephant
bird
fish
6-60
System Command Descriptions / 6
LOAD
Syntax: load pathlist
Function: Loads a module (program) from a file into memory.
Parameters:
pathlist Specifies the module to load.
Notes:
LOAD opens the path you specify, then loads into memory
one or more modules from it. The process adds the names of
the new modules to the module directory. If LOAD finds
that a specifiled module has the same name and type as a
module already in memory, it keeps the module with the
If the pathlist for LOAD does not include a drive name,
LOAD uses the current execution directory. To LOAD a
module from a directory other than the current execution
directory, specify a full pathlist, beginning with a drive
Examples:
In the following example, MDIR displays the names of mod
ules currently resident in memory. Then, LOAD loads the
Edit module into memory. MDIR again lists memory mod
ules, and this time shows that Edit is successfully added to
i-- and i r ENTER
6-61
OS-9 Commands Reference
The screen display is similar to the following:
Module Directory at 12:49:52
REL Boot OS9p1 OS9p2 Init
IOMan RBF CC3Disk D0 D1
DD SCF CC310 VDGInt GrfInt
TERM W W1 W2 W3
W4 W5 W6 W7 ACIAPAK
T2 PRINTER P PipeMan Piper
Pipe Clock CC3Go CC3HDisk H0
Shell Copy Date DEIniz Del
Dir Display Echo Iniz Link
List Load MDir Merge Mfree
Procs Rename Setime Tmode Unlink
Ba5ic09 GrfDrv
load edit
ENTER
and i r
ENTER
The screen displays:
Module Directory at 12:51:12
REL Boot 0S9P1 OS9p2 Init
IDMan RBF CC3Disk D0 D1
DD SCF CC310 VDGInt GrfInt
TERM W W1 W2 W3
W4 W5 W6 W7 ACIAPAK
T2 PRINTER P PipeMan Piper
Pipe Clock CC3Go CC3HDisk H0
Shell Copy Date DEIniz Del
Dir Display Echo Iniz Link
List Load MDir Merge Mfree
Procs Rename Setime Tmode Unlink
Basic09 GrfDrv Edit
6-62
System Command Descriptions / 6
MAKDIR
Syntax: makdir
pathlist
or
dirname
Function: Creates a directory according to the pathlist given.
You must have write permission for the parent directory of the
directory you are creating.
Parameters:
pathlist The path to the directory you want to create.
dirname
The name of the directory you want to create.
Notes:
^ 0
When MAKDIR initializes the new directory, the directory
contains only the "." and ".." files.
MAKDIR enables all permissions for the directory it
creates.
0
To follow OS-9 convention, capitalize all directory names.
Examples:
To create a directory on Drive /D1, use the directory's full
pathlist from the root, such as:
makdir /d1/STEVE/PROJECT ENTER
To create a directory called DATAFILES within the current
data directory, type:
makdir DATAFILES ENTER
To create a directory called SAVEFILES in the parent of
the current directory, type:
makdir ../SAVEFILES ENTER
6-63
OS-9 Commands Reference
MDIR
Syntax: mdir [e]
Function: Displays the names of modules currently in mem
ory. MDIR automatically adjusts its output for 32- or 80
column displays.
Options:
e Causes a full listing of the extended physical
address (block number and offset within the
block), size, type, revision level, re-entrant
attribute, user count, and name of each mod
ule. MDIR shows numbers in hexadecimal.
The display adjusts for 80 or 32 columns.
Notes:
Many of the modules displayed by MDIR are OS-9 system
modules and are not executable as programs. Always
check the module type code before running a module
with which you are not familiar.
Examples:
Because MDIR adjusts to either 32 or 80 columns, the fol
lowing command produces a full module listing in either
and i r e ENTER
The 80-column display of MDIR a is:
Module Directory at 03:03:53
Block Offset Size Typ Rev Attr Use Module Name
----- ------ ---- --- --- ---- ---- ------------
3F D96 12A C1 1 r 0 REL
6-64
System Command Descriptions l 6
3F E30 1DO C1 1 r 1 Boot
3F 1000 ED9 CO 8 r 0 059P1
1 200 CA1 CO 2 r 1 OS9p2
1 EA1 2E CO 1 r 1 Init
1 ECF 993 C1 1 r 1 IOMan
1 1862 1223 D1 1 r 63 RBF
1 2A81) 476 E1 1 r 2 CC3Di51k
1 2F03 30 F1 1 r 2 DO
1 2F33 30 F1 1 r 0 D1
1 2F63 30 F1 1 r 0 DD
1 2F93 SB6 D1 1 r 22 SCF
1 3549 B91 E1 1 r D CC3I0
1 40DA CE7 C1 1 r 1 VDGInt
1 4DC1 BF2 C1 1 r 1 GrfInt
1 59133 45 F1 1 r 8 TERM
1 59F8 42 F1 1 r 0 W
1 SARA 43 F1 1 r 0 W1
1 5A7D 43 F1 1 r 0 W2
1 SACO 43 F1 1 r 0 W3
1 5803 43 F1 1 r 0 W4
1 5846 43 F1 1 r 0 WS
1 5389 43 F1 1 r 0 W6
1 513CC 43 F1 1 r S W7
1 SCOF 385 E1 1 r 8 ACIAPAK
1 5FC4 3F F1 1 r 9 T2
1 6003 17A E1 1 r D PRINTER
1 617D 3C F1 1 r D P
1 6199 219 D1 1 r 12 PipeMan
1 63D2 28 E1 1 r 12 Piper
1 63FA 26 F1 1 r 12 Pipe
1 6420 174 C1 1 r 1 Clock
1 6594 1AA 11 1 .... 1 CC300
6 0 SF2 11 1 r 3 Shell
6 SF2 2DC 11 1 r 0 Copy
6 8CE FD 11 1 r 0 Date
6 9C3 76 11 1 r 0 DEIniz
6 A41 AS 11 1 r 0 Del
6 AE6 365 11 1 r 0 Dir
6 E43 84 11 1 r 0 Display
6 ECF 22 11 1 r 0 Echo
6 EF1 6A 11 1 r 0 Iniz
6 FSB 2C 11 1 r 0 Link
6 F87 4F 11 1 r 0 List
6 FD6 24 11 1 r 0 Load
6 FFA 2F1 11 1 r 1 MDir
6-65
OS-9 Commands Reference
6 12EB 68 11 1 r 0 Merge
6 1353 1EH 11 1 r 0 Mfree
6 153E 319 11 1 r 0 Proc5
6 1857 11D 11 1 r 0 Rename
6 1974 118 11 1 r 0 Setime
6 1A8C 301 11 1 r 0 Tmode
6 1D8D 2D 11 1 r 0 Unlink
The 32-column display of MDIR is:
Module Directory at 03:06:49
Hlk Ofst Size Ty Rv At Uc Name
--- ---- ---- -- -- -- -- ------
3F D06 12A C1 1 r 0 REL
3F E30 1DO C1 1 r 1Hoot
3F 1000 ED9 CO 8 r 0 0S9p1
1 200 CA1 CO 2 r 1 OS9p2
1 EA1 2E CO 1 r 1 Init
1 ECF 993 C1 1 r 1 IOMan
1 1862 122H D1 1 r 70 RHF
1 2ABD 476 E1 1 r 2 CC3Disk
1 2F03 30 F1 1 r 2 DO
1 2F33 30 F1 1 r 0 D1
1 2F63 30 F1 1 r 0 DD
1 2F93 586 D1 1 r 24 SCF
1 3549 B91 E1 1 r D CC310
1 40DA CE7 C1 1 r 1 VDGInt
1 4DC1 HF2 C1 1 r 1 GrfInt
1 5983 45 F1 1 r 8 TERM
1 59F8 42 F1 1 r 0 W
1 5A3A 43 F1 1 r 0 W1
1 5A7D 43 F1 1 r 0 W2
1 SACO 43 F1 1 r 0 W3
1 5803 43 F1 1 r 0 W4
1 5846 43 F1 1 r 0 W5
1 5889 43 F1 1 r 0 W6
1 SHCC 43 F1 1 r 5 W7
1 5COF 3BS E1 1 r A ACIAPAK
1 SFC4 3F F1 1 r H T2
1 6003 17A E1 1 r D PRINTER
1 617D 3C F1 1 r D P
1 6189 219 D1 1 r 12 PipeMan
1 63D2 28 E1 1 r 12 Piper
1 63FA 26 F1 1 r 12 Pipe
1 6420 174 C1 1 r 1 Clock
6-66
System Command Descriptions l 6
1 6594 1AA 11 1 . 1 CC3Go
6 0 5F2 11 1 r 3 Shell
6 5F2 2DC 11 1 r 0 Copy
6 8CE FD 11 1 r 0 Date
6 9CB 76 11 1 r 0 DEIniz
6 A41 A5 11 1 r 0 Del
6 AE6 365 11 1 r 0 Dir
6 E4B 84 11 1 r 0 Display
6 ECF 22 11 1 r 0 Echo
6 EF1 6A 11 1 r 0 Iniz
6 FSB 2C 11 1 r 0 Link
6 F87 4F 11 1 r 0 List
6 FD6 24 11 1 r 0 Load
6 FFA 2F1 11 1 r 1 MDir
6 12EB 68 11 1 r 0 Merge
6 1353 1EB 11 1 r 0 Mfree
6 153E 319 11 1 r 0 Procs
6 1857 11D 11 1 r 0 Rename
6 1974 118 11 1 r 0 Setime
6 1A8C 301 11 1 r 0 Tmode
6 1D8D 2D 11 1 R 0 Unlink
6-67
OS-9 Commands Reference
MERGE
Syntax: merge [filename][...]
Function:
Copies fiIes to the standard output path. By redi
recting the output of the MERGE command, you can combine
several fiIes into one file, or direct several files to the printer.
Parameters:
filename
Specifiles the filles to combine.
Notes:
Use MERGE to combine several fiIes into a single output
file. It copies data in the order in which you type the
MERGE does not output line editing characters (such as
the automatic line feed).
You normally use MERGE to redirect the standard output
You can use MERGE to append or copy any type or mix
ture of files to another device.
Examples:
· To merge four files into a new file called Combined.fiIe, and
send the results to the new file instead of to the video dis
merge filel filet file3 file4 >combined.file
ENTER
To merge two filles, and send the output to the printer, type:
merge compile.list asm.list
>/P ENTER
6-68
System Command Descriptions / 6
MFREE
Syntax: mfree
Function: Displays a list of memory areas not presently in use
and, therefore, available for assignment.
Notes:
0
MFREE displays the block number, physical (extended)
beginning and ending addresses, and the size of each con
tiguous area of unassigned RAM. It gives the size in num
ber of blocks and in kilobytes. The block size is 8 kilobytes
per block. Free memory for user data areas does not need to
be contiguous because the MMU can map scattered free
blocks to be logically contiguous.
Examples:
Type this command:
mfree ENTER
The screen shows a display similar to this:
Blk Begin End Blks Size
--- ----- ----- ---- ------
10 12000 10FFF 1 8K
18 18000 1DFFF 3 24K
20 20000 3FFFF 16 128K
Total: 20 160
6-69
OS-9 Commands Refererue
i
MODPATCH
Syntax: modpatch [options]
filename [options]
Function:
modifiies modules residing in memory. MODPATCH
reads a
patchfile
and executes the commands in the patchfile
to change the contents of one or more modules.
Parameters:
filename
The name of a file containing instructions for
MODPATC H
options
One of the following options that change MOD
PATCH's function
Options:
Silent mode, does not display patchfile com
mand lines as they are executed.
-w Does not display warnings, if any
-c Compares only, does not change the module
I .
,I
I!
a
i
IV
6-70
System Command Descriptions 6
Notes:
' 0
Before using MODPATCH, you must create a patchfile to
supply the data to control MODPATCH's operation. This file
contains single-letter commands and the appropriate mod
ule addresses. The commands are:
1 modulenarne
Link to the module specified
by
modulename.
c offset origval rewval
Change the byte at the offset
address specified by
offset
from
the value specified by
origval
to the new value specified by
newval.
If the original value
does not match origval, MOD
PATCH displays a message.
v Verify the module-update the
modules CRC. If you plan to
save the patched module to a
.-- file that the system can load,
you must use this command.
m Mask IRQ's. Turns off inter
rupt requests (for patching
service routines).
u Unmask IRQ's. Turns on inter
rupt requests (for patching
service routines).
You can use the BUILD command or any word processing
program to create patchfiles.
Module byte addresses begin at 0. MODPATCH changes
values pointed to by an offset address (offset from 0) rather
than an absolute memory address.
6-71
OS-9 Commands Reference
To view the contents of a memory module, use SAVE and
DUMP to copy the module to a file and display its contents.
Also use SAVE to copy the patched module to a disk file.
· Changing a memory module might not produce an immedi
ate effect. You have to duplicate the initialization procedure
for that module. This means, if the module loads during
bootup, you have to create a new boot fiile that includes the
changed module, then reboot using the new boot file.
To use the patched module in future system boots, use
SAVE to store the module in the MODULES directory of
your system disk. You can then use OS9GEN to create a
new system disk using the patched module. If you are
using the patched module to replace another module,
rename the original module and then give the patched
module the original name.
If you patch a module that is loaded during the system
boot, you can use COBBLER to make a new system boot
that uses the patched module.
Examples:
The following example shows the commands, the screen prompts,
and the entries you make to patch the standard 40-column term
window descriptor to be an 80-column screen rather than the
standard 40-column screen:
OS9:bulld termpatch
ENTER
? I term
ENTER
? c 002c 28 50 ENTER
? c 0030 Ot02
I
? v ENTER
? ENTER
OS9: modpatch termpatch
ENTER
'I
6-72
a
System Command Descriptions / 6
To change the size, columns, and colors of Device Window W1,
create the following procedure fille and name it W180:
I wt
c 0030 01 02
c 002c 1b 50
c 002d Ob 18
If the W1 module is not already in memory, load it from the
MODULES directory of your system disk. Then, before initializ
ing W1, run MODPATCH:
modpatch w180 ENTER
Next, initialize W l:
i n i z w 1 ENTER
shell i=/w16 ENTER
Press
CLEAR
to display the new window with 80 columns, 24
lines, and a white background.
6-?3
OS-9 Commands Reference
i
i
r
MONTYPE
Syntax: montype
type
Function:
Sets your system for the type of monitor you are
using
Parameters:
Parameters:
type A single letter indicating the monitor type:
c for composite monitors or color televisions
r for RGB monitors
m for monochrome monitors or black and
r~-
white televisions
,-----Notes:
Different types of color monitors display colors differently.
For the best results, set your system to the type of monitor
If you are using a monochrome monitor or black and white
television, you can obtain a sharper image by setting your
monitor type to monochrome.
Include the MONTYPE command in your system's Startup
file to automatically boot in the proper monitor mode.
If you do not use MONTYPE, the system defaults to c (com
Example:
To set your system for an RGB monitor, type:
montype r ENTER
6-74
I
System Command Descriptions i 6
To add a MONTYPE command to your existing Startup file, first
use BUILD to create the new command. For example:
build temp
ENTER
montype r
ENTER
ENTER
Next, append the file to Startup. Type:
merge startup temp > startup.new
ENTER
Delete the temp file:
de l temp
ENTER
To enable the system to use Startup.new when booting, rename
the original Startup file:
rename Startup Startup.old
Then rename Startup.new:
rename Startup.new Startup
OS-9 Commands Reference
OS9GEN
Syntax: os9gen
devname [opts]
Function:
Creates and links the required OS9Boot file to a
diskette making it a bootable diskette.
Parameters:
deuname
The disk drive containing the diskette to
receive the new boot file.
opts One or more of the following options.
Options:
-s Causes OS9GEN to use only one drive to gen
erate the boot file. In a single-drive operation,
OS9GEN reads the modules from the source
diskette and asks you to exchange diskettes
and press © as it reads and copies the
modules.
#n[K]
reserves
n
kilobytes of memory for use by the
OS9GEN command. By setting aside as much
memory as possible, you can increase the
speed of OS9GEN and, on single-drive sys
tems, reduce the number of diskette swaps. If
you type
K
after
#n,
the memory specified by
n
is in kilobytes (1024 bytes), otherwise
n is
in 256-byte pages.
Notes:
0
OS9Boot files can only exist on contiguous sectors. There
fore, use OS9GEN only with newly formatted diskettes. If
OS9Boot is fragmented, the system warns you not to use
the diskette to bootstrap OS-9.
6-70
.s
System Command Descriptions / 6
OS9GEN creates a working file called Tempboot on the
device specified by
deuname.
Next, it reads filenames (path
lists) either from the keyboard (the standard input path) or
redirected from a file. If you enter names manually,
OS9GEN does not display a prompt. Type each filename
and press
ENTER
. After typing the last filename and press
ing
ENTER , press ENTER
again, or press
CTRL BREAK
to com
OS9GEN opens each file and copies it to Tempboot. The
process repeats until it reaches a blank line or an end-of
file marker. All boot files must contain the OS-9 component
modules listed in the Chapter 5 section "File Managers,
Device Drivers, and Descriptors".
You must have RENAME in the current execution directory
or in memory for OS9GEN to work properly.
With all input files copied to Tempboot, OS9GEN deletes
the OS9Boot file, if it exists. It renames Tempboot as
OS9Boot, and writes the file's starting address and size in
the diskette's Identification Sector (LSN 0) for use by the
OS-9 bootstrap firmware. OS-9 writes its kernel on diskette
Track 34. If there is not room for the kernel, an error mes
sage appears, and the operation terminates.
If you have only one drive, you can generate a new boot file
more easily using the CONFIG utility. CONFIG is
designed to make custom system diskettes using either sin
Examples:
The following commands manually install a boot file on
device /D1 that is an exact copy of the OS9Boot file on
device /D0. The first command line runs OS9GEN, the sec
ond enters the name of the file to install, and the third
enters an end-of-file marker.
os9gen /d1
ENTER
/d6/os9boot
ENTER
CTRL BREAK
6·71
OS-9 Commands Reference
· The following commands let you manually install a boot file
on device /D1 that is a copy of the OS9Boot file on device
/DO and the modules stored in the files /DO/Tape.driver and
s-1
/D2/Video.driver. Line 1 executes OS9GEN. Line 2 enters
the main boot filename. Lines 3 and 4 enter the names of
the two additional files, and Line 5 enters an end-of-file
marker.
os99en /d1
ENTER
/d0/os9boot
ENTER
/d0/tape.driver
ENTER
/d2/video.driver
ENTER
CTRL BREAK
· The following commands generate a new boot file on Drive
/D1 that includes all the old boot file functions. Line 1 uses
BUILD to create a file called Bootlist. The next three lines
enter the names of the three files within Bootlist. Line 5
terminates BUILD, and Line 6 runs OS9GEN with input
redirected from the new Bootlist file.
build /d0/bootlist
ENTER
/.,
? /d0/os9boot
ENTER
? /d0/tape.driver
ENTER
? /d0/video.driver
ENTER
? ENTER
os99en /d1</d0/bootlist
ENTER
· To install a custom boot file on a single-drive system, build
a Bootlist to drive the OS9GEN program. You need a direc
tory that contains the required file managers, device driv
ers, descriptors, and other files for the boot file. For
example, to make a new boot file containing only the
/TERM, /D0, /D1, and /P devices, first build a Bootlist such
6-72
System Command
Descriptions l 6
build /d0/bootlist
ENTER
? term-vd9.dt
ENTER
d
ENTER
? d 0-35 s . d d
ENTER
? d1-355 . dd
ENTER
? o59p2
ENTER
? I n i t
ENTER
? IOMan
ENTER
? RHF . mn
ENTER
? CC3Di5k.dr
ENTER
? SCF.mn
ENTER
? C C 3 I 0 . d r
ENTER
? vd9int.io
ENTER
? 9rfint.io
ENTER
? Printer.dr
ENTER
? clock.60hz
ENTER
? cc39o
ENTER
Then use OS9GEN to create the new boot file on a separate
diskette by typing:
o599en /d0 -5 #25K </d0/bootli5t
ENTER
This command causes OS9GEN to use only one drive, 25K
of buffer space, and the filenames previously stored in the
Bootlist file.
You can expand this basic bootlist file to include other stan
dard OS-9 modules such as window device drivers, other
disk drivers, graphic drivers, and so on. Or, you can add
device descriptors and device drivers of your own, that
become part of the directory of modules loaded into OS-9
during boot.
All of the standard bootlist modules are contained in the
MODULES directory on the BASIC09/CONFIG diskette.
6-73
a
OS-9 Commands Reference
PROCS
Syntax: procs [e]
Function:
Displays a list of the processes running on the sys
tem. PROCS automatically adjusts its output for 32-or 80
column displays.
Options:
e Causes PROCS to display the processes of all
users.
Notes:
· Normally PROCS lists only processes having the user's ID.
The list is a snapshot taken at the instant PROCS exe
cutes. Processes switch states rapidly, usually many times
· PROCS shows the user and process ID numbers, priority,
state (process status), memory size (in 256 byte pages), pri
mary program module, and standard input path.
PROCS adjusts its output for 80 or 32 columns.
Examples:
0
Because PROCS automatically adjusts for either 32- or 80
column displays, the following command can produce either
p r o c s e ENTER
6-74
a
System Command Descriptions l 6
Following is a possible 32-column display of PROCS:
Id PId Userx Pty Age Ste
Sigl Mem StPtr Primary
2 1 0 128 128 $80
0 3 $78E2 Shell
3 6 0 128 128 $80
0 16 87482 Ha5iC09
4 2 0 128 128 $80
0 6 $05F3 PrOC5
5 0 0 128 128 $80
0 3 $6FH2 Shell
6 0 0 128 129 $80
0 3 $68E2 Shell
Fbllowing is a possible 80-column display of PROCS:
User Mem Stack
Id PId Number Pty Age Sts Signl Siz Ptr Primary Module
--- --- ------- --- --- --- ----- --- ----- ----------------
2 1 0 128 128 180 0 3 17882 Shell
3 6 0 128 128 180 0 16 1702 Hasic09
4 5 0 128 128 180 0 3 172E2 Shell
5 0 0 128 129 180 0 3 16FH2 Shell
6 0 0 128 129 180 0 3 168E2 Shell
7 4 0 128 128 180 0 6 105F3 Procs
s-7s
rd
OS-9 Commands Reference
PWD
PXD
Syntax: pwd
pxd
Function:
PWD shows the path from the ROOT directory to
the current data directory. PXD shows the path from the
ROOT directory to the current execution directory.
Notes:
0
OS-9 keeps a current data directory and current execution
directory for each process. Use PWD and PXD to show
where your current data and execution directories are
located on the disk or disks you are using.
Examples:
· The following example uses a full pathlist. CHD changes
the current data directory to the MANUALS directory.
chd /d1/steve/textfiles/manuals
ENTER
To display the full path to the data directory, type:
pwd
ENTER
The screen displays the data directory path:
/D1/STEVE/TEXTFILES/MANUALS
The following commands cause the current data directory
to move up one level in the directory hierarchy and then
display the data directory.
c h d . . ENTER
pwd
ENTER
/D1/STEVE/TEXTFILES
6-76
.s
System Command Descriptions / 6
The following commands change the current data directory
to the parent directory and then display the current data
directory.
c h d . . ENTER
pwd ENTER
/D1 /STEVE
The following command displays the current execution
directory, CMDS.
p x d ENTER
/D0/CMDS
6-77
OS-9 Commands Reference
RENAME
Syntax: rename pathlist filename
Function:
Gives the specified file or directory a new name.
Parameters:
pathlast The current name of the file or directory.
filename The new name.
Notes:
You must have write permission for the file.
Examples:
· To change a file's name from Blue to Purple, type:
rename blue purple
ENTER
· To rename a file in the USER9 directory of Drive /D3, type:
rename /d3/user9/test temp
ENTER
· In the following example, DIR displays the names of the
files in the current data directory. RENAME changes the
filename Animals to Mammals. Another DIR command
shows that RENAME has performed properly.
d i r
ENTER
The screen displays:
Directory of . 16:22:53
myfile animals
rename animals mammals
ENTER
d i r
ENTER
6-78
System Command Descriptions / 6
The screen now shows:
Directory of . 16:23:22
myfile mammals
6-79
OS-9 Commands Reference
SETIME
Syntax: setime
[yylmmldd hh:mm[:ss]]
Function:
Sets the system date and time, and activates the
Parameters:
yy The year in a two-digit format (86 for 1986).
MM
The month in a one or two-digit format (Ol or
1 for January, 12 for December).
dd The day of the month in a one- or two-digit
format, such as 21.
hh
The hour in a one- or two-digit, 24-hour for
mat (15 for 3 p.m.). /'1
mm Minutes in a one- or two-digit format, such as
03, 5, or 55.
ss Seconds in a one- or two-digit format, such as
04, 5, or 25.
Options:
Specifying seconds in the new time entry is optional.
Notes:
You can include the date and time parameters. If you do
not, SETIME asks you for them.
· Numbers are one- or two- decimal digits using the space,
colon, semicolon, or slash as delimiters.
· The CC3go module starts the clock on system startup, so
multitasking is possible without use of the SETIME utility.
6-80
OS-9 Commands Reference
SETIME
AOIN
Syntax: setime
[yylmmldd hh:mm[:ss]]
Function:
Sets the system date and time, and activates the
Parameters:
yy The year in a two-digit format (86 for 1986).
MM
The month in a one or two-digit format (Ol or
1 for January, 12 for December).
dd The day of the month in a one- or two-digit
format, such as 21.
hh
The hour in a one- or two-digit, 24-hour for
mat (15 for 3 p.m.).
MM
Minutes in a one- or two-digit format, such as
03, 5, or 55.
SS
Seconds in a one- or two-digit format, such as
04, 5, or 25.
Options:
Specifying seconds in the new time entry is optional.
Notes:
You can include the date and time parameters. If you do
not, SETIME asks you for them.
· Numbers are one- or two- decimal digits using the space,
colon, semicolon, or slash as delimiters.
The CC3go module starts the clock on system startup, so
multitasking is possible without use of the SETIME utility.
6-80
System Command Descriptions / 6
0
If you do not set the date and time when booting OS-9, the
system cannot accurately update the "Last modified" date
and time for files.
Examples:
· To set the date and time to August 15, 1986, 3:45 p.m.,
type:
5etime 86,08,15,15,45 ENTER
· To set the same date using a slightly different but equally
acceptable format, type:
setime 86/08/15 15/45/00 ENTER
6-81
OS-9 Commands Reference
SETPR
Syntax: setpr procID
number
Function: Changes the CPU priority of a process. The priority
of a process determines the CPU time allotted to it under
multi-tasking conditions.
Parameters:
proclD
The number of the process for which you want
to change the priority.
number
The new priority number.
Notes:
n
· The process priority number is a decimal number in the
range 1 (lowest priority) to 255. If you need information
about the process ID number and current priority, use
PROCS.
· You can use SETPR only on processes that have your user
number.
· SETPR does not appear in the CMDS directory because it
is built into the shell.
· A Super User (User 0) can set any process priorities.
Examples:
0
To set or change the priority of Process 8 to 250, type:
setpr 8 250 ENTER
6-82
.3
OS-9 Commands Reference
SHELL
Syntax: shell arglist
Function: The shell is OS-9's command interpreter program. It
reads data from its standard input path (the keyboard) or
redirected data from a file. It interprets the data as a
sequence of commands. The function of the shell is to initiate
and control execution of other OS-9 programs.
Parameters:
arglist
The commands, parameters, and options given
SHELL in a command line.
Notes:
· The shell reads and interprets one text line at a time from
the standard input path until it reaches an end-of-file
marker. At that time it terminates itself.
· When another program calls the shell, a special case occurs
in which the shell takes the argument list as its first line
of input. If this command line consists of
built-in
com
mands only, the shell reads and processes more lines. Oth
erwise, control returns to the calling program after the
shell processes the single command line.
· When operating from the shell, you do not need to specify
the SHELL command to execute a program, a command, or
a built-in shell function. Using SHELL before a command
causes the existing shell to fork an additional shell, which
then forks the specified process, such as:
she 1 1 d i r e ENTER
Issuing a command without SHELL causes the existing
shell to fork the specified process, such as:
d i r e ENTER
6-84
System Command Descriptions l 6
The following two commands also have identical effects:
shell x ENTER
x ENTER
The shell command separators are:
Sequential execution separator
& Concurrent execution separator
! Pipeline separator
ENTER
end-of-line (sequential execution separator)
The Shell command modifiers are:
< Redirect standard input
> Redirect standard output
> > Redirect standard error output
< > Redirects standard input to standard output
- <» Redirects standard input to standard error
output
»> Redirects standard output to standard error
output
#n
Set the process memory size in pages
#nK
Set the program memory size in 1 kilobyte units.
9
The following Shell command parameters tell OS-9 to:
chd pathlist Change the data directory
kill
procID
Send the termination signal to
process
setpr
procID
Change the specified process
number
priority
chx pathlist Change the execution directory
i = deoicename
Create an immortal process
w Wait for any process to die
6-85
.3
OS-9 Commands Reference
p Turn on prompting
-p Turn off prompting
t Echo input lines to standard output
-t Not echo input lines
-x Not terminate on an error
x Terminate on error
* Not process the following text
0
See Chapter 3 for more information on the operation of the
shell.
111"1
6-86
System Command Descriptions / 6
TMODE
Syntax: tmode [pathnum] [paramlist] [...]
Function: Displays or changes the initialization parameters of
the terminal. TMODE automatically adjusts its output for 32
or 80-column displays.
Common uses include changing baud rates and control key
definitions.
Parameters:
pathnum
One of the standard path numbers:
.0 = standard input path
.1 = standard output path
.2 = standard error output path
paramlist
One of the following options.
Options:
UPC
Displays uppercase characters only. Lowercase
characters automatically convert to uppercase.
-UPC
Displays both upper- and lowercase characters.
bsb Causes a backspace to erase characters. Back
space characters echo as a backspace-space
backspace sequence. This setting is the system
default.
-bsb Causes backspace not to erase. Only a single
backspace echoes.
Enables
backspace over a line.
Deletes lines by
sending backspace-space-backspace sequences
to erase a line (for video terminals). This set
ting is the system default.
6-87
14
OS-9 Commands Reference
-bsl Disables
backspace over a line. To
delete a line,
TMODE prints a
new line
sequence (for hard
copy terminals).
echo Input characters
echo
on the terminal. This
setting is the system default.
-echo Turns off the echo default.
if Turns on the auto line feed function. Line
feeds automatically echo to the terminal on
input and output carriage returns. The auto
line feed setting is the system default.
-if Turns off the auto line feed default.
pause Turns on the screen pause. This setting sus
pends output when the screen fills. See the
pag
parameter for a definition of screen size.
Resume output by pressing the space bar. This
setting is the system default.
-pause Turns off the screen pause mode.
null
= n
Sets the null count-the number of null ($00)
characters transmitted after carriage returns
for the return delay. The value
n is
in decimal.
The default is 0.
pag
= n
Sets the length of the video display page to
n
(decimal) lines. This setting affects the
pause
mode.
bsp
= h
Sets the backspace character for input. The
value
h is
in hexadecimal. The default is 08.
bse
= h
Sets the backspace character for output. The
value
h is
in hexadecimal. The default is 08.
del
= h
Sets the delete line character for input. The
value
h is
in hexadecimal. The default is 18.
bell
= h
Sets the bell (alert) character for output. The
value
h is
in hexadecimal. The default is 07.
eor
= h
Sets the end-of-record (carriage return) char
acter for input. This setting requires a value
in hexadecimal. The default is OD.
6-88
System Command Descriptions / 6
eof=h Sets the end-of-file character for input. The
value h is in hexadecimal. The default is 1B.
type = h For external devices, use type for ACIA (asyn-
chronous communications interface adapter)
initialization values (hexadecimal). The
default is 00. Bits 5-7 set either MARK,
SPACE, or no parity on all devices. Codes for
these are:
000 = no parity
101 = MARK parity transmitted, no
checking
111 = SPACE parity transmitted, no
checking
011 = even parity (available only with
the external ACIA pak and Mod
pak devices)
001 = odd parity (available only with
the external ACIA pak and Mod
pak devices)
Bit 4 selects auto-answer modem support fea
See "Technical Information for the RS232
Port" in Chapter 5 for more information.
For TERM-VDG, the type byte has a different
Bit 0 specifies a machine with true low
ercase capability. Set Bit 0 to turn on
/-` For TERM-WIN, use a value of 80 to specify a
window device.
reprint = h Sets the reprint line character. The value h is
in hexadecimal.
6-89
System Command Descriptions / 6
Notes:
You can specify any number of parameters from the options
list, separating them by spaces or commas. If you don't
specify parameters, TMODE displays the current values of
You can use a period and a number to specify the pathnum
ber on which to read or set options. If you don't specify a
path, TMODE affects the standard input path.
TMODE works only if a path to the file/device is open. Use
XMODE to alter device descriptors and set device initial
TMODE can also alter the baud rate, word length, stop
bits, and parity for devices already initialized.
If you use TMODE in a procedure file, you must specify one
of the standard output paths (.1 or .2). This procedure is
necessary, because the command redirects the SHELL's
standard input path to come from a disk file. (You can use
TMODE only on SCFMAN-type devices.) For example, to
set lines per page for standard output, use this line:
TMODE .1 pag=24 ENTER
Examples:
The following command line sets the terminal to display
upper- and lowercase, sets the null count to 4, and turns on
the screen pause function.
tmode -upc if null=4 pause ENTER
The next command sets the screen page length (number of
lines) to 24, turns on the screen pause function and the
backspace-over-line function, and sets the backspace charac
tmode pa9=24 pause bsl -echo bsp=8 ENTER
6-81
.I
OS-9 Commands Reference
TUNEPORT
Syntax: tuneport
[device] [-s = value]
Function: Lets you test and set delay loop values for the cur
rent baud rate and select the best value for your printer or
terminal.
Parameters:
device
The device you want to test, either your
printer (/p) or terminal (/tl).
value A new delay loop value.
Options:
n
-S=
Sets a new delay loop value.
Examples:
0
The following command provides a test operation for your
printer.
tuneport /P
ENTER
After a short delay, TUNEPORT displays the current baud
rate and sends data to the printer to see if it is working
properly. The program then displays the current delay value
and asks for a new value. Enter a decimal delay value and
press
ENTER
. Again, TUNEPORT sends data to the printer
as a test. Continue this process until you find the best
value. When you are satisfied, press
ENTER
instead of enter
ing a value at the prompt. A closing message displays your
Use the same process to set a new delay loop value for the
6-92
System Command Descriptions / 6
The following command line sets the delay loop value for
your printer to 255.
tuneport /P -s=225 ENTER
Use such a command on future system boots to set the opti
mum delay value determined with the TUNEPORT test
function. Then, using OS9GEN or COBBLER, generate a
new boot file for your system diskette. You can also use the
-s option with TUNEPORT in your system Startup file to
set the value.
6-93
OS-9 Commands Reference
UNLINK
Syntax: unlink
modname [...]
Function: Tells OS-9 that the named memory module(s) is no
longer needed by the user.
Parameters:
modname
One or more modules you want to unlink.
Options:
In one command line, you can specify as many modules as you
want to unlink.
Notes:
· Whether OS-9 destroys the modules and reassigns their
memory depends on whether the module is in use by other
processes. Each process using a module increases its link
count by one. Each UNLINK you issue decreases its link
count by 1. When the link-count reaches 0, OS-9 deallo
· You should unlink modules whenever possible to make most
efficient use of available memory resources. Modules you
have loaded and linked might need to be unlinked twice to
6-94
System Command Descriptions / 6
0
Warning: Never attempt to unlink a module you didn't load
or link, and never unlink a module that is in use by pro
grams (displayed by the PROCS command).
Examples:
· To unlink three modules named Pgml, Pgm5, and Pgm99,
type:
unlink p9ml p9mS p9m99
ENTER
· In the following command sequence, MDIR first displays
the modules in memory. The next command unlinks the
edit module. The output of the final command (MDIR)
shows that UNLINK is successful-Edit no longer appears
on the list.
and i r ENTER
A possible screen display is:
Module Directory at 00:01:08
REL Boot OS9P1 OS9p2 Init
IOMan RBF CC3Disk D0 D1
DD SCF CC310 VDGInt GrfInt
TERM W W1 W2 W3
W4 WS W6 W7 ACIAPAK
T2 PRINTER P PipeMan Piper
Pipe Clock CC3Go CC3HDiak H0
Shell Copy Date DEIniz Del
Dir Display Echo Iniz Link
List Load MDir Merge Mfree
Procs Rename Setime Tmode Unlink
Ba5ic09 GrfDrv Edit
unlink edit
ENTER
m
d i r ENTER
6-95
.r
OS-9 Commands Reference
The new screen display is:
Module Directory at 00:03:15
REL Hoot 0S9P1 OS9p2 Init
IOMan RHF CC3Disk D0 D1
DD SCF CC310 VDGInt GrfInt
TERM W W1 W2 W3
W4 W5 W6 W7 ACIAPAK
T2 PRINTER P PipeMan Piper
Pipe Clock CC3Go CC3HDisk H0
Shell Copy Date DEIniz Del
Dir Display Echo Iniz Link
List Load MDir Merge Mfree
Procs Rename Setime Tmode Unlink
Basic09 GrfDrv
6-96
System Command Descriptions / 6
WCREATE
Syntax: wcreate lwpath -s=type xpos ypos xsize
ysize foreground background [border]
Function:
Initializes and creates a window.
Parameters:
lwpath The window device name of the window you
are creating (W, Wl, W2, W3, and so on).
xpos The x co-ordinate (in decimal) for the starting
position of the upper left corner of the screen.
ypos The y co-ordinate (in decimal) for the starting
position of the upper left corner of the screen.
xsize The horizontal size of the screen in columns,
in the range 1 to 80 (in decimal).
ysize The vertical size of the screen in lines, in the
range 1 to 24 (in decimal).
foreground The window foreground color.
background The window background color.
border An optional window border color. The default
is black.
Options:
-s=type The screen type, chosen from the following
list:
,,.1
Type Description
1 = 40-column hardware text screen
2 = 80-column hardware text screen
S ,b; = 640 x 192 two-color screen
G X
= 320 x 192 four-color screen
7
X
= 640 x 192 four-color screen
9X=
320 x 192 sixteen-color screen
6-97
OS-9 Commands Reference
If you use the -s =type option, you must spec
ify a border color in the command line.
-z Directs WCREATE to accept input from the
standard input (redirected from a file).
-?
Produces a help message for the command.
Examples:
· To create a full screen, 80-column text window on /wl,
type:
wcreate /w1 -s=2 0 0 80 24 7 4 1
ENTER
· To create two windows (/w2 and /w3) on a 640 x 192 graph
ics screen in which /w2 is the upper left of the display and
/w3 is the right half of the display, first use build to create
an input file:
build wfile
ENTER
? /w2 -5=07 0 0 40 12 7 4 1
ENTER
? /w3 40 0 40 24 4 7
ENTER
? ENTER
Then, create the windows using Wfile as input:
wcreate -z < wfile
ENTER
1
6-98
rt
System Command Descriptions / 6
You can use the -z option to create windows in your system
startup file. For example, the following startup file sets up
several windows, along with the usual SETIME.
t
· lock the shell in memory and set the time
· link shell
setime < /1
· create the new windows
wcreate -z
· set up an 80-column full window for /w1
/w1 -s=2 0 0 80 24 7 4 1
· set up a 40 column full window for /w2
/w2 -s=1 0 0 40 24 7 4 1
· set up /w3 and /w4 as halves of a
·640 x 192 display
/w3 -s+7 0 0 40 24 7 4 1
/w4 40 0 40 24 4 7
· the following blank line terminates input
· from wcreate
· get the graphics fonts loaded
merge sys/stdfonts > /w1
Now, when the system boots, it has four windows defined,
besides TERM. As shown, you can use an asterisk as the
first character on a line in order to allow comments in the
file.
6-99
OS-9 Commands Reference
XMODE
Syntax: xmode
devname [paramlist]
Function: Displays or changes the initialization parameters of
any SCF-type device such as the video display, printer,
RS-232 port, and others. XMODE automatically adjusts its
output for 32- or 80-column displays.
Common uses include changing baud rates and control key
definitions.
Parameters:
pathnum
The device name to change, such as /term,
/w7, /t2, and so on.
paramlast
One of the following options.
Options: _
UPC
Displays uppercase characters only. Lowercase
characters automatically convert to uppercase.
-UPC
Displays both upper- and lowercase characters.
bsb Causes a backspace to erase characters. Back
space characters echo as a backspace-space
backspace sequence. This setting is the system
default.
Causes backspace not to erase. Only a single
backspace echoes.
bsl Enables
backspace over a line.
Deletes lines by
sending backspace-space-backspace sequences
to erase a line (for video terminals). This set
ting is the system default.
-bsl Disables
backspace over a line. To
delete a line,
you must print a
new line
sequence (for hard
copy terminals).
6-100
System Command Descriptions / 6
echo Input characters
echo
on the terminal. This
setting is the system default.
-echo Turns off the echo default.
if Turns on the auto line feed function. Line
feeds automatically echo to the terminal on
input, and they output carriage returns. The
auto line feed setting is the system default.
-if Turns off the auto line feed default.
pause Turns on the screen pause. This setting sus
pends output when the screen fills. See the
pag parameter for a definition of screen size.
Resume output by pressing the space bar. This
setting is the system default.
-pause Turns off the screen pause mode.
null = n
Sets the null count-the number of null ($00)
characters transmitted after carriage returns
for the return delay. The value
n
is in decimal.
The default is 0.
pag = n Sets the length of the video display page to
n
(decimal) lines. This setting affects the
pause
mode.
bsp = h Sets the backspace character for input. The
value
h
is in hexadecimal. The default is 08.
bse = h Sets the backspace character for output. The
value
h
is in hexadecimal. The default is 08.
del = h Sets the delete line character for input. The
value h is in hexadecimal. The default is 18.
bell = h Sets the bell (alert) character for output. The
value h is in hexadecimal. The default is 07.
eor = h Sets the end-of-record (carriage return) char
acter for input. This setting requires a value
in hexadecimal. The default is OD.
eof=h Sets the end-of-file character for input. The
value h is in hexadecimal. The default is 1B.
6-101
OS-9 Commands Reference
type
= h
Fbr external devices, use type for ACIA (asyn-
chronous communications interface adapter)
initialization values (hexadecimal). The
default is 00. Bits 5-7 set either MARK,
SPACE, or no parity on all devices. Codes for
these are:
000 = no parity
101 = MARK parity transmitted, no
checking
111 = SPACE parity transmitted, no
checking
011 = even parity (available only with
the external ACIA pak and Mod
pak devices)
001 = odd parity (available only with
the external ACIA pak and Mod
pak devices)
Bit 4 selects auto-answer modem support fea
1 = on
0 = off
See "Technical Information for the RS232
Port" in Chapter 5 for more information.
For TERM-VDG, the type byte has a different
Bit 0 specifies a machine with true low
ercase capability. Set Bit 0 to turn on
For TERM-WIN, use a value of 80 to specify a
reprint
= h
Sets the reprint line character. The value
h is
in hexadecimal.
dup
= h
Sets the character to duplicate the last input
line. The value
h
is in hexadecimal. The
default is 01.
6-102
.a
System Command Descriptions / 6
psc = h
Sets the pause character. The value of the
character is in hexadecimal. The default is 17.
abort
= h
Sets the terminate character (normally CON
` TROL C). The value of the character is in
hexadecimal.
quit
= h
Sets the quit character (normally CONTROL
E). The value of the character is in
hexadecimal.
baud
= h
Sets the baud rate, word length, and stop bits
for a software-controllable interface. The codes
for the baud rate are:
0 =110 3 =1200 6 = 9600
1= 300 4 = 2400 7 =19200 (ACIAPAK only)
3 = 600 5 = 4800 7 = 32000 (SIO only)
Bits 0-3 determine the baud rate
Bit 4 is reserved for future use
Bits 5-6 determine the word length:
00 = 8 bits
01 = 7 bits
Bit 7 determines the number of stop bits:
0 = 1 stop bit
1 = 2 stop bits.
See "Technical Information for the RS232
Port" in Chapter 5 for further information.
Notes:
· XMODE is similar to TMODE, but there are differences.
TMODE operates only on open paths, so its effect is tempo
rary. XMODE updates the device descriptor. Its change per
sists as long as the computer is running, even if you or the
system repeatedly open and close the paths to the device.
· If you use XMODE to change parameters and the COB
BLER program to make a new system diskette or to re
make the boot tracks on the current system diskette, the
process permanently changes the parameters on the new
6-103
.E
OS-9 Commands Reference
0
XMODE requires that you specify a device name. If you do
not specify parameters, XMODE displays the present value
for each parameter. You can use any number of parameters, r-~,
separating them with spaces or commas.
Examples:
The following command sets the term (video) for upper- and
lowercase, the null count to 4, the backspace character
value to 1F hexadecimal, and turns on the screen pause
xmode /term -upc if bse=1F pause ENTER
1
6-104
.s