Utils C Ultra PDF
Utils C Ultra PDF
Revision J
Disclaimer
The information contained herein is believed to be accurate as of the date of publication.
However, Microware will not be liable for any damages including indirect or consequential,
from use of the OS-9 operating system, Microware-provided software, or reliance on the
accuracy of this documentation. The information contained herein is subject to change
without notice.
Reproduction Notice
The software described in this document is intended to be used on a single computer
system. Microware expressly prohibits any reproduction of the software on tape, disk, or
any other medium except for backup purposes. Distribution of this software, in part or
whole, to any other party or on any other system may constitute copyright infringements
and misappropriation of trade secrets and confidential processes which are the property of
Microware and/or other parties. Unauthorized distribution of software may cause damages
far in excess of the value of the copies involved.
For additional copies of this software/documentation, or if you have questions concerning
the above notice, please contact your OS-9 supplier.
Trademarks
OS-9, OS-9000, DAVID, and MAUI are registered trademarks of Microware Systems
Corporation. SoftStax, FasTrak, UpLink, and Hawk are trademarks of Microware Systems
Corporation. All other product names referenced herein are either trademarks or
registered trademarks of their respective owners.
Address
Microware Systems Corporation
1500 N.W. 118th Street
Des Moines, Iowa 50325
515-223-8000
2 Utilities Reference
Ta bl e of C onte n ts
Chapter 1: Utilities 11
Utilities Reference 3
Chapter 3: Using the editmod Utility 419
4 Utilities Reference
Chapter 4: Using the os9make Utility 467
Utilities Reference 5
509 Variable Substitution Modifiers
511 Procedure File Line Concatenation
512 Procedure File Debugging Facilities
514 Built-in Commands
514 profile Command
515 UNIX-like Data Directory Commands
517 prenv Built-in Command
517 set Command
518 which Command
519 mshell Command Line Options
524 Parameter Passing among mshells
525 Invoking the Initialization File
527 Prompt Format String
531 Non-blocking Readln
532 mshell Directives
534 Operators
534 Variables
535 Functions
536 Constants
539 Directive Descriptions
560 mshell Functions
568 Example Programs
6 Utilities Reference
587 Command Line Execution
589 Example Command Lines
Utilities Reference 7
611 Saving Files
611 Execute Operating System Commands
612 uMACS Editing Modes
614 Add or Delete a Mode
616 Exit uMACS
617 The uMACS Command Set
619 Cursor Positioning Commands
620 Next or Previous Word, Line, or Paragraph
621 Next or Previous Page
621 Go To Beginning or End of Line/File
621 Go to a Specified Line
622 Insert Text
623 Insert a Non-Printable Character
624 New Lines
624 Insert a Tab
624 Insert a File
625 Delete Text
626 The Kill Buffer
626 Delete Word/Blank Lines
627 Place a Region of Text Into the Kill Buffer
627 Insert Kill Buffer Contents
628 Search and Replace
629 Search Forward and Backward
630 Replace
632 Region Commands
633 Mark Region Boundaries
633 Copy or Move a Region
633 Paste
634 Change a Region’s Character Case
635 Format Commands
635 Change Character Case
636 Reformat Paragraph Margins
637 Transpose Characters
638 Buffer Commands
8 Utilities Reference
639 Display Current Buffers
639 Change Buffer or File Name
640 Edit a Buffer
641 Open a New Buffer
641 Switch Buffers
642 Buffer Position
642 Delete Buffer
643 Execute Buffer
644 Window Commands
645 Open Additional Windows
645 Move to the Next or Previous Window
646 Scroll Text
646 Change Window Size
646 Delete All But Current Window
647 Termcap File Format
648 The Termcap File
649 Terminal Capabilities
650 Special Characters
651 Termcap Capabilities
651 Cursor Addressing
652 Example Notations
653 Example Termcap Entries
654 uMACS Command Summary
Glossary 663
Index 665
Utilities Reference 9
10 Utilities Reference
C ha pte r 1 : U t il iti es
For quick reference purposes, the format of the utility information has
been standardized. Each utility contains the following headings and
corresponding information, if applicable:
• Command syntax
• Operating System (OS)
• Command options
• Description of the utility
• Examples
• References to related utilities
• Special uses
Syntax identifies the rules governing the structure of the utility
command line.
• Syntax specified in the command section does not include the shell
built-in options (e.g., alternate memory size, I/O redirection, piping,
etc.). The shell filters these options out from the command line
before processing the program being called.
OS identifies Microware operating systems with which the utility is
packaged and other operating systems on which the utility is functional.
Some utilities function under other operating systems in addition to
OS-9 and OS-9 for 68K.
11
1 Utilities
Note
Some path names and code examples may refer to OS-9000. These
references pertain to the OS-9 (non-68K) operating system.
12 Utilities Reference
Utilities
1
Formal Syntax Notation
Each command section includes a syntactical description of the
command line. These symbolic descriptions use the following notations:
[ ] = Enclosed items are optional.
{ } = Enclosed items may be used 0, 1, or multiple times.
< > = Enclosed item is a description of the parameter to use.
For example:
<path> = A legal path list
<devname> = A legal device name
<modname> = A legal memory module name
<procID> = A process number
<opts> = One or more options specified in the command
description
<arglist> = A list of parameters
<text> = A character string ended by end-of-line
<num> = A decimal number, unless otherwise specified
<file> = An existing file
<string> = An alphanumeric string of ASCII characters
Utilities Reference 13
1 Utilities
Syntax
activ {<procID>}
OS
OS-9
Description
The activ utility activates processes that were stopped by the
suspend utility.
Type activ and the process ID of the process to activate a process.
The process ID can be obtained by using the procs utility. Suspended
processes are identified with a z in the state status.
Note
Only super users may use this utility.
Example
$ procs -e
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 30.75k 0 w 0.04 0:10 tsmon <>>>term
3 5 0.0 128 11.00k 0 z 7.00 0:01 eatmpu <>>>term
4 0 0.0 128 30.75k 0 s 0.04 0:10 tsmon <>>>t3
5 2 0.0 128 9.00k 0 w 3.09 0:10 shell <>>>term
6 5 0.0 128 35.25k 0 * 0.07 0:00 procs <>>term >dd
$ activ 3
$ procs -e
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 30.75k 0 w 0.04 0:10 tsmon <>>>term
3 5 0.0 128 11.00k 0 a 13.73 0:01 eatmpu <>>>term
4 0 0.0 128 30.75k 0 s 0.04 0:10 tsmon <>>>t3
5 2 0.0 128 9.00k 0 w 3.46 0:10 shell <>>>term
6 5 0.0 128 35.25k 0 * 0.05 0:00 procs <>>term >dd
14 Utilities Reference
Utilities
1
See Also
suspend
Utilities Reference 15
1 Utilities
Syntax
alias <alias name> <actual name>
OS
OS-9
Options
-d Deletes the specified alias name.
-l Prints the current list of aliases. -l must
be used alone.
-z Gets list of aliases from standard input.
Cannot be used with -d.
Lists one pair per line in the form:
<devname> <pathlist>
-z[=]<file> Gets list of aliases from <file>. Cannot
be used with -d.
Description
The alias utility assigns an alternate name to a device pathlist.
Pathlist aliases allow you to refer to specific device pathlists with shorter
or more convenient names.
Type alias, the alternate (alias) name, and the actual pathlist to assign
an alternate name to a pathlist. IOMAN expands all alias references into
their associated pathlist name.
Note
The <actual name> must exist. OS-9 does not verify the existence of
<actual name>.
16 Utilities Reference
Utilities
1
Note
A real device name as <alias name> is discouraged.
Example
$ dir /h1
Error #000:221
$ alias /h1 /n0/tony/h0
$ dir /h1
Directory of /h1 16:00:55
CMDS DEFS LIB SYS USR
SysBoot startup
$
Utilities Reference 17
1 Utilities
Syntax
assign [<name> <definition>]
OS
OS-9
Options
The assign utility only has zero or two arguments.
Description
The assign utility equates a single word to a string for command line
substitution.
The substitution occurs when <name> appears as the command to
execute.
Not all occurrences of <name> in the command line are replaced. Only
in those occurrences where <name> is a command to be executed is
the <name> replaced.
Note
This command does not appear in the CMDS directory as it is a built-in
shell command.
Example
$ assign ls dir Changes ls to dir
$ assign cd chd Changes cd to chd
$ assign Changes ls to dir and cd to chd
cd chd
ls dir
18 Utilities Reference
Utilities
1
attr Changes/Examines File Security Attributes
Syntax
attr [<opts>] {<path>} {<permissions>}
OS
OS-9; OS-9 for 68K
Options
-a Suppresses the printing of attributes. In
OS-9, suppresses the warning that
appears if group attributes are specified.
-q Quiet mode suppresses “can’t open” file
error messages.
-x Searches for the specified files in the
execution directory. The files must have
execute permission to be found using
-x.
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The attr utility examines or changes the security attributes
(<permissions>) of the specified files.
Type attr, followed by the pathlist for the files whose security
permissions you want to change or examine. Then, enter a list of
permissions to turn on or off.
Permission is granted by specifying the permission code preceded by a
hyphen (-).
Permission is withdrawn by specifying the permission code preceded by
a hyphen and an n (-n).
Utilities Reference 19
1 Utilities
See Also
deldir
makdir
Examples
$ attr myfile Displays the current attributes of
myfile.
$ attr myfile -npr -npw
Withdraws public read and public write
permissions.
$ attr myfile -rweprpwpe
Grants both the public and the owner
read, write, and execute permissions.
$ attr -z Displays the attributes of the file names
read from standard input.
$ attr -z=file1 Displays the attributes of the file names
read from file1.
$ attr -npwpr * Withdraws public write and grant public
read for all files in the directory.
$ attr *.lp Lists the attributes of all files with names
ending in .lp.
20 Utilities Reference
Utilities
1
Table 1-1 Permission Codes
OS-9
for 68K OS-9 OS-9
Files Files Directory Specification
d d d Directory file
Utilities Reference 21
1 Utilities
Note
On OS-9 for 68K, the owner is the creator of the file. Owner access is
given to any user with the same group ID number as the owner. The
public is any user with a different group ID number than the owner. You
can determine file ownership with the dir -e command.
22 Utilities Reference
Utilities
1
backup Makes a Backup Copy of Disk
Syntax
backup [<opts>] [<srcpath> [<destpath>]]
OS
OS-9; OS-9 for 68K
Options
-b[=]<num> Allocates <num> k bytes of memory for
use by the backup buffer. backup uses
a 4K buffer by default. The greater the
allocation of memory, the faster backup
runs.
-r Causes backup to continue upon
occurrence of a read error.
-v Prevents backup from making a
verification pass.
Description
The backup utility physically copies all data from one device to
another.
A physical copy is performed sector by sector without regard to file
structures. In most cases, the specified devices must have the same
format and must be devoid of defective sectors.
Note
When an OS-9 bootable floppy is copied using backup, you also need
to use the bootgen utility to make the target floppy bootable.
Utilities Reference 23
1 Utilities
Note
This backup utility does not work with PCF.
! WARNING
Before backing up a disk, you should write protect the source disk with
the appropriate write protect mechanism to prevent accidentally
confusing the source disk and the destination disk during exchanges.
24 Utilities Reference
Utilities
1
Two Drive Backup
On a two drive system, device names /d0 and /d1 are assumed if both
device names are omitted on the command line. If the second device
name is omitted, a single unit backup is performed on the drive
specified.
To begin the backup procedure, put the source disk in the source drive
and the destination disk in the destination drive. By default, the source
drive is /d0 and the destination drive is /d1. Enter backup, the name
of the source drive, and the name of the destination drive. The system
asks if you are ready to backup. Enter y if you are ready. If errors do not
occur, the backup procedure is complete.
Errors
The backup procedure includes two passes by default. The first pass
reads a portion of the source disk into a buffer in memory and then
writes it to the destination disk. The second pass verifies that the data
was copied correctly.
If errors occur on the first pass, the source disk or source drive is at
fault.
If errors occur in the second pass, the destination disk is at fault. If
backup fails repeatedly on the second pass, reformat the destination
disk and retry the backup.
Examples
$ backup /D2 /D3 Backs up the disk in /d2 to the disk in
/d3.
$ backup -v Backs up the disk in /d0 to the disk in
/d1 without making a verification pass.
$ backup -b40 /d0 /d2 Allocates 40K of memory to use in
backing up /d0 to /d2.
Utilities Reference 25
1 Utilities
Syntax
bfed [<opts>] <path> [<opts>]
OS
OS-9; OS-9 for 68K
Options
-s[=]<num> Reads the block number specified.
-v Opens <path> in view mode.
Description
The bfed utility, a screen-oriented binary file editor, enables editing of
files and disks in binary sector format and moving sectors around on a
disk. The bfed utility also allows the user to copy sectors from one disk
to another to help in recovering accidentally deleted files.
The bfed utility operations are oriented to the disk sector buffer which
is always displayed and may be filled with data from a file or written to a
file. The buffer may also be edited by hand at any time for complete
control of the data in a file.
Typically, you might type bfed myfile on the command line. The
bfed utility would then open myfile and display the first sector.
Alternatively, you can type bfed without any command line arguments
and use the c or o commands to create or open, respectively, an edit
file. The contents of the current buffered sector are then examined or
modified and then optionally written out to the file.
The bfed utility allows two edit files to be open at a time. You may
display one or the other using the a command. You may also move
sectors from one edit file to another using the m command.
26 Utilities Reference
Utilities
1
One of the bfed utility’s more useful capabilities is its ability to recover
a deleted file by writing the "deleted" sectors to a recovery file. It is
important that the recovery file be on a different mass storage device
than the deleted file to ensure that the sectors of the deleted file are not
overwritten.
To recover a deleted file, open the recovery file using the c (create edit
file) command. Use the m command to copy sectors to the new file.
Another feature of the bfed utility is the distinction between the buffer
sector and the current sector. If the buffer's current contents were read
from the edit file, the buffer sector is the location in the file from which
the data came. The current sector, which is independent, is the current
position in the edit file for reading or writing. Thus, it is possible to read
a sector from one location in a file and to copy it to another location.
All numbers that the bfed utility asks for are assumed to be
hexadecimal; however, by using a leading # in the number, the bfed
utility interprets the number as decimal. To enter 100 in decimal, type
#100.
The following commands are available for the bfed utility. Please note
that all values are given in hexadecimal.
Command Description
Utilities Reference 27
1 Utilities
Command Description
e Ends the edit session for the current active file; that is,
it closes the active file. If the buffer has been
modified, the bfed utility displays a prompt asking if
you want to continue. When answering in the
affirmative, the buffer is not discarded but may not be
written unless another edit file is opened.
m<1st Moves sectors from the active edit file to the other edit
sector> file. You may specify the start point and number of
<count> sectors from the source (active) file, but the copy uses
the current sector in the target as the starting location.
When an error is encountered, you are prompted
about continuing. If you continue, garbage is written in
the target where the error occurred.
28 Utilities Reference
Utilities
1
Table 1-2 bfed Commands (continued)
Command Description
p<sector> Picks and reads a new sector from the active edit file.
You are allowed to select a sector that is beyond the
end of file.
z Sets the file size of the edit file. The size change is
immediate.
Utilities Reference 29
1 Utilities
Command Description
The bfed utility has a feature enabling editing of a sector on the screen
in either hexadecimal or ASCII. From the command line, the <tab>
command positions the cursor into the hexadecimal display on the
screen. Entering hex values replaces the existing ones in the buffer.
Changes must be saved by writing to the disk with the w command.
In edit mode, the <tab> key toggles between hexadecimal and ASCII
edit modes. In ASCII edit mode, typed characters are placed in the
buffer. Note that changes in either edit mode, hexadecimal or ASCII,
causes an update of both hexadecimal and ASCII displays to new
values. Cursor control in screen edit mode uses the following
keystrokes for up, left, right, and down movements respectively:
^P = Up
^B = Left
^F = Right
^N = Down
When in either hexadecimal or ASCII edit mode, return to the command
mode is accomplished by pressing the <tab> key. Use the \ key as an
escape character in ASCII mode, thus allowing the entry of control keys
into the buffer. For example, to enter the value <tab> into the buffer in
ASCII mode, type \ then <tab>. The ^P, ^B, ^F, ^N, and <tab>
characters are entered in this manner.
30 Utilities Reference
Utilities
1
Another useful feature is the ability to enter a decimal number in
hexadecimal edit mode. Upon pressing #, a prompt is displayed for
entry of a decimal number in the form n.b where n is the decimal
number and s is the size of b for byte, w for word, or l for long. If size is
not specified, the default is byte. It is not necessary to use a leading 0 to
specify a decimal number.
Entering data at the end of the sector in edit mode causes display of the
following prompt:
Do you wish to write the current sector and continue
to the next?
Entering data at the end of the sector will work in either hexadecimal or
ASCII edit modes.
Utilities Reference 31
1 Utilities
Syntax
binex {<option(s)>) [<inpath>] [<outpath>] [<opts>]
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-a[=]<hex> Specifies the load address in hex.
-b[=]<value>[k] Specifies the conversion buffer size to
use. The ‘k’ sub-option converts
<value> to k bytes.
-s[=]<num> Specifies which type of S-record format
binex is to generate. Default is 1.
-x Gets file from the execution directory.
(OS-9 and OS-9 for 68K only)
-z[[=]<file>] Reads the command line arguments and
options from <file>. Default is stdin.
Description
The binex utility converts binary files to S-record files.
S-record files are a type of text file containing records that represent
binary data in ASCII hexadecimal form. This Motorola-standard format
is used by many commercial PROM programmers, emulators, logic
analyzers, and similar devices that use the RS-232 interface. It can be
useful for transmitting files over data links that can only handle
character type data. It can also be used for converting assembler or
compiler generated programs to load on non-OS-9 systems.
The binex utility converts the binary file specified by <path1> to a
new file with S-record format. The new file is specified by <path2>.
S-records have a header record to store the program name for
32 Utilities Reference
Utilities
1
informational purposes and each data record has an absolute memory
address. This absolute memory address is meaningless to the
operating systems because they use position-independent code.
Record Description
Examples
The following example downloads a program to T1. This type of
command downloads programs to devices such as PROM
programmers.
$ binex scanner.S1 >/T1
The next example generates prog.S1 in S1 format from the binary file,
prog.
$ binex -s1 prog prog.S1
Utilities Reference 33
1 Utilities
See Also
exbin
34 Utilities Reference
Utilities
1
bootgen Builds and Links a Bootstrap File
Syntax
bootgen [<opts>] <devname> {<path>}
OS
OS-9
Options
-b[=]<num> Assigns <num> k bytes of memory for
bootgen. Default memory size is 4k.
-e Uses type 41 partition.
-e1 Allows the placing of type 41 boots on
systems that support booting from type
41 partitions.
-i[=]<file> Sets the logical block offset to 0 for a
specified device and then writes the
specified file to block 0 of that device.
This option is only valid on PCAT
versions.
-l[=]<file> Makes a “low level boot” using <file>.
The name of the generated boot file is
firstboot.
-n Installs new bootstrap files. This option
does not save the old bootstrap files.
-q Sets block zero pointing to <path>.
(Quick Boot)
-x Searches the execution directory for
pathlists.
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Utilities Reference 35
1 Utilities
Description
The bootgen utility creates and links the sysboot file required on any
disk from which OS-9 is to be bootstrapped. The bootgen utility makes
a copy of an existing boot file, adds modules to an existing boot file or
creates an entirely new boot file for a different system. These are just a
few examples.
Type bootgen and the name of the device on which the sysboot file is
to be installed. If a sysboot file already exists on the target device, it is
renamed. The sysboot file is copied onto the target device. The File
Descriptor’s starting address is linked in the disk’s Identification Block
(LSN 0) for use by the OS-9 bootstrap firmware.
If the -z option is used, the bootgen utility first uses the files specified
on the command line and then the file names from its standard input, or
from the specified pathlist, one pathlist per line. If the names are
entered manually, no prompts are given and the end-of-file key (usually
<escape>) or a blank line is entered after the line containing the last
pathlist. Files included with the -z option can contain comment lines.
Comment lines are lines starting with an asterisk (*).
To determine what modules are necessary for your boot file, use ident
with the sysboot file that came with your system.
The -el option allows placing type 41 boots on systems that support
booting on type 41 partitions. PowerPC PrepSpec includes the ability of
systems conforming to the standard to boot devices with type 41
partitions. The fdisk utility must be used to set up the partition as type
41. Once the disk is formatted, a type 41 boot may be placed on the
disk.
$ chd /h0/MWOS/OS9000/603/PORTS/MVME1603/CMDS/BOOTOBJS/ROM
$ bootgen -el=/hs01fmt coreboot -b400
• PCAT:
Place PCAT specific IPL on system.
chd /h0/MWOS/OS9000/80386/PORTS/PCAT/CMDS/BOOTOBJS/IPL
bootgen -i=iplhd /hs01fmt
Place first boot on system.
chd /h0/MWOS/OS9000/80386/PORTS/PCAT/CMDS/BOOTOBJS/ROM
36 Utilities Reference
Utilities
1
Place OS-9 boot on system.
chd /h0/MWOS/OS9000/80386/PORTS/PCAT/CMDS/BOOTOBJS/BOOTFILE
bootgen /hs01fmt h0_s8xx
• PowerPC:
Place type 41 boot on system.
chd /h0/MWOS/OS9000/603/PORTS/MVME1603/CMDS/BOOTOBJS/ROM
bootgen -el=coreboot /hs01fmt
Place OS-9 boot on system.
chd /h0/MWOS/OS9000/603/PORTS/MVME1603/CMDS/BOOTOBJS/BOOTFILE
bootgen /hs01fmt h0_scsi
The -q option updates information in the disk’s Identification Block by
directing it to point to a file already contained in the root directory of the
specified device.
The -q option is useful when restoring the sysboot.old file as the
valid boot on the disk. bootgen renames the specified file to be
sysboot and saves the current boot as described previously.
Examples
This command manually installs a boot file on device /d1 which is an
exact copy of the sysboot file on device /d0.
$ bootgen /d1 /d0/sysboot
The following three methods manually install a boot file on device /d1.
The bootfile on /d1 is a copy of the sysboot file on device /d0 with
the addition of modules stored in the files /d0/tape.driver and
/d2/video.driver:
Method 1:
$ bootgen /d1 /d0/sysboot /d0/tape.driver /d2/video.driver
Utilities Reference 37
1 Utilities
Method 2:
$ bootgen /d1 /d0/sysboot -z
/d0/tape.driver
/d2/video.driver
[ESCAPE]
Method 3:
$ bootgen /d1 -z
/d0/sysboot
/d0/tape.driver
/d2/video.driver
[ESCAPE]
You can automatically install a boot file by building a bootlist file and
using the -z option to either redirect bootgen standard input or use the
specified file as input:
$ build /d0/bootlist Create file bootlist
? /d0/sysboot Enter first file name
? /d0/tape.driver Enter second file name
? /d2/video.driver Enter third file name
? * V1.2 of video driver
Comment line
? [RETURN] Terminate build
$ bootgen /d1 -z </d0/bootlist
Redirects standard input
$ bootgen /d1 -z=/d0/bootlist
Reads input from pathlist
38 Utilities Reference
Utilities
1
Note
bootgen treats any input line preceded by an asterisk (*) as a
comment.
The following command makes the TestBoot file the current boot, but
saves the current SysBoot file as SysBoot:
$ bootgen /d1 -q testboot
Utilities Reference 39
1 Utilities
Syntax
break
OS
OS-9; OS-9 for 68K
Description
The break utility executes an F$SysDbg (OS-9), F_SYSDBG
(OS-9000) system call. This call stops the operating system and all user
processes and returns control to the ROM debugger. The debugger’s
g[o] command resumes execution of the operating system.
You should only call the break utility from the system’s console device,
because the debugger only communicates with that device. If the
break utility is called from another terminal, you must still use the
system’s console device to communicate with the debugger.
Note
Only super users may use this utility.
The break utility is used only for system debugging. It should not be
included with or run on a production system.
The system clock is not updated when the system is running ROMbug.
It is recommended that a setime be performed when returning from
ROMbug to standard system operation.
40 Utilities Reference
Utilities
1
You must be aware of any open network paths when you use the
break utility as all timesharing is stopped. Network paths are not
serviced while the system is in ROMbug and protocol time-outs may
occur.
Utilities Reference 41
1 Utilities
Syntax
build <path>
OS
OS-9; OS-9 for 68K
Description
The build utility creates a file specified by a given pathlist.
Type build and a pathlist. A question mark prompt (?) displays. This
requests an input line. Each line entered is written to the output file.
To terminate the build utility:
• Enter a line consisting of only a carriage return.
• Enter an end-of-file character at the beginning of an input line. The
end-of-file character is typically <escape>.
Example
$ build newfile
? Build should only be used
? in creating short text files.
? [RETURN]
$ list newfile
Build should only be used
in creating short text files.
42 Utilities Reference
Utilities
1
cfp Command File Processor
Syntax
cfp [<opts>] [<path1>] {<path2>}
OS
OS-9; OS-9 for 68K
Options
-b[=]<size> Specifies the buffer size in k bytes used
by cfp for processing the command file.
-d Deletes the temporary file. This is the
default.
-nd Does not delete the temporary file.
-e Executes the procedure file. This is the
default.
-ne Does not execute the procedure file.
Instead, the cfp utility lists the
procedure file to standard output. If the
-s option is specified, any path on the
command line is treated as a <path2>
substitution string.
-s=<str> Reads <str> instead of a procedure
file. If the string contains characters
interpreted by the shell, the entire option
needs to be enclosed in quotes. It does
not make sense to specify both a
procedure file and this option.
-t=<path> Creates the temporary file at <path>
rather than in the current working
directory.
-z Reads the file names from standard
input substitution strings.
Utilities Reference 43
1 Utilities
Description
The cfp utility creates a temporary procedure file in the current data
directory and then invokes the shell to execute it.
Type cfp, the name of the procedure file to execute (<path1>), and the
file(s) (<path2>) for the names to substitute when executing the
<path1> procedure file and creating a temporary procedure file.
All occurrences of an asterisk (*) in the procedure file (<path1>) are
replaced by the given pathlists, <path2>, unless preceded by the tilde
character (~). For example, ~* translates to *. The command
procedure is not executed until all input files have been read.
For example, if you have a procedure file in your current data directory
called copyit that consists of a single command line, copy *, all of
your C programs from two directories, PROGMS and MISC.JUNK, are
placed in your current data directory by typing:
$ cfp copyit ../PROGMS/*.c ../MISC.JUNK/*.c
If you use the "-s=<string>" option, you may omit the name of the
procedure file, but you must enclose the option and its string in quotes.
The -s option causes cfp to use the string instead of a procedure file.
For example:
$ cfp "-s=copy *" ../PROGMS/*.c ../MISC.JUNK/*.c
Note
You must use double quotes to force the shell to send the string
-s=copy * as a single parameter to cfp. The quotes also prevent the
shell from expanding the asterisk (*) to include all pathlists in the
current data directory.
44 Utilities Reference
Utilities
1
In the above examples, the cfp utility creates a temporary procedure
file to copy every file ending in .c in both PROGMS and MISC.JUNK to
the current data directory. The procedure file created by the cfp utility
is deleted when all the files have been copied.
Using the -s option is convenient because you do not have to edit the
procedure file to change the copy procedure. For example, if you are
copying large C programs, you may want to increase the memory
allocation to speed up the process.
You can allocate the additional memory on the cfp command line:
$ cfp "-s=copy -b100 *" ../PROGMS/*.c ../MISC.JUNK/*.c
You can use the -z and -z=<file> options to read the file names
from either standard input or a file. Use the -z option to read the file
names from standard input. For example, if you have a procedure file
called count.em that contains the command count -l * and you
want to count the lines in each program to see how large the programs
are before you copy them, enter the following command line:
$ cfp -z count.em
The command line prompt does not appear because the cfp utility is
waiting for input. Enter the file names on separate command lines. For
example
$ cfp -z count.em
../PROGMS/*.c
../MISC.JUNK/*.c
When you have finished entering the file names, press the carriage
return a second time to get the shell prompt.
If you have a file containing a list of the files to copy, enter:
$ cfp -z=files "-s=copy *"
Example
In this example, test.p is a procedure file that contains the command
line list * >/p2. The command cfp test.p file1 file2
file3 produces a procedure file containing the following commands:
list file1 >/p2
Utilities Reference 45
1 Utilities
46 Utilities Reference
Utilities
1
chd Changes the Current Data Directory
Utilities Reference 47
1 Utilities
48 Utilities Reference
Utilities
1
chx Change the Current Execution Directory
Syntax
chd [<path>]
chm [<path>]
chx <path>
chd/chx OS
OS-9; OS-9 for 68K
chm OS
OS-9
Description
These commands are built-in shell commands used to change the
working data directory, working module directory or working execution
directory.
Type chd and the pathlist of the new data directory to change your data
directory.
Type chx and the pathlist of the new execution directory to change your
execution directory.
On OS-9 (non-68K), type chm and the pathlist of the new module
directory to change your primary module directory.
In all cases a full or relative pathlist may be used. Relative pathlists
used by the chd, chm and chx utilities are relative to the current data,
module and execution directory, respectively.
If the HOME environment variable is set, the chd command with no
specified directory changes your data directory to the directory specified
by HOME.
Utilities Reference 49
1 Utilities
Note
OS-9: If the MDHOME environment variable is set, the chm command
with no specified directory changes your current module directory to the
directory specified by MDHOME.
chm does not search the alternate pathlist for a module directory if the
directory is not found in the current module directory.
These commands do not appear in the CMDS directory as they are built
in to the shell.
Examples
$ chd /d1/PROGRAMS
$ chx ..
$ chx /D0/CMDS; chd /D1
$ chm /usr/tony
$ chm //tony/newproj
50 Utilities Reference
Utilities
1
chown Changes the Ownership of a File/Directory
Syntax
chown [<opts>] <group>.<user> {<file>}
OS
OS-9; OS-9 for 68K
Options
-s Does not print details of changes
(Silent).
-z Reads file names from standard input.
-z=<file> Reads file names from <file>.
Description
The chown utility changes the owner ID of a file or directory to the
owner ID specified.
Note
You must be a super user to change the ownership of a file.
Examples
$ chown 1.1 prog.c Changes the file owner ID to 1.1
Utilities Reference 51
1 Utilities
Syntax
cmp {<option(s)>} <path1> <path2> OS-9/68K or OS-9
os9cmp {<option(s)>} <path1> <path2> DOS or UNIX
cmp OS
OS-9; OS-9 for 68K
os9cmp OS
WIN; UNIX
Options
-b[=]<size> Assigns <size> k bytes of memory for
the cmp utility to use. The cmp utility
uses a 4K memory by default.
-s Stops the comparison when the first
mismatch occurs and prints an error
message (Silent mode).
-t Prints only the byte totals compared and
different.
-x Searches the current execution directory
for both of the specified files. (cmp only)
Description
The cmp utility opens two files and performs a comparison of the binary
values of the corresponding data bytes of the files. If any differences
are encountered, the file offset (address), the hexadecimal value, and
the ASCII character for each byte display.
The comparison ends when an end-of-file is encountered on either file.
A summary of the number of bytes compared and the number of
differences found is displayed.
52 Utilities Reference
Utilities
1
Type cmp and the pathlists of the files to compare.
Examples
The following example uses an 8K buffer to compare file1 with
file2.
$ cmp file1 file2 -b=8
Differences
(hex) (ascii)
byte #1 #2 #1 #2
======== == == == ==
00000019 72 6e r n
0000001a 73 61 s a
0000001b 74 6c t l
Bytes compared: 0000002d
Bytes different: 00000003
file1 is longer
The following example compares file1 with itself.
$ cmp file1 file1
Bytes compared: 0000002f
Bytes different: 00000000
Utilities Reference 53
1 Utilities
Syntax
code
OS
OS-9; OS-9 for 68K
Description
The code utility prints the input character followed by the hex value of
the input character.
Unprintable characters print as a period (.). The keys specified by
tmode quit and tmode abort terminate code.
tmode quit is normally <control>E, and tmode abort is normally
<control>C.
The most common use of code is to discover the value of an unknown
key on the keyboard or the hex value of an ASCII character.
Examples
$ code
ABORT or QUIT characters will terminate CODE
a -> 61
e -> 65
A -> 41
. -> 10
. -> 04
$
54 Utilities Reference
Utilities
1
com Communicates With a Remote System
Syntax
com <devicename> [<functionkeyfile>]
OS
OS-9
Description
The com utility allows you to communicate with a remote system using
an RS-232 serial port.
<devicename> is the name of the communications I/O port to be used
during the session. You must give this name or an error message
displays and com aborts.
<functionkeyfile> is the name of a file that specifies up to ten user
defined functions keys that transmits text sequences through com.
You must make sure that the I/O port to be used is properly wired to the
modem or remote computer and is set to the correct baud rate. If you
are connecting two computers using a hard-wired connection, you may
need a null modem device. You can use the com utility to help test
your connections.
The default configuration of your terminal and the I/O port (as given in
device descriptors and displayed by the tmode command) are not
important to com because the configuration is automatically set by the
com utility to the appropriate values.
Upon entering the com utility you should see the following message:
% Com V2.0 Copyright 1986 Microware Systems Corp.
% You are talking to the remote system. (on line); metachar: ^Z
Utilities Reference 55
1 Utilities
Note
The % character always begins each com utility generated message.
This differentiates com utility messages from the data received from the
remote computer.
56 Utilities Reference
Utilities
1
You can enter control mode at any time from communication mode by
typing the meta-character (<control>-z). While you are in control
mode, the data link is kept open. However, it is always wise to halt any
output from the remote system before entering control mode to prevent
possible data loss. Most computers stop output when they receive an
X-OFF character (<control>-s) and resume output when an X-ON
character (<control>-q) is received.
A summary of the control mode commands are shown in Table 1-4.
They are followed by a more detailed explanation. These commands
are not case sensitive.
Command Specification
Utilities Reference 57
1 Utilities
Command Specification
When you enter control mode, the com utility displays the following:
% COM:
At the prompt, you can enter any of the above commands. You can use
the r command at any time to return to communications mode.
If an error occurs in a control mode command, an error message
displays along with the corresponding OS-9 error number.
Note
Important Notes About System Hardware Configuration
You may discover a maximum speed at which your OS-9 system can
receive data without dropped characters or read errors. The maximum
data rate depends on CPU clock speed, the type of I/O interface and
the number of active tasks on the system.
58 Utilities Reference
Utilities
1
Change Directory Command
The c command allows you to change your current working directory on
the host system. This is useful when uploading and downloading files.
Utilities Reference 59
1 Utilities
Quit Command
The q command closes any open files and terminates com. You must
log-off the remote system (and hang up the phone line) before using
this command.
60 Utilities Reference
Utilities
1
repetitive typing of common keyboard entries such as user ID logins,
program names, or auto-dial modem phone numbers. This is a software
feature that does not require use of a terminal with special function
keys.
Ten function keys are available. Select them by typing <control>-f
followed by a number key (0-9). For example, the function key number
four is selected by typing:
<control>-F4
The text associated with each function key is read from a disk file. You
must specify the file name on the command line when you start the com
utility. For example, if your function key file is called mykeys, start com
like this:
com /t1 mykeys
You can create a personalized text file using a text editor or OS-9’s
build utility. The file contains up to ten text lines. Each line of the file is
used as the string for the associated function key. The first line is
function key 0, the second is function key 1, etc. The maximum size of
this file is 512 characters.
Each line is transmitted exactly as stored in the file with one exception:
a less than character (<) sends a <return> character to the remote
system. This permits you to specify whether or not the transmitted
function key string should be followed by a <return> character or not.
It also allows the transmitted string to be several “lines.”
Here is an example function key file:
dial 202 555 2626<
user12<
mypassword<
basic myprogram<run<
bye<
dir<
dir
chd
list
basic
Utilities Reference 61
1 Utilities
Because you specify the name of the function key file when you run the
com utility, you can create many different function key files for use with
different systems.
Downloading Files
The d command downloads files. When this command is input, the com
utility asks you for the name of the file to be created for holding received
data. You can then enter the name of any legal OS-9 file name
(pathlist). If the file already exists, the com utility returns the following
prompt:
% File already exists. Rewrite (y/n)?
If the com utility can open the file without error, it automatically switches
to communications mode and stores all data received from the remote
system on the file. If the communications line is operating in full duplex
mode, the data stored will include any data typed on your keyboard that
was echoed back from the remote system.
62 Utilities Reference
Utilities
1
To terminate the download, type <control>-z to enter command mode
and enter the d command again. You can now enter another filename or
press ENTER to return to command mode.
Here is a sample download session:
% Com: Download filename: stock.prices
online:
run summary
The Dow-Jones average closed up 7-1/2 points today at
1225 in heavy trading, fueled by Wall Street rumors of
a lower third quarter inflation forecast.
<control>-Z
% Com:
Auto-Download
Another way to download files is to use the auto-download option.
Auto-download is toggled on and off with the asterisk (*) command.
The advantage to using auto-download is that the entire transfer can be
done in communications mode instead of switching back to command
mode. This is especially helpful when downloading more than one file.
After switching to communications mode, an auto-download is started
by the character sequence ~>: (tilde, greater than, colon) followed by
the destination file name. If this file already exists on the host system,
the com utility allows you to overwrite it. Downloading of this file is
terminated by the character sequence ~> (tilde, greater than).
Utilities Reference 63
1 Utilities
64 Utilities Reference
Utilities
1
Note
In the case (worst case) of an OS-9 system that does not recognize
XON-XOFF, with a disk controller that halts the system while talking to
a remote system, the maximum file size that can be reliably
downloaded corresponds to the size of the com buffer.
Systems with disk controllers that halt the CPU should also not run any
other simultaneous task that accesses the disk while the com utility is
running.
Uploading Files
The u command uploads files. After this command is input, the com
utility asks you for the name of the file to be transmitted. You can then
enter any legal OS-9 file name (path list). If the com utility can locate
and open the file without error, it automatically switches to
communications mode and begins sending the contents of the file to the
remote system.
If the communications link is in full duplex mode, you will see the
transmitted data echoed back to your terminal. If you want to abort the
upload, type <control>-z to enter command mode, type the u
command again and type <return> instead of a file name.
Here is a example upload session:
% Com: Upload filename: message.to.linc
Dear Lincoln,
I got your message today. I will be visiting you
on June 12th so we can finalize our plans. I’m looking
forward to seeing you then.
Regards,
Steve
<control>-Z
% Com:
Utilities Reference 65
1 Utilities
If you want the remote computer to save the uploaded file, you must
give the correct command for that system to store a file before starting
the upload. You may also have to give the correct command after the
upload to tell the remote system to close the file. If the remote system
does not have a special upload command, you can often use the
system’s text editor program or merge-type utilities to receive uploaded
files.
You can also use the upload command to send short commonly used
commands to the remote system such as log-on sequences, etc.
66 Utilities Reference
Utilities
1
compress Compresses ASCII Files
Syntax
compress [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-d Deletes the original file. This is
inappropriate when no pathlist is
specified on the command line and
standard input is used.
-n Creates an output file.
-z Reads file names from standard input.
-z=<file> Reads file names from <file>.
Description
The compress utility reads the specified text file(s), converts it to
compressed form, and writes the compressed text file to standard
output or to an optional output file.
Type compress and the path of the text file to compress. If files are not
given, standard input is used.
The compress utility replaces multiple occurrences of a character with
a three character coded sequence:
aaaaabbbbbcccccccccc would be replaced with ~Ea~Eb~Jc.
Each compressed input file name is appended with _comp. If a file with
this name already exists, the old file is overwritten with the new file.
Typical files compress about 30% smaller than the original file.
The compress utility reduces the size of a file to save disk space. See
the expand utility for details on how to expand a compressed file.
Utilities Reference 67
1 Utilities
! WARNING
Only use the compress and expand utilities on text files.
Examples
In the first example, file1 is compressed, file1_comp is created,
and file1 is deleted.
$ compress file1 -dn
In this example, file2 is compressed, file3 is created from the
redirected standard output, and file2 is deleted.
$ compress file2 -d >file3
68 Utilities Reference
Utilities
1
copy Copies Data from One File to Another
Syntax
copy [<opts>] <path1> [<path2><dir>]
OS
OS-9; OS-9 for 68K
Options
-a Aborts the copy routine if a source file
error occurs. This option cancels the
continue (y/n) ? prompt of the -w
option.
-b[=]<num> Allocates <num> k bytes of memory for
buffering by copy. The default is 8k.
-c[=][[<host>]<target] Convert ASCII files from <host> to
<target> where:
d = MS-DOS (CRLF)
o = OS-9 or OS-9/68K (CR)
u = UNIX (LF)
Default <host> is ANY and <target>
is o.
-f Rewrites destination files with no write
permission.
-n Does not copy original file descriptor
information (attributes, etc.) to the
destination.
-p Does not print a list of the files copied.
This option is only for copying multiple
files.
-r Overwrites the existing file.
-v Verifies the integrity of the new file.
Utilities Reference 69
1 Utilities
Description
The copy utility copies data from <path1> to <path2>. If <path2>
already exists, the contents of <path1> overwrites the existing file
when the -r option is specified. If <path2> does not exist, it is created.
If files are not given on the command line and the -z option is not
specified, an error is returned.
You can copy any type of file. Copied files are not modified in any way
unless the -c option is specified. The -c option should not be used on
binary files.
The attributes of <path1> are copied exactly.
Note
You must have permission to copy the file.
You must be the owner of the file specified by <path1> or have public
read permission in order to copy the file.
70 Utilities Reference
Utilities
1
If <path2> is omitted, the destination file has the same name as the
source file. It is copied into the current data directory. Therefore, the
following two copy commands have the same effect:
$ copy /h0/cmds/file1 file1
$ copy /h0/cmds/file1
The copy utility can also copy one or more files to the same directory
by using the -w=<dir> option. The following command copies file1
and file2 into the BACKUP directory:
$ copy file1 file2 -w=BACKUP
If used with wildcards, the -w=<dir> option becomes a selective
dsave. The following command copies all files in the current data
directory that have names ending with .lp into the LP directory:
$ copy *.lp -w=lp
Specification of the -w option for a destination directory name is
optional. If the last path given to the copy command is an already
existing directory name, then the destination directory name will be this
path. For instance, to copy all files in the current directory to /r0, type:
$ copy * /r0
Data is transferred using large block reads and writes until an end-of-file
occurs on the input path. Because block transfers are used, normal
output processing of data does not occur on character-oriented devices
such as terminals, printers, etc. Therefore, the list utility is preferred
over the copy utility when a file consisting of text is sent to a terminal or
printer.
Note
Any error that occurs while creating or writing a destination file aborts
the copy utility.
The copy utility always runs faster if you specify additional memory
with the -b option. This allows the copy utility to transfer data with a
minimum number of I/O requests
Utilities Reference 71
1 Utilities
Examples
The following example copies file1 to file2. If file2 already
exists, error #218 is returned.
$ copy file1 file2
This example copies file1 to file2 using a 15K buffer.
$ copy file1 file2 -b=15
This example copies all files in the current data directory to MYFILE.
$ copy * -w=MYFILE
This example copies all files in the current data directory that have
names ending in .lp.
$ copy *.lp -w=MYFILE
This example copies /d1/joe and /d0/jim to FILE.
$ copy /d1/joe /d0/jim -w=FILE
This example writes file3 over file4.
$ copy file3 file4 -r
This example copies a set of ASCII files, converting them to several
different line termination styles. In the end, the directories OS9 and
OS9000 will contain identical files.
$ copy OS9/*.c -c=d -w=DOS
$ copy DOS/*.c -c=u -w=UNIX
$ copy UNIX/*.c -c=o -w=OS9000
72 Utilities Reference
Utilities
1
count Counts Characters, Words, and Lines in File
Syntax
count [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-b Counts characters and gives a
breakdown of their occurrence.
-c Counts characters.
-d[=]<number> Divides the count of lines by the
specified number.
-l Counts lines.
-w Counts words.
-z Reads file names from standard input.
-z=<file> Reads file names from <file>.
Description
The count utility counts the number of lines in a file. Options include
character count and word count.
To count the number of lines in a file, enter count and the pathlist of
the file to examine. If a pathlist is not specified, the count utility
examines lines from standard input.
The count utility recognizes the line feed and form feed characters as
line delimiters.
By using -c, the count utility counts the number of characters in a file.
By using -w, the count utility counts the number of words in a file. A
word is defined as a sequence of non-blank, non-carriage-return
characters.
Utilities Reference 73
1 Utilities
Example
$ list file1
first line
second line
third line
74 Utilities Reference
Utilities
1
date Displays System Date and Time
Syntax
date [<opts>]
OS
OS-9; OS-9 for 68K
Options
-j Displays the Julian date and time.
-m Displays the military time (24 hour clock)
after the date.
Description
The date utility displays the current system date and system time. The
system date and time are set by the setime utility.
Examples
$ date
December 18, 1994 Tuesday 2:20:20 pm
$ date -m
December 18, 1994 Tuesday 14:20:24
See Also
setime
Utilities Reference 75
1 Utilities
Syntax
dcheck [<opts>] <devname>
OS
OS-9; OS-9 for 68K
Options
-b[=]<low>[:<high>] Print file names containing blocks in the
given range. (OS-9 only)
-d[[=]<num>] Prints the path to the directory <num>
deep.
-r Prompts to turn on or off bits in the bit
map (Repair mode.)
-y Does not prompt for repair, but answers
yes to all prompts (Repair mode). This
option may only be used with the -r
option.
Description
The dcheck utility is a diagnostic tool which detects the condition and
general integrity of the directory/file linkages of a disk device.
Type dcheck, the option(s) desired, and the name of the disk device to
check.
The dcheck utility first verifies and prints some of the vital file structure
parameters. It moves down the tree file system to all directories and
files on the disk. As it moves down the tree file system, the dcheck
utility verifies the integrity of the file descriptor sectors (FDs) and reports
any discrepancies in the directory/file linkages.
From the segment list associated with each file, the dcheck utility
builds a sector allocation map. This map is created in memory.
76 Utilities Reference
Utilities
1
Note
OS-9:
If any FDs describe a segment with a cluster not within the file structure
of the disk, the dcheck utility reports the following message:
OS-9 for 68K: *** Bad FD segment (xxxxxx-yyyyyy)
OS-9: *** bad fd segment ($xxxxxxxx-$yyyyyyyy)
This indicates that a segment starting at sector xxxxxx (hexadecimal)
and ending at sector yyyyyy cannot be used on this disk. The entire
FD is probably bad if any of its segment descriptors are bad. Therefore,
the allocation map is not updated for bad FDs.
While building the allocation map, the dcheck utility ensures that each
disk cluster appears only once in the file structure. If a cluster appears
more than once, the dcheck utility displays a message:
OS-9 for 68K: Sector xxxxxx (byte=nn bit=n) previously allocated
OS-9: Block $xxxxxxxx previously allocated
On OS-9 for 68K, this message indicates the cluster at sector xxxxxx
has been found at least once before in the file structure. byte=nn
bit=n specifies in which byte of the bitmap this error occurred and in
which bit in that byte. The first byte in the bitmap is numbered zero. For
the dcheck utility’s purposes, bits are numbered zero through seven;
the most significant bit is numbered zero. The message may be printed
more than once if a cluster appears in a segment in more than one file.
Occasionally, sectors on a disk are marked as allocated even though
they are not associated with a file or the disk’s free space. This is most
commonly caused by media defects discovered by format. These
defective sectors are not included in the free space for the disk. This
can also happen if a disk is removed from a drive while files are still
open, or if a directory containing files is deleted by a means other than
deldir.
Utilities Reference 77
1 Utilities
If all the sectors of a cluster are not used in the file system, the dcheck
utility prints a message:
OS-9 for 68K: xxxxxx cluster only partially used
OS-9: Block $xxxxxxxx not in file structure
The allocation map created by the dcheck utility is then compared to
the allocation map stored on the disk. Any differences are reported in
messages:
OS-9 for 68K: Sector xxxxxx (byte=nn bit=n) not in file structure
Sector xxxxxx (byte=nn bit=n) not in bit map
OS-9: Block $xxxxxxxx not in bitmap
On OS-9 for 68K, the first message indicates sector number xxxxxx
was not found as part of the file system but is marked as allocated in the
disk’s allocation map. In addition to the causes previously mentioned,
some sectors may have been excluded from the allocation map by the
format program because they were defective. They could be the last
sectors of the disk, whose sum is too small to comprise a cluster.
The second message indicates that the cluster starting at sector
xxxxxx is part of the file structure but is not marked as allocated in the
disk’s allocation map. This type of disk error could cause problems
later. It is possible that this cluster may later be allocated to another file.
This would overwrite the current contents of the cluster with data from
the newly allocated file. All current data located in this cluster would be
lost. Any clusters reported as previously allocated by the dcheck utility
have this problem.
78 Utilities Reference
Utilities
1
! WARNING
Do not use the -r option unless you thoroughly understand what you
are doing. The disk errors could be caused by previously mentioned
problems and perhaps should not be repaired.
Restrictions
1. Only the super user (user 0.n) may use this utility.
2. The dcheck utility should have exclusive access to the disk being
checked. The dcheck utility can be fooled if the disk allocation map
changes while it is building its bitmap file from the changing file
structure.
Example
$ dcheck /r0
Volume - ’Ram Disk (Caution: Volatile)’ on device /r0
$001000 total sectors on media, 256 bytes per sector
Sector $000001 is start of bitmap
$0200 bytes in allocation map, 1 sector(s) per cluster
Sector $000003 is start of root dir
Building allocation map...
$0003 sectors used for id sector and allocation map
Checking allocation map...
Utilities Reference 79
1 Utilities
Syntax
debug [<opts> <prog> <prog opts>]
OS
OS-9
Options
-m=<n> Increases memory size for program.
Description
The debug utility debugs and tests user-state 68000 machine language
programs written for the OS-9 for 68000 operating system.
The debug utility uses:
• Software techniques to control a process to debug.
• The F$DFork and F$DExec system calls to create and execute the
process to debug. These system calls provide an environment that
allows the debugger to control how a process executes without
affecting other processes on the system.
Full access to the 68000 user-mode registers is provided. On
68020/68881-based systems, full access to user-mode 68020
registers and all 68881 floating point registers are provided.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
For more information about the debug utility, see Chapter 2: Using the
debug Utility.
80 Utilities Reference
Utilities
1
deiniz Detaches Device
Syntax
deiniz [<opts>] {<modname>}
OS
OS-9; OS-9 for 68K
Options
-z Reads the module names from standard
input.
-z=<file> Reads the module names from <file>.
Description
The deiniz utility removes the device from the system device table.
The deiniz utility uses the I$Detach (OS-9 for 68K) or I_Detach
(OS-9) system call to accomplish this.
Type deiniz, followed by the name of the module(s) to detach.
<modname> may begin with a slash (/). The module names may be
read from standard input or from a specified pathlist if the -z option is
used.
! WARNING
Do not use the deiniz utility to detach a module unless you have
explicitly iniz-ed it. If you use the deiniz utility to detach a device
that you have not iniz-ed, you could cause problems for other users
who may be using the module.
Utilities Reference 81
1 Utilities
See Also
I$Detach OS-9 Technical Manual
I_Detach OS-9000 Technical Manual
iniz
Example
$ deiniz t1 t2 t3
82 Utilities Reference
Utilities
1
del, os9del Deletes a File
Syntax
del [<opts>] {<path>} OS-9 or OS-9/68K
os9del [<opts>] {<path>} DOS or UNIX
del OS
OS-9; OS-9 for 68K
os9del OS
WIN; UNIX
Options
-d Deletes hard link to directories. (OS-9
only)
-e Erases the disk space that the file
occupied.
-f Deletes files with no write permission.
-p Prompts for each file to be deleted with
the following prompt:
delete <filename> ? (y,n,a,q)
y = yes.
n = no.
a = deletes all specified files without
further prompts.
q = quits the deleting process.
-q Quiet mode. Suppress File Not Found
error messages.
-x Looks for the file in the current execution
directory. (del only)
-z Reads the file names from standard
input.
Utilities Reference 83
1 Utilities
Description
The del utility deletes the files specified by the pathlists.
You must have write permission for the files to be deleted. You cannot
delete directory files with the del utility unless their attribute is changed
to non-directory.
Examples
These examples use the following directory structure:
$ dir
Directory of /D1 14:29:46
junk myfile newfile number_five old_test_program test_program
$ del newfile Delete newfile.
$ del *_* Delete all files in the current data
directory with an underscore character in
their name
After executing the preceding two examples, the directory has the
following files:
$ dir
Directory of /D1 14:30:37
junk myfile
To delete all files in the current directory, type:
$ dir -u ! del -z
See Also
attr
deldir
84 Utilities Reference
Utilities
1
deldir Deletes All Files in Directory
Syntax
deldir [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-e Erases the disk space that files in the
directory occupied.
-f Deletes files regardless of whether write
permission is set.
-q Quiet mode. No questions are asked.
The directory and its sub-directories are
all deleted, if possible.
-x Deletes directories relative to the
execution directory.
-z Reads the directory names from
standard input.
-z=<file> Reads the directory names from
<file>.
Description
The deldir utility deletes a directory and the files (and subdirectories)
it contains.
When the deldir utility is run, it prints a prompt message:
$ deldir OLDFILES
Deleting directory: OLDFILES
Delete, List, or Quit (d, l, or q) ?
Utilities Reference 85
1 Utilities
Response Action
Note
You should never delete the current data directory (.).
86 Utilities Reference
Utilities
1
delmdir Deletes Existing Module Directories
Syntax
delmdir [<opts>] {<module directory>}
OS
OS-9
Options
-z Reads the module directory names from
standard input.
-z=<file> Reads the module directory names from
<file>.
Description
The delmdir utility deletes existing module directories.
The module directory to delete may contain both modules and module
sub-directories. These sub-directories may contain sub-directories, or
modules, etc. The delmdir utility recursively deletes all sub-directories
when the parent directory is deleted.
The delmdir utility does not delete the module directory if there are
modules located in the directory which are in use or if any of the
sub-directories are in use.
Utilities Reference 87
1 Utilities
Note
The delmdir utility does not search the alternate module directories if
the directory to be deleted is not located in the current module
directory.
See Also
makdir
chm
mdir
Example
$ mdir USR
Module Directory of USR
proram1 program2 program3
$ delmdir USR
$ mdir USR
$
88 Utilities Reference
Utilities
1
devs Displays System’s Device Table
Syntax
devs
OS
OS-9; OS-9 for 68K
Options
-a Lists extended information about each
device. (OS-9 only)
Description
The devs utility displays a list of the system’s device table.
The device table contains an entry for each active device known. The
devs utility does not display information for non-initialized devices.
Under OS-9 for 68K, the devs display header lists the system name,
the operating system version, and the maximum number of devices
allowed in the device table.
Under OS-9, the devs display header lists the system hardware
architecture, operating system version, and the CPU class.
Each line in the devs utility’s display contains five fields:
OS-9 for
68K OS-9 Description
Utilities Reference 89
1 Utilities
OS-9 for
68K OS-9 Description
90 Utilities Reference
Utilities
1
Example
The following example displays the OS-9 device table for a system
named Tazz:
$ devs
Tazz_VME147 OS-9/68K V3.0.3 (128 devices max)
Utilities Reference 91
1 Utilities
See Also
iniz
deiniz
92 Utilities Reference
Utilities
1
dir Displays Names of Files in Directory
Syntax
dir [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-a Displays all file names in the directory.
This includes file names beginning with
a period.
-b Does not display block address in
extended listing (OS-9 only)
-d Appends a slash (/) to all directory
names listed. This does not affect the
actual name of the directory.
-e Displays an extended directory listing.
-e=<opt> Displays an extended directory listing.
(OS-9 only)† opt = c, a, m, u,
and b
a = last access time
b = last backup time
c = creation time
m = last modified time (default)
u = last update time
-f Displays the file link count in extended
listing (OS-9000 only).
-h Displays the file host number in
extended listing (OS-9 only).
-i Inverts the order of sorted listings (OS-9
only).
Utilities Reference 93
1 Utilities
Description
The dir utility displays a formatted list of file names of the specified
directory file on standard output.
Type dir and the directory pathlist, if desired.
If parameters are not specified, the current data directory is shown. If
you use the -x option, the current execution directory is shown. If a
pathlist of a directory file is specified, the files of the indicated directory
are shown.
94 Utilities Reference
Utilities
1
Using the -e options, you can create your own listing, showing specific
items as needed. Valid <opt> values are: c, a, m, u, or b.
$dir -e=a Displays time last append occurred.
$dir -e=b Displays time of last backup.
$dir -e=c Displays creation time.
$dir -e=m Displays time last modified.
$dir -e=u Displays time of last update.
Because the shell does not interpret the -x option, wildcards do not
work as expected when you use this option.
Unless you use the -a option, the dir utility does not display file names
that begin with a period (.).
Examples
The first example displays the current data directory:
$ dir
Utilities Reference 95
1 Utilities
Directory of . 12:12:54
BK BKII RELS ed10.c ed11.c
ed2.c
In the second example, the parent of the working data directory is
displayed:
$ dir ..
This example displays the NEWSTUFF directory:
$ dir NEWSTUFF
The next example displays the entire description of the current data
directory:
dir -e
Directory of . 13:54:44
Owner Last modified Attributes Sector Bytecount Name
------- ------------- ---------- ------ --------- ----
1.78 90/11/28 0357 d-ewrewr 383C8 160 NOTES
1.78 90/11/28 0357 d-ewrewr 383E8 608 PROGRAMS
1.78 90/11/28 0357 d-ewrewr 383D8 160 TEXT
1.78 90/11/14 0841 ------wr F4058 438 arrayex.c
1.78 90/11/12 0859 ------wr F4068 538 arrayex.r
1.78 90/11/09 0852 ------wr F2AB0 312 asciiinfo
0.0 90/04/27 1719 ----r-wr 71EC8 4626 atari.doc
1.78 90/11/14 0911 ------wr B4548 636 bobble.c
1.78 90/11/14 0910 ------wr B4AA8 815 bobble.r
1.78 90/10/18 1259 ------wr BD418 619 cd.order
1.78 90/06/06 1009 ---wr-wr 82B8 5420 cdichanges
1.78 90/11/28 1102 ------wr E0C68 1478 checks.c
1.78 90/11/28 1102 ------wr E1D08 1075 checks.r
1.78 90/09/07 0848 ------wr 708B8 274 datafile
0.78 90/04/12 1206 ---wr-wr 70EE8 1065 drvr.a
1.78 90/11/13 1544 ------wr B1650 112 exloop
To display the execution directory, type:
$ dir -x
To display the entire description of the execution directory, type:
$ dir -xe
To display the contents of the current directory and all directories one
level below this directory, type:
96 Utilities Reference
Utilities
1
$ dir -r=1
The next example displays the entire description of all files within the
current directory. This includes files within all subdirectories of the
current directory.
$ dir -er
This example displays all directory and file names that begin with B.
$ dir -n B*
To display all named pipes for device /pipe, type:
$ dir /pipe
Utilities Reference 97
1 Utilities
OS-9 Syntax
diskcache [<opts>] {<devname>[=<num>k]}
OS
OS-9; OS-9 for 68K
Options
-c Disables CRC checking of cached
sectors. (OS-9 for 68K)
-d Disables cache for <dev>.
-e Enables cache for <dev>.
-i Disables statistical information. (OS-9
for 68K)
-l Display the cache status for <dev>.
(OS-9 for 68K)
-t=<size> Specifies the size limit of the total cache.
(OS-9 for 68K)
-s Prints cache status information for the
specified device. (OS-9)
Description
The diskcache utility enables, disables, or displays the status of
cache.
Caching may be enabled for any type of RBF device, and more than
one device may be cached at a time.
98 Utilities Reference
Utilities
1
OS-9 for 68K Systems: Use the -t option to set the total amount of
system memory used for caching all enabled drives. If not explicitly
defined, diskcache automatically selects a reasonable value based
on the amount of free system memory.
OS-9 Systems: The following command enables caching on the hard
disk (/h0) with an 800k cache:
diskcache -e /h0=800k
Use the -e and -d options to dynamically enable or disable caching on a
per drive basis while the system is running.
Statistical information regarding the hit/miss ratios and amount of
memory allocated can be inspected on a drive by drive basis using the
-l /(device) OS-9 for 68K option, or -s /(device) OS-9 option.
An example output of this information follows.
Current size = 1047552
Size limit = 1048576
crc enabled, stats enabled
Device: /h0:1:1
Requests Sectors Hits Zaps >2 Xfr Hit Rate
Reads: 47592 55436 21874 143 662 39.5%
Writes: 7723 8065 7342 68
Dir Reads: 54048 54048 34526 18387<-Sctr Zero 63.9%
Hit compares = 63399 ( 1/hit)
Miss compates = 92685 ( 3/miss)
The Device: /h0:1:1 line of information uses the following syntax:
[[<dev>[<bias>:<rebias>]]. Where <bias> is the bias when last
used, and <rebias> is the bias when last reused. The hit (miss)
compares show total number of hits or misses, and average number of
compares in cache before each hit or miss).
Utilities Reference 99
1 Utilities
Note
If caching is to be enabled on drives with different sector sizes, include
the device with the largest sector size in the initial cache enabling.
Attempting to add a drive (with a sector size larger than any currently
cached drive) to the cache system after initial cache startup results in
continuous “misses” for that drive, as the sector size is too large.
Syntax
dosfile [<opts>] [<file_name>] [<opts>]
OS
OS-9
Options
-d Converts OS-9 text file to DOS format.
-r Rewrites the target file if it exists.
-b[=]<size> Use buffer of <size> kilobytes.
Description
The dosfile utility converts DOS text tiles to OS-9 format or OS-9 text
files to DOS format.
Similar functionality is also implemented in the copy command for both
OS-9 for 68K and OS-9. This utility may be removed in a future release.
Syntax
dpsplit [<opts>] <desc> [<opts>]
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-j Joins <desc>.1 and <desc>.2 into
<desc>.
-s Splits <desc> into <desc>.1 and
<desc>.2.
Description
The dpsplit utility was designed to make development of the DPIO
descriptors for the OS-9/68000 operating system easier. Because the
editmod utility cannot handle a fully constructed DPIO descriptor, the
descriptor must be split to be edited or listed.
Use the dpsplit utility to split the DPIO descriptor, and the editmod
utility to edit or list the split components, then the dpsplit utility again,
to rejoin the descriptor.
When creating a DPIO descriptor, the editmod utility can be used to
create both components and the dpsplit utility can be used to join the
components.
Syntax
dsave [<opts>] [<path>]
OS
OS-9; OS-9 for 68K
Options
-a Does not copy any file that has a name
beginning with a period.
-b[=]<n> Allocates <n> k bytes of memory for
copy and chm if needed.
-c[=][[<host>]<target] Convert ASCII files from <host> to
<target> where:
d = MS-DOS (CRLF)
o = OS-9 or OS-9/68K (CR)
u = UNIX (LF)
Default <host> is ANY and <target>
is o.
-d Compares dates with files of the same
name and copies files with more recent
dates.
-d=<date> Compares the specified date with the
date of files with the same name and
copies any file with a more recent date
than that specified. See format for
<date> above.
-e Executes the output immediately.
-f Uses copy’s -f option to force the
writing of files.
-i Indents for directory levels.
Description
The dsave utility backs up or copies all files in one or more directories.
It generates a procedure file, which is either executed later to actually
do the work or is executed immediately using the -e option.
Type dsave and the path of the new directory. The dsave utility writes
commands on standard output to copy files from the current data
directory to the directory specified by <path>. If <path> is not
specified, the copies are directed to the current data directory when the
procedure file is executed.
You should direct the dsave utility’s standard output to a procedure file
that you can later execute or use the -e option to execute the dsave
utility’s output immediately.
If the dsave utility encounters a directory file, it automatically includes
the makdir and chd commands in the output before generating copy
commands for files in the subdirectory. The procedure file duplicates all
levels of the file system connected downward from the current data
directory.
If the current working directory is the disk’s root directory, the dsave
utility creates a procedure file to backup the entire disk, file by file. This
is useful when you need to copy many files from different format disks,
or from a floppy disk to a hard disk.
If an error occurs, the dsave utility displays the following prompt:
continue (y,n,a,q)?
Enter one of the following responses:
Response Description
Examples
The first three examples accomplish the same goal: copying all files in
/d0/MYFILES/STUFF to /d1/BACKUP/STUFF. Each example
highlights a different method of using the dsave utility.
In the first example, no path is specified in the dsave command and a
procedure file is generated. Therefore, you must change data
directories before executing the procedure file. If the directory is not
changed, an error message occurs:
#218--file already exists in this directory under
the same name.
$ chd WORKFILES
$ dsave -deb32 ../BACKUP
$ cd ..
In this example only prog2 was copied because the date was more
recent in the WORKFILE directory.
Syntax
dump {<option(s)>} [<path> [<starting offset>]]
os9dump {<option(s)>} [<path> [<starting offset>]]
dump OS
OS-9; OS-9 for 68K
os9dump OS
WIN; UNIX
Options
-a Interpret path as memory range of
either: <start>[-end] or
<start>[:size].
-c Does not compress duplicate lines.
-k Displays shift-JIS Kanji code in the
ASCII format area.
-m Dumps from a memory resident module.
-s Interprets the starting offset as a sector
number. This is useful for RBF devices
with a sector size not equal to 256.
-x Indicates that <path> is an execution
directory. You must have execute
permission for the pathlist.
Description
The dump utility produces a formatted display of the physical data
contents of <path>. <path> may be a mass storage file or any other
I/O device. The dump utility is commonly used to examine the contents
of non-text files.
Examples
$ dump Display keyboard input in hex.
$ dump myfile >/P Dump myfile to printer.
$ dump shortfile Dump shortfile.
Sample Output
Starting Data bytes in hexadecimal format Data bytes in ASCII format
Address
Addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 2 4 6 8 A C E
-------- ---- ---- ---- ---- ---- ---- ---- ---- ----------------
00000000 6d61 696e 2829 0d7b 0d09 696e 7420 783b main().{..int x;
00000010 0d09 0d09 6765 745f 7465 726d 5f64 6566 ....get_term_def
00000020 7328 293b 0d09 783d 6d65 6e75 2829 3b0d s();..x=menu();.
Syntax
echo [<opts>] {<text>}
OS
OS-9; OS-9 for 68K
Options
-n Separates the text with carriage returns.
-r Does not send a carriage return after
<text>.
-z Reads the text from standard input.
-z=<file> Reads the text from <file>.
Description
The echo utility echoes its parameter to the standard output path.
The echo utility is used to generate messages in shell procedure files
or to send an initialization character sequence to a terminal.
Type echo and the text to output. The echo utility reads the text until a
carriage return is encountered. The input then echoes on the output
path.
You can embed a hexadecimal number representing a character in a
character string, but you must precede it with a backslash (\). The shell
removes all but one embedded space from character strings passed to
the echo utility. Therefore, to allow for more than one blank between
characters, you must enclose the string with double quotes. A single
backslash (\) is echoed by entering two backslashes (\\).
Examples
$ echo "Here is an important message!"
Here is an important message!
$ echo \1b >/p1 Send an <escape> character to a printer
(/p1).
$ echo column1 column2 column3
column1 column2 column3
$ echo "column1 column2 column3"
column1 column2 column3
Syntax
editmod [<opts>] [<module>] [<opts>]
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-a[=]<dir> Specifies an alternative MWOS directory
structure.
-b Enables verbose debugging messages.
Multiple -b options increase the amount
of output. For example: editmod -bbb
-c test shows very verbose
debugging messages while the module
test is being created.
-c Creates a module.
-d[=]<name>[[=]<value>]
Defines name for the pre-processor. If
the optional value is not supplied, the
empty string is name’s value.
-e Edits the contents of a module.
-f[=]file Specifies the file which contains the
named module. If the module being
edited or listed is contained in a larger
file, use this option. The OS-9 for 68K
boot file is an example of this situation.
To edit the init module within the boot
file, the following command line is used:
editmod -f=OS9Boot init -e
Description
The editmod utility creates, displays, and edits modules. It has the
following attributes:
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
For more information about the editmod utility, see Chapter 3: Using
the editmod Utility.
Examples
To edit the cnfgdata module, first set your MWOS environment
variable, then type:
editmod -e cnfgdata -dc_all
Syntax
edt [<opts>] <path>
OS
OS-9; OS-9 for 68K
Options
-b[=]<num> Allocates a buffer area equal to the size
of the file plus <num> k bytes. If the file
does not exist, a buffer of the indicated
size is assigned for the new file.
Description
The edt utility is a line-oriented text editor that allows you to create and
edit source files.
Type edt and the pathlist desired. If the file is new or cannot be found,
the edt utility creates and opens it. The edt utility then displays a
question mark prompt (?) and waits for a command. If the file is found,
the edt utility opens it, displays the last line, and then displays the ?
prompt.
The first character of a line must be a space if text is to be inserted. If
any other character is typed in the first character position, the edt
utility tries to process the character as an edt command. The edt utility
command format is very similar to BASIC’s editor.
The edt utility determines the size of the file to edit and uses the
returned size plus 2K as the edit buffer. If the file does not already exist,
the edit buffer is initialized to 2K. When the end of the edit buffer is
reached, a message is displayed.
edt Commands
All edt commands begin in the first character position of a line.
Command Description
OS-9 Syntax
events [<opts>]
OS
OS-9; OS-9 for 68K
Options
-h Displays the event values in
hexadecimal format.
-k[=]name Kills the event.
Description
The events utility displays a list of the active events on the system and
information about each event. The events utility header line lists the
system name and the version number.
Each line in the events utility display contains the following fields:
OS-9 for
68K OS-9 Description
OS-9 for
68K OS-9 Description
Example
The following example displays the active system events for an OS-9
for 68K system named Calvin:
Calvin OS-9/68K V3.0
event ID name value W-inc S-inc links
--------- ------------ ---------- ------ ------ ------
10000 evtfffe4000 1 -1 1 1
20001 irqfffe4000 0 -1 1 1
30002 SysMbuf 121952 0 0 1
40003 net_input 0 -1 -1 1
50004 Sur00227750 0 0 0 1
60005 Str002261f0 0 0 0 1
70006 Stw002261f0 0 0 0 1
80007 Str00227380 0 0 0 1
90008 Stw00227380 0 0 0 1
a0009 Str00232a50 0 0 0 1
b000a Stw00232a50 0 0 0 1
c000b Str0020ac30 0 0 0 1
d000c Stw0020ac30 0 0 0 1
e000d pkm00i 0 0 0 1
f000e pkm00o 0 0 0 1
10000f teln.1 0 -1 -1 1
130012 Str0020adf0 0 0 0 1
140013 Stw0020adf0 0 0 0 1
See Also
F$Event service request OS-9 for 68K Technical Manual.
F_Event system call OS-9 Technical Manual.
Syntax
ex <path> [<arglist>]
OS
OS-9; OS-9 for 68K
Description
The ex utility is a built-in shell command that causes the shell to chain
to another program. It permits a transition from the shell to another
program without creating another process, thus conserving system
memory.
The ex utility is used when the shell is called from another program to
execute a specific program, after which the shell is not needed. For
example, applications which use only BASIC need not waste memory
space on shell.
The ex utility should always be the last command on a shell input line
because any command lines following it are never processed.
Note
Because this is a built in shell command, it does not appear in the CMDS
directory.
Example
$ ex BASIC
$ echo "Starting tsmon" ; ex tsmon /t1 /t2 /term
Syntax
exbin {<option(s)>} [<inpath>[<outpath>]]
OS
OS-9; OS-9 for 68K
Options
-b[=]<num>[k] Specifies the conversion buffer size in
bytes to use. The k sub-option converts
<num> to k bytes.
Description
The exbin utility converts S-record files to binary.
S-record files are a type of text file containing records that represent
binary data in hexadecimal form. This Motorola-standard format is often
used by commercial PROM programmers, emulators, logic analyzers,
and similar devices that use the RS-232 interface. It can be useful for
transmitting files over data links that can only handle character type
data. It can also be used for converting assembler or compiler
generated programs to load on non-OS-9/OS-9for 68K systems.
<inpath> is assumed to be an S-Record format text file which the
exbin utility converts to pure binary form in a new file, <outpath>.
The load addresses of each data record must describe contiguous data
in ascending order.
The exbin utility does not generate or check for the proper module
headers or CRC check value required to actually load the binary file.
You can use ident to check the validity of the modules if they are to be
loaded or run. The exbin utility converts any of the S-record types
mentioned above.
Standard input and output are assumed if both paths are omitted.
If the second path is omitted, standard output is assumed.
Examples
The following example generates CMDS/prog in binary format from the
S1 type file, prog.S1.
$ exbin prog.S1 cmds/prog
See Also
binex
Syntax
expand [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-d Deletes the old version of the file. This
option should not be used when a
pathlist is not specified on the command
line and standard input is used.
-n Sends output to a file instead of the
standard output. The file has _exp
appended to it, unless the file name
already has a _comp suffix. In this case,
the _comp is removed.
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The expand utility restores compressed files to their original form. It is
the complement command of the compress utility.
Type expand and the name of the file to expand.
If file names are not given on the command line, standard input is
assumed.
Examples
$ expand data.a -nd Expands and then delete data.a,
creating data.a_exp.
Syntax
fdisk [<opts>]
OS
OS-9
Options
-a[=]<num> Makes partition <num> the active
partition.
-d[=]<dev> Examines/changes device. Default =
/hc.
-c Forces terminal mode (curses off).
-e Includes partition information in display
mode.
-i Initialize the partition table to zero.
-s Shows partition table.
Description
Although OS-9 may be used without disk partitions of any kind, the use
of partitions is strongly recommended, even if only one partition is used.
There are several reasons for using partitions with OS-9.
• Hard Disk Booting Without partitions, you must boot from
floppy disk.
• Multiple Operating Systems When disk partitioning is employed,
other operating systems may share the
same physical disk.
Partition Information
The OS-9 partition for x86 is defined as a primary partition type 0x9.
OS-9 for the Power PC includes extended type41 and 0x41. The RBF
file system only understands these two type partitions.
The fdisk utility allows a maximum of four primary partitions to be
created.
The fdisk utility also allows extended partitions to be converted to
OS-9 primary partitions.
! WARNING
When converting extended partitions to OS-9, all data on the extended
partition is deleted. This includes any logical partitions associated with
the extended partition.
! WARNING
Do NOT place OS-9 on a logical drive partition.
You may have to use extended partitions for other operating systems
such as DOS, OS/2 and WINDOWS.
Further, with OS-9 “PCF” DOS extended partitions and logical drives
may be accessed.
To create or delete a partition, you must enter fdisk in the interactive
mode:
Note
Cylinder size is not in megabytes. Although, some cylinders may be 1
MEG in size. Enter the number of cylinders to allocate for the partition,
not the number of bytes.
See Also
pinfo
Syntax
fixmod {<option(s)>} {<modname>}
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-d[=<path>] Locates and dumps all modules in file to
separate files (in either the current
directory or the specified path).
-f Forces dump of module even if
destination filename already exists.
-j[=<pathname>] Skips junk (invalid module data) and
continue locating modules in the
specified file.
-l[=]<name> Specify module on which to operate.
-q Quiet mode. Does not display status as
files are updated.
-r Changes the revision number only.
-u Updates an invalid module CRC or
parity.
-ua[=]<att.rev> Changes module’s attribute/revision
level.
-ub Fixes the sys/rev field in BASIC
packed subroutine modules.
-ue[=]<sysedit> Changes module’s edition to
<sysedit>.
-ug Updates the corresponding STB module
with the new CRC of the module being
modified.
Description
The fixmod utility verifies and updates module parity and module CRC
(cyclic redundancy check). You can also use the fixmod utility to set
the access permissions and the group.user number of the owner of the
module. The fixmod utility can process OS-9 for 68K, OS-9/80386,
and OS-9/PowerPC modules, regardless of the host operating system.
Use the fixmod utility to update the CRC and parity of a module every
time a module is patched or modified in any way. OS-9 and OS-9 for
68K cannot recognize a module with an incorrect CRC.
You must have write access to the file in order to use the fixmod utility
on it.
Use the -u option to recalculate and update the CRC and parity.
Without -u, the fixmod utility only verifies the CRC and parity of the
module.
See Also
CRC and parity OS-9 for 68K Technical Manual
OS-9 Technical Manual
ident
Syntax
format [<opts>] <devname>
OS
OS-9; OS-9 for 68K
Options
-bo=<num> Sets the block offset to <num>. (OS-9)
-c Uses the interactive mode. (OS-9)
-c=<num> Specify the number of sectors per
cluster. <num> must be decimal and
must be a power of 2. The default is 1.
(OS-9)
-dd Initializes a double-density (floppy) disk.
-ds Initializes a double-sided (floppy) disk.
-e Displays elapsed verify time. This is
useful for checking the sector interleave
values. (OS-9 for 68K)
-h=<num> Sets the number of heads to <num>.
(OS-9)
-i=<num> Specifies the number for sector
interleave offset value. <num> is
decimal.
-m=<num> Sets the bitmap address to <num>.
(OS-9)
-nf Specifies no fast verify mode. (OS-9 for
68K)
-np Specifies no physical format.
-nv Specifies no physical verification.
Description
The format utility physically initializes, verifies, and establishes an
initial file structure on a disk. You must format all disks before using
them on an OS-9 or OS-9 for 68K system.
Type format, the name of the device to format, and any options. The
format utility determines whether the device is:
• Autosize (for example, devices such as SCSI CCS drives).
• Non-autosize (such as standard floppy disks and many hard disks).
An autosize device is one which can be queried to determine the
capacity of the device.
The format utility checks a bit in PD_Ctrl to determine whether or not
a device is autosize. If this bit is zero, the device is non-autosize. If one,
the media is autosize.
Note
The format utility uses a fast verify mode. This means that the
format utility reads a minimum of 32 sectors. If the cluster size is
greater than 32 sectors, one cluster’s worth of sectors is read.
• If you want the format utility to use the cluster size regardless of
the number of sectors per cluster, you must use the -nf option. For
example, if your cluster size has one sector, 32 sectors are read by
default, while only one sector would be read if you specify -nf.
Examples
$ format /D1 -dsdd -v="database" -t=77
$ format /D1 -sssd -r
Syntax
free [<opts>] {<devname>}
OS
OS-9; OS-9 for 68K
Options
-b[=]<num> Uses the specified buffer size in k bytes.
Description
The free utility displays the number of unused sectors on a device
available for new files or for expanding existing files.
The free utility also displays the disk’s name, creation date, cluster
size, and largest free block in bytes.
Note
OS-9:
Type free followed by the name of the device to examine. The device
name must be the name of a mass-storage, multi-file device.
Data sectors are allocated in groups called clusters. The number of
sectors per cluster depends on the storage capacity and physical
characteristics of the specific device.
Example OS-9
$ free /r0
Syntax
frestore [<opts>] [<path>]
OS
OS-9; OS-9 for 68K
Options
-a Forces access permission for
overwriting an existing file. You must be
the owner of the file or a super user (0.n)
to use this option. (OS-9 for 68K)
-a[=]<number> Consider media to begin after
<number> tape marks. (OS-9)
-b[=]<int> Specifies the buffer size in k bytes used
to restore the files.
-c Checks the validity of files without the
interactive shell.
-d[=]<path> Specifies the source device. The default
source device is /mt0.
-e Displays the pathlists of all files in the
index as the index is read from the
source device.
-f[=]<path> Restores from a file.
-i Displays the backup name, creation
date, group.user number of the owner of
the backup, volume number of the disk
or tape, and whether the index is on the
volume. This option does not restore any
files. The information is displayed, and
frestore is terminated.
Note
OS-9 for 68K: -j allows you to specify the size of the dynamic memory
requests made by the frestore utility. As the frestore utility builds
its index structure in memory, it requests additional memory from the
system as needed. Since the number of requests allowed is limited,
increasing the minimum request size may be needed on systems with
very large backups or with fragmented free memory.
Description
The frestore utility restores a directory structure from multiple
volumes of tape or disk media.
Typing frestore by itself on the command line attempts to restore a
directory structure from the device /mt0 to the current directory.
Specifying the pathlist of a directory on the command line causes the
files to be restored in the specified directory. The fsave utility creates
the directory structure and an index of the directory structure.
If more than one tape/disk is involved in the fdisk utility backup, each
tape/disk is considered a different volume. The volume count begins at
one (1). When you begin an frestore operation, you must use the last
volume of the backup first. The last volume of the backup contains the
index of the entire backup.
The frestore utility first attempts to locate and read in the index of the
directory structure from the source device. The device you are restoring
from is the source device. It then begins an interactive session with you
to determine which files and directories in the backup should be
restored to the current directory.
The -s option forces the frestore utility to restore all files/directories
of the backup from the source device without the interactive shell.
The -d option allows you to specify a source device other than /mt0.
The -v option causes the frestore utility to identify the name and
volume number of the backup mounted on the source device. It also
displays the date the backup was made and the group.user number of
the person who made the backup. This option does not restore any
files. After displaying the appropriate information, the frestore utility
terminates. This is helpful for locating the last volume of the backup if a
mix-up has occurred.
The -i option duplicates the -v option and also checks to see if the
index is on the volume being checked.
The -e option echoes each file pathlist as the index is read off the
source device.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See Using OS-9 for 68K or Using OS-9 for more information.
Examples
The following command restores files and directories from the source
device /mt0 to the current directory by way of an interactive shell.
$ frestore
The next command restores files and directories from the source device
/d0 to the current directory using a 32K buffer. As each file is read from
the index, the file’s pathlist is echoed to the terminal.
$ frestore -eb=32 -d=/d0
The next command restores all files/directories found on the source
device /mt1 to the directory BACKUP without using the interactive shell.
$ frestore -d=/mt1 -s BACKUP
The following command displays the backup and the volume number:
$ frestore -v
Backup: DOCUMENTATION
Made: 11/30/90 10:10
By: 0.0
Volume: 0
This command does not restore the backup.
Syntax
fsave [<opts>] [<dir>]
OS
OS-9; OS-9 for 68K
Options
-a Appends backup data to data already
existing on tape. (OS-9)
-b[=]<int> Allocate a <int> k byte buffer to read
files from source disk.
-d[=]<dev> Specifies the target device to store the
backup. The default target device is
/mt0.
-e Does not echo the file pathlist as it is
saved to the target device.
-f[=]<path> Saves to a file.
-g[=]<int> Specifies a backup of files owned by
group number <int> only.
-i Provides information about backup: the
amount of time it took to perform the
backup and the number of kilobytes per
second. (OS-9)
-j[=]<num> Sets the minimum system memory
request in k bytes. (OS-9 for 68K)
-l[=]<int> Specifies the level of backup to be
performed.
-m[=]<path> Specifies the pathlist of the date backup
log file to be used. The default is
/h0/sys/backup_dates.
Note
OS-9 for 68K: -j allows you to specify the size of the dynamic memory
requests made by the fsave utility. As the fsave utility builds its index
structure in memory, it requests additional memory from the system as
needed. Since the number of requests allowed is limited, increasing the
minimum request size may be needed on systems with very large
backups or with fragmented free memory.
Description
The fsave utility performs an incremental backup of a directory
structure to tape(s) or disk(s).
Typing fsave by itself on the command line makes a level 0 backup of
the current directory onto the target device /mt0.
Note
Prior to performing the first backup, a log file named backup_dates
must be created and must be completely blank (no end of file marks,
etc.). To create this blank file, type the following:
touch /h0/sys/backup_dates
As each file is saved to the backup device, its pathlist is echoed to the
terminal. If this is a long backup, use the -e option to turn off the
echoing of pathlists.
If the fsave utility receives an error when trying to backup a file, it
displays a message and continues the fsave operation.
If the backup requires more than one volume, the fsave utility prompts
you to mount the next volume before continuing.
At the end of the backup, the fsave utility prints the following
information:
fsave: Saving the index structure
! WARNING
When using disks for backup purposes, be aware that the fsave utility
does not use an RBF file structure to save the files on the target disk. It
creates its own file structure. This makes the backup disk unusable for
purposes other than the fsave and frestore utilities without
reformatting.
Any data on the disk before using the fsave utility is destroyed by the
backup.
Note
For a full description of the fsave, frestore, and tape utilities, refer
to Making Backups in Using OS-9 or Using OS-9 for 68K. The
information includes work through examples and backup strategies for
disk and tape.
Examples
The following command specifies a level 0 backup of the current
directory. It assumes the device /mt0 is to be used.
/h0/SYS/backup_dates is used as the backup log file.
$ fsave
This command specifies a level 2 backup of the current directory. The
device /mt1 is used. /h0/misc/my_dates is used as the backup log
file.
$ fsave -l=2 -d=/mt1 -m=/h0/misc/my_dates
The next command specifies a level 0 backup of all files owned by the
super user in the CMDS directory, assuming CMDS is in your current
directory. /d2 is the target device used for this backup. The backup log
Syntax
grep [<opts>] [<expression>] {[<path>]}
OS
OS-9; OS-9 for 68K
Options
-c Counts the number of matching lines.
-e=<expr> Searches for <expr>. This is the same
as <expression> in the command line.
-f=<path> Reads the list of expressions from
<path>.
-g Formats output similar to UNIX grep.
-i Searches for text, insensitive to
upper/lower case.
-l Prints only the names of the files with
matching lines.
-m=<num> Prints specified number of lines from
each matched occurrence.
-n Prints the relative line number within the
file followed by the matched expression.
-s Does not display matching lines. Silent
Mode.
-v Prints all lines except for those that
match.
-z Reads the file names from standard
input.
-z=<path> Reads the file names from <path>.
Description
The grep utility searches the input pathlists for lines matching
<expression>.
Type grep, the expression to search for, and the pathlist of the file to
search. If the <path> is not specified, the grep utility searches
standard input.
If the grep utility finds a line that matches <expression>, the line is
written to the standard output with an optional line number of where it is
located within the file. When multiple files are searched, the output has
the name of the file preceding the occurrence of the matched
expression.
Expressions
An <expression> specifies a set of characters. A string which is a
member of this set is said to match the expression. To facilitate the
creation of expressions, some metacharacters are defined to create
complex sets of characters.
Character Specification
Character Specification
Example Expressions
You can combine any meta-characters and normal characters to create
an expression:
Expression Same as
abcd abcd
Examples
To write all lines of myfile that contain occurrences of xyz to standard
output, enter:
$ grep xyz myfile
Syntax
help [<utility names>]
OS
OS-9; OS-9 for 68K
Description
The help utility displays information about a specific utility.
Type help and the name of the desired utility for information about any
utility. The help utility displays the function, syntax, and options of the
utility. After the information displays, control returns to the shell.
For information about the help utility, type help by itself. The help
utility lists the syntax and function of the help utility.
Note
Built-in shell commands do not have help information.
Examples
$ help build
$ help attr
Syntax
hist
OS
OS-9
Description
The hist utility is a built-in shell command that displays the commands
that you have already entered.
As commands are entered, they are stored in a buffer. This is a history
of your commands. To see the commands that you have entered, type
hist on the command line.
Commands residing in a buffer may be executed or retrieved using
tildes (~). One tilde followed by a number (~<num>) executes the
command that <num> points to. For example, entering ~4 on the
command line causes the shell to execute the fourth command in your
history list.
Entering a number after two tildes (~~<num>) places the command in
the command line buffer, just as if were the last command entered. For
example, if you type ~~3, the command is placed in a buffer as if it had
just been executed. By typing <control>A, you can retrieve the
command line. It is placed after the shell prompt. This allows you to edit
the command line before executing it.
A single tilde “~” followed by alphabetic characters specifies the most
recent command executed that began with those letters. For example:
~pro executes the most recent command line that began with the
letters “p”, “r”, and “o”.
Examples
[5]$ hist
Shell History
-------------
1) makdir /h0/usr/TMS
2) chd /h0/usr/tms
3) build stat
4) procs
5) hist
[6]$ ~4
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
3 2 6.10 128 5.25k 0 w 5.02 02:34 shell <>>>term
4 3 6.10 128 8.50k 0 * 0.08 00:00 procs <>>term
[7]$ hist
Shell History
-------------
3) build stat
4) procs
5) hist
6) procs
7) hist
[8]$ ~~3
[8]$ <control>A
[8]$ build stat
Syntax
ident {<option(s)>} {<modname>}
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-e Displays executable file edition (DOS
and UNIX only).
-h Prints hex numbers instead of decimals.
-m Searches for modules in memory.
-o Displays offset in memory of within file of
located module.
-q Quick mode. Only one line per module.
-qa Displays processor, OS revision, edition,
and CRC information.
-s Silent mode. Quick, but only indicates
modules with bad CRCs.
-x Searches for modules in the execution
directory (OS-9 and OS-9 for 68K only).
-z Reads the module names from standard
input.
-z=<file> Reads the module names from <file>.
Description
The ident utility displays module header information and the additional
information that follows the header from OS-9/OS-9 for 68K memory
modules.
The ident utility also checks for incomplete module headers.
The ident utility is capable of identifying modules for OS-9 for 68K,
OS-9/80386, and OS-9/PowerPC regardless of host OS.
The ident utility displays the following information in this order:
actual module name
module size
owner
CRC bytes (with verification)
header parity (with verification)
edition
type/language, and attributes/revision
access permission
For program modules it also includes:
execution offset
data size
stack size
initialized data offset
offset to the data reference lists
The ident utility prints the interpretation of the type/language and
attribute/revision bytes at the bottom of the display.
With the exception of the access permission data, all of the above fields
are self-explanatory. The access permissions are divided into four
sections from right to left:
owner permissions
group permissions
public permissions
reserved for future use
Each of these sections are divided into four fields from right to left:
read attribute
write attribute
execute attribute
reserved for future use
If the attribute is turned on, the first letter of the attribute (r, w, e) is
displayed.
Example
$ ident -m ident
Header for: ident
Module size: $1562 #5474
Owner: 0.0
Module CRC: $FA8ECA Good CRC
Header parity: $2471 Good parity
Edition: $C #12
Ty/La At/Rev: $101 $8001
Permission: $555 -----e-r-e-r-e-r
Exec. off: $4E #78
Data size: $15EC #5612
Stack size: $C00 #3072
Init. data off: $1482 #4250
Data ref. off: $151A #5402
Prog mod, 68000 obj, Sharable
Syntax
iniz [<opts>] {<devname>}
OS
OS-9; OS-9 for 68K
Options
-z Reads the device names from standard
input.
-z=<file> Reads the device names from <file>.
Description
The iniz utility performs an I$Attach (OS-9 for 68K), I_Attach
(OS-9) system call on each device name passed to it. This initializes
and links the device to the system.
Type iniz and the name(s) of the device(s) to attach a device to the
system. The operating system searches the system module directory
using the name of the device to see if the device is already attached.
If the device is not attached, an initialization routine is called to link the
device to the system.
If the device is attached, it is not re-initialized but the link count is
incremented.
The device names may be listed on the command line, read from
standard input, or read from a specified pathlist.
Note
Do not use the iniz utility to attach non-sharable device modules as
they become “busy” forever.
Examples
$ iniz h0 term Increments the link counts of modules
h0 and term.
$ iniz -z Increments the link count of any
modules with names read from standard
input.
$ iniz -z=/h0/file Increments the link count of all modules
whose names are supplied in
/h0/file.
Syntax
irqs [<opts>]
OS
OS-9; OS-9 for 68K
Description
The irqs utility displays a list of the system’s IRQ polling table. The
IRQ polling table contains a list of the service routines for each interrupt
handler known by the system.
The irqs utility display header lists the system name and the OS-9
version number.
For OS-9 for 68K, the irqs utility display header lists the system name,
the OS-9 for 68K version number, the maximum number of devices
allowed in the device table, and the maximum number of entries in the
IRQ table.
Each line in the OS-9 irqs utility display contains six fields:
Name Description
Name Description
dev list If the drivstat is also the driver device entry ‘dev
list’, then the ‘dev list’ entry displays, otherwise,
‘<na>’ displays.
If the ‘dev list’ entry displays, then option ‘-d’
displays additional information about the device.
Each line in the OS-9 for 68K irqs utility display contains seven fields:
Name Description
Name Description
Options
-? Displays the options.
-d Displays extended information about
available device list entries. (OS-9)
Example OS-9
The following example displays the IRQ polling table for a system
named Calvin:
$ irqs
$ irqs -d
vector prior port addr data addr irq svc driver device
------- ----- --------- --------- --------- --------- -------
68 0 $fffe1800 $00230b90 $00215084 am7990
69 5 $fffe4000 $003bd560 $00012ad2 scsi147
70 5 $fffe4000 $003bd560 $00012ad2 scsi147
72 0 $fffe1000 $00000000 $0000ccda tk147
88 5 $fffe3002 $003be3f0 $0000dacc sc8x30 term
88 5 $fffe3000 $003bd300 $0000dacc sc8x30 t1
89 5 $fffe3800 $002044a0 $0000dacc sc8x30 t3
89 5 $fffe3802 $003bbbe0 $0000dacc sc8x30 t2
90 5 $ffff1001 $003bc560 $0000e6b6 sc68560 t4
91 5 $ffff1041 $003bc120 $0000e6b6 sc68560 t5
255 5 $ffff8800 $00245a50 $002458e0 n9026 n0
See Also
_os_irq() Ultra C Library Reference Manual
_os_irq() OS-9 Technical Manual
F$IRQ system state service request
OS-9 for 68K Technical Manual
Syntax
kermit <mode>[<options>] <option arg>...
OS
OS-9; OS-9 for 68K
Options
d Verbose. The states the kermit utility
goes through are printed along with
other traces of its operation. A second,
third, and even fourth d flag causes the
kermit utility to give an even more
detailed trace.
e Escape. Allows you to set the first
character of the two character escape
sequence for connect mode. When you
type the escape character, the kermit
utility holds it and waits for the next
character.
If the next character is:
• c or C, the kermit utility closes the
connection with the remote host.
Description
The kermit utility is a protocol for transferring sequential files between
computers over asynchronous telephone lines. It provides for reliable
file transfer and primitive virtual terminal communication between
machines.
Note
Command line options must all be in the same context, “-cl” not
“-c -l”.
Note
The escape option must precede the connect option.
Modes
The kermit utility has six modes. The mode is specified by the first
flag. You can only specify one mode.
Mode Specification
h Host; make the OS-9 for 68K system a server. The Host
command has not been fully implemented and tested as
of this writing.
Examples
Example 1
On the OS-9 for 68K target, the kermit, lmm, and shell utilities, and
pipe capability must be present.
The following example is for loading a module into memory when it is
passed serially to the system. The lmm utility opens the pipe and waits
for a module to be placed serially into the pipe. The kermit utility waits
to receive a binary file from the current port and places the file into the
pipe to be read by the lmm utility.
To initiate the process type the following on the OS-9 for 68K shell:
$ lmm /pipe/hello&
$ kermit rik >-/pipe/hello
Once this is done, break out of whatever communications software you
are running, then use the kermit utility to send the binary file down
from the host machine.
Example 2
For the next example, assume two OS-9 for 68K machines. You are
logged on OS-9a (the local machine), and want to communicate with
OS-9b (the remote machine). There is a modem on /t2. You want to
connect to OS-9b, then transfer file1 to that machine.
• Type:
kermit cl /t2
The kermit utility answers:
kermit: connected...
• Dial the remote machine and connect the modem.
Anything typed on the terminal is sent to the remote machine.
Output from that machine is displayed on your terminal.
• Press <return>.
After all the transfers are done, you should connect again, log out of
OS-9b, kill the Connect kermit utility and hang up the phone.
Note
You do not need to exit the connect mode kermit as shown above;
you can escape to a shell from within it, and from that shell invoke
kermit in send or receive mode.
Miscellaneous Notes
To maximize throughput and avoid inefficient constructs such as busy
wait loops for timing out, the OS-9 for 68K kermit utility uses the
SS_RDY and SS_SSIG status requests and reads all pending
characters from the communications port. Therefore, it does not work
on devices for which SS_RDY and SS_SSIG are not supported, and
does not work efficiently on devices for which the SS_RDY does not
return a correct count of pending characters. The latter condition is
peculiar to extremely old SCF device drivers which would return one
rather than the true count of pending input characters.
The kermit utility can interrupt a file transfer. The OS-9 for 68K
kermit utility now notices X and Z in ACK packets, and recognizes
<control >x and <control>z in local non-server mode.
The kermit utility protocol uses only printing ASCII characters,
<control>a, and CRLF. Therefore, he OS-9 for 68K kermit utility
leaves the XON/XOFF fields of the path descriptors it uses intact to
avoid buffer overruns unless you specify the x option.
Since BREAK is not an ASCII character, the OS-9 for 68K kermit utility
cannot send a BREAK to the remote machine. On some systems, a
BREAK is read as a NUL.
The OS-9 for 68K kermit utility supports timeouts, so that it is stable
when communicating with “dumb” versions of the kermit utility that do
not have timeouts.
Errors
cannot open device Wrong permissions.
could not create file A Receive kermit could not create the
file being sent to it.
nothing to connect to A Connect kermit was started without
a line argument.
can’t stat You are attempting to kermit across a
device whose driver does not support
the SS_RDY getstat call.
See Also
lmm
Syntax
kill [<opts>] {<procID list>}
OS
OS-9; OS-9 for 68K
Options
-<num> Signal value to send
Description
The kill utility is a built-in shell command. It sends a signal to the
processes having the specified process ID numbers.
If no signal value is specified, the SIGKILL signal is sent which
unconditionally terminates the processes.
Type kill, and the ID number(s) of the process(es) to send the signal.
The processes must have the same user ID as the user executing the
command. Use procs to obtain the process ID numbers.
If a process is waiting for I/O, it cannot die until it completes the current
I/O operation. Therefore, if you kill a process and procs shows it still
exists, the process is probably waiting for the output buffer to be flushed
before it can die.
The command kill 0 kills all processes owned by the user.
Note
Because kill is a built-in shell command, it does not appear in the
CMDS directory.
Syntax
link [<opts>] {<modname>}
OS
OS-9; OS-9 for 68K
Options
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The link utility locks a previously loaded module into memory.
Type link and the name(s) of the module(s) to lock into memory.
The link count of the module specified increments by one each time it is
linked.
Use unlink to unlock the module when it is no longer needed.
Examples
$ link prog1 prog2 prog3
$ link -z=linkfile Links modules from linkfile.
$ link -z Links modules from standard input.
Syntax
list [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The list utility displays text lines from the specified path(s) to
standard output.
Type list and the pathlist.
The list utility terminates when it reaches the end-of-file of the last
input path. If more than one path is specified, the first path is copied to
standard output, the second path is copied next, and so on. Each path
is copied to standard output in the order specified on the command line.
The list utility is most commonly used to examine or print text files.
Examples
To redirect the listing, startup, to the printer and place the entire
command in the background, enter:
$ list /d0/startup >/P&
The following example lists text from files to standard output in the
same order as the command line:
$ list /D1/user5/document /d0/myfile /d0/Bob/text
To list all files in the current data directory, enter:
$ list *
The following example reads the name(s) of the file(s) to list from
namefile and lists their contents.
$ list -z=namefile
The following line lists the contents of the named pipe staff while
consuming all the data from the pipe.
$ list /pipe/staff
Syntax
lmm [<options>] <pathlist>
OS
OS-9; OS-9 for 68K
Options
-q Runs in quiet mode; do not exit with
error.
-u Do not attempt to unload old module.
Description
The lmm utility loads the module at the specified pathlist.
Use lmm to initiate a process to load a memory module from a pathlist.
The filename of the pathlist must be the same as the module that you
wish to load.
The lmm utility may be run as a background process (&).
The lmm utility performs the following steps:
1. Checks the pathlist for existence each second for two minutes until it
exists. If after two minutes the pathlist does not appear, then the
lmm utility exits.
2. Reads a module header from the path.
3. Infers the module name from the pathlist by stripping any preceding
pathlist components from the pathlist.
For example, each of the following pathlists has an inferred module
name of testmod:
/h0/TEST/testmod
/pipe/testmod
testmod
Example
The following example starts the lmm utility in the background and then
uses kermit to download a module in the foreground. It demonstrates
the method that you might use to load a module on a ROM-based
system.
$ lmm /pipe/testmod &
+118
$ kermit rik >-/pipe/testmod
$ mdir testmod
Module Directory at 14:05:09
testmod
See Also
kermit
Syntax
ln <link to create> <file to link to>
OS
OS-9
Description
The ln utility creates a directory entry as specified as the first argument
that refers to the same file descriptor as the second argument.
Type ln, the pathlist of the hard link you want to create and the pathlist
of the file you want to link to.
Examples
ln /h0/DEFS/errno.h /h0/MWOS/OS9000/SRC/DEFS/errno.h
ln /h0/CMDS/ls /h0/CMDS/dir
Syntax
load [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-c=<color> Specifies a specific memory color in
which to load the module.
-d Loads the file from your current data
directory, instead of your current
execution directory.
-d=<path> Specifies path relative to current data
directory from which to load the module.
-i Ignore errors loading modules and keep
going.
-l Prints the pathlist of the file loaded.
-s Loads “sticky” modules only.
-w=<moddir> Loads modules into module directory
<moddir>. (OS-9 only)
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The load utility loads one or more modules specified by <path> into
memory.
File Security
The file security mechanism enforces certain requirements regarding
owner and access permissions when loading modules into the module
directory.
You must have file access permission to the file to be loaded. If the file
is loaded from an execution directory, the execute permission (e) must
be set. If the file is loaded from a directory other than the execution
directory and the -d option is specified, only the read permission (r) is
required.
Note
Unless the file has public execute and/or public read (OS-9: group
execute/group read) permissions, only the owner of the file or a super
user can load the file. Use the dir -e command to examine a file’s
owner and access permissions.
Example
$ mdir
Module Directory at 14:44:35
kernel init p32clk rbf p32hd
h0 p32fd d0 d1 ram
r0 dd mdir
$ load edit
$ mdir
Module Directory at 14:44:35
kernel init p32clk rbf p32hd
h0 p32fd d0 d1 ram
r0 dd edit mdir
Syntax
login [<name>] [,] [<password>]
OS
OS-9; OS-9 for 68K
Options
-n Verifies a password entry’s contents.
If an entry exists for the name and
password supplied on the command line,
the information (except the password
itself) is printed to standard output.
This option operates in a non-interactive
mode.
Description
The login utility provides login security in timesharing systems.
It is automatically called by the timesharing monitor tsmon, or you can
explicitly call it after the initial login to change a terminal’s user.
The login utility requests a user name and password, which is
checked against a validation, or password file. If the information is
correct, the user’s system priority, user ID, and working directories are
set up according to information stored in the file. The login utility then
forks the pd utility to acquire the current working and execution
directories. The initial program specified in the password file is also
executed. This initial program is usually the shell utility. The date,
time, and process number also display.
If you cannot supply a correct user name and password after three
attempts, the login attempt is aborted.
Note
If you do not need the shell from which you called the login
utility, you may discard it using the ex utility to start the login
command: ex login.
To log off the system, you must terminate the initial program specified in
the password file. For most programs, including shell, you can do this
by typing an end-of-file character (escape) as the first character on a
line.
If the file motd exists in the SYS directory with the password file, a
successful login displays the contents of motd on your terminal
screen.
Using password file entries, the login utility sets the following shell
environment variables. Programs can examine these environment
variables to determine various characteristics of the user’s
environment:
Name Description
Note
Environment variables are case sensitive.
To show how the login utility uses the password file to set up
environment variables, examine the previous sample password file.
Assume login’s data and execution directories are /h0 and
/h0/CMDS, respectively, logging in as mean_joe executes a shell with
the data directory of /h0/Joe and the execution directory of
/h0/CMDS/Joe.
The environment variables passed to the shell are set as follows:
HOME=/h0/Joe
SHELL=shell
USER=mean_joe
PATH=/H0/Cmds
Syntax
logout
OS
OS-9; OS-9 for 68K
Description
The logout utility terminates the current shell. If the shell to terminate
is the login shell, the logout utility executes the .logout procedure
file before terminating the shell.
Type logout and a carriage return to terminate the current shell.
This terminates the current shell in the same manner as an end-of-file
character, with one exception. If the shell to be terminated is the login
shell, the logout utility executes the procedure file .logout.
The login shell is the initial shell created by the login utility when you
log on the system. In order for the logout utility to execute the
.logout file, .logout must be located in the directory specified by
the HOME environment variable.
Note
These commands do not appear in the CMDS directory as they are built
in to the shell.
Example
3.lac: list .logout
procs
wait
date
echo "see you later. . ."
3.lac: logout
2.lac: logout
1.lac: logout
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 1 0.0 128 0.25k 0 w 0.01 ??? sysgo <>>>term
3 2 0.0 128 4.75k 0 w 4.11 01:13 shell <>>>term
4 3 0.0 128 8.50k 0 * 0.08 00:00 procs <>>term
5 0 0.0 128 4.00k 0 s 0.02 01:12 tsmon <>>>t1
July 7, 1989 11:59 pm
see you later . . .
Syntax
makdir [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-p Creates all missing components of the
specified path.
-q Quiet mode.
-x Creates the directory in the execution
directory.
-z Reads the directory names from
standard input.
-z=<file> Reads the directory names from
<file>.
Description
The makdir utility creates a new directory file specified by the given
pathlist.
Type makdir and the pathlist specifying the new directory.
You must have write permission for the new directory’s parent directory.
The new directory is initialized and does not initially contain files except
for the pointers to itself (.) and its parent directory (..). All access
permissions are enabled except single use, or non-sharable.
Examples
$ makdir /d1/STEVE/PROJECT
Creates directory project in /d1/STEVE
Syntax
os9make {<option(s)>} [<target>] {[<target>]}
[<macros>]
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-b Does not use built-in rules.
-bo Does not use built-in rules for object
files.
-d Prints the dates of the files in the
makefile (debug mode).
-dd Double debug mode. Very verbose.
-e Imports environment variables as
macros in the makefile.
-ee Forces imported environment variables
(implies -e flag) to override all other
macro definitions. This includes
command line definitions unless -ll is
in effect.
-f- Reads the makefile from standard input.
-f[=]<path> Specifies <path> as the makefile. If you
do not specify -f- or -f=<path>,
os9make looks for a file named
makefile. If <path> is specified as a
hyphen (-), os9make commands are
read from standard input.
-i Ignores errors.
Description
The os9make utility determines whether a file needs to be updated. It
examines the dates of the target file and the files used to create the
target file. If the os9make utility determines that the file must be
updated, it executes specified commands to recreate the file.
The os9make utility has several built-in assumptions specifically
designed for compiling high-level language programs; however, you
may use os9make to maintain any files dependent on updated files.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
For more information about the os9make Utility, see Chapter 4: Using
the os9make Utility.
If the os9make utility is called without a target file on the command line,
the os9make utility attempts to make the first target file described in the
makefile. If one or more target file is entered on the command line, the
os9make utility reads and processes the entire makefile and only
attempts to make the appropriate file(s).
Syntax
makmdir [<opts>] {<module directory>}
OS
OS-9; OS-9 for 68K
Options
-z Reads the module directory names from
standard input.
-z=<file> Reads the module directory names from
<file>.
Description
The makmdir utility creates a new module directory.
Type makmdir, the module directory pathlist and any desired options to
create a new directory.
You must have write permission for the new directory’s parent module
directory. The new module directory is created with all of the access
permissions enabled. A module directory’s access permissions can be
changed using the mdattr utility.
It is an OS-9 convention to capitalize module directory names.
Note
The makmdir utility only searches the current module directory for a
specified module when creating a new module directory.
For example, if USER is your current module directory and you want to
make a new directory in a directory called TEST, OS-9 does not search
the alternate module directories for a module directory named TEST.
Examples
$ makmdir USERS
$ makmdir ../UTILS
$ makmdir -z=/h0/sys/users
Syntax
maps [<opts>]
OS
OS-9 for 68K
Options
-l Loops printing process information.
-m Prints map of memory usage.
-p=<id> Prints information for process <ID>.
-r Prints ranges of memory used.
-w Shows write permissions in map.
Description
Prints information about process memory usage.
Syntax
mdattr [<opts>] {<module directory> <permissions>}
OS
OS-9
Options
-a Suppresses the printing of attributes.
-z Reads the module directory names from
standard input.
-z=<file> Reads the module directory names from
<file>.
Description
The mdattr utility changes the security (access) permissions of a
module directory.
Type mdattr, followed by the module directory name whose security
permissions are to be changed or examined. Then enter a list of
permissions which are to be turned on or off.
A permission is turned on by giving its abbreviation preceded by a
hyphen (-[abbr]). It is turned off by preceding its abbreviation with a
hyphen followed by the letter n (-n[abbr]). Permissions not explicitly
named are not changed.
If permissions are not specified on the command line, the module
directory attributes display.
You cannot examine or change the attributes of a module directory you
do not own unless you are the super user. A super user can examine or
change the attributes of any module in the system.
The module directory permission abbreviations are:
Note
The owner is the creator of the module directory. Owner access is
allowed to any user with the same user ID number as the owner.
The group is any user with the same group ID number. The user ID
number and the group ID number are combined to form a group.user ID
number.
The public is any user with a different group.user ID number than the
owner.
Examples
$ mdattr sc83 Displays the current attributes of
sc83.
$ mdattr sc83 -npr -npw Turns off the public read and public
write permissions.
$ mdattr sc83 -rwprpw Turns on both the public and owner
read and write permissions.
$ mdattr -z Displays the attributes of the module
directory names read from standard
input.
See Also
makmdir
mdir
Syntax
mdir [<opts>] [<modname>]
OS
OS-9; OS-9 for 68K
Options
-a Displays the language field instead of
the type field in an extended listing.
-e Displays the extended module directory.
-r Displays directories recursively. (OS-9)
-t=<type> Displays only the modules of the
specified type.
-u Displays an unformatted listing used for
piping output.
Description
OS-9 for 68K: The mdir utility displays the present module names in
the system module directory. The system module directory contains all
modules currently resident in memory. By specifying individual module
names, only specified modules are displayed (if resident in memory.)
OS-9: The mdir utility displays the present module names in the
specified module directory. You may use either a full or relative pathlist
when specifying a module directory. By specifying individual module
names, only specified modules are displayed if resident in memory.
If you use -e, the mdir utility displays an extended listing of the
physical address, size, owner, revision level, user count, and the type of
each module.
Mnemonic Description
Note
User-defined modules not corresponding with this list are displayed by
their number.
Mnemonic Description
C C I Code
Note
If the language field is inappropriate for the module, a blank field is
displayed. For example, d0, t1, or init.
! WARNING
Not all modules listed by the mdir utility are executable as processes;
always check the module type code to make sure it is executable before
executing an unfamiliar module.
Examples
To save space, the following examples are incomplete. Module
directories are generally much larger.
$ mdir
Module Directory at 15:32:38
$ mdir -ea
Addr Size Owner Perm Lang Revs Ed # Lnk Module name
-------- -------- ------- ---- ---- ---- ---- ----- ---- -------
00006f00 27562 0.0 0555 Obj a000 83 2 kernel
0000daaa 368 0.0 0555 Obj a000 10 1 syscache
0000dc1a 1682 0.0 0555 Obj a000 29 1 ssm
0000e2ac 622 0.0 0555 8000 20 0 init
0000e51a 322 0.0 0555 Obj a000 7 1 tk147
0000e65c 494 0.0 0555 Obj a000 8 0 rtclock
0000e84a 8952 0.0 0555 Obj e000 79 26 rbf
Syntax
merge {<option(s)>} {<path>}
merge OS
OS-9; OS-9 for 68K
os9merge OS
DOS; UNIX
Options
-a[=]<num> File alignment. Default is 1.
-b[=]<size> Allocates <size> k bytes for use by
merge. The default memory size is 4K.
-o[=]<file> Output file. Default is stdout.
-x Searches the current execution directory
for files to be merged (merge only).
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The merge utility copies multiple input files specified by <path> to
standard output.
The merge utility is commonly used to combine several files into a
single output file.
Data is copied in the order the pathlists are specified on the command
line.
The merge utility does no output line editing such as automatic line
feed.
The standard output is generally redirected to a file or device.
Examples
$ merge compile.list asm.list >/p
$ merge file1 file2 file3 file4 >combined.file -b=32k
$ merge -x load link copy >Utils1
$ merge -z=/h0/PROGS/file1 >merged_files
Syntax
mfree [<opts>]
OS
OS-9; OS-9 for 68K
Options
-e Displays an extended free memory list.
-s Displays system information summary.
Description
The mfree utility displays a list of areas in memory not presently in use
and available for assignment.
The address and size of each free memory block are also displayed.
Examples
$ mfree
Current total free RAM: 1392.00 K-bytes
$ mfree -e
Minimum allocation size: 4.00 K-bytes
Number of memory segments: 25
Total RAM at startup: 4095.00 K-bytes
Current total free RAM: 1392.00 K-bytes
Free memory map:
Segment Address Size of Segment
----------------- --------------------------
$55000 $7000 28.00 K-bytes
$6A000 $B000 44.00 K-bytes
$80000 $8A000 552.00 K-bytes
$10E000 $1A000 104.00 K-bytes
$12F000 $1E000 120.00 K-bytes
$151000 $60000 384.00 K-bytes
$1B5000 $2000 8.00 K-bytes
Syntax
mkdatmod -tp=<name> {<option(s)>} <in-file>
<out-file>
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-b[=]<size>[k|K] Specifies the size of the copy buffer.
<size> is always in K bytes, k or K is
optional/ignored. The default memory
size is 32K.
-n[=]<name> Name of data module
(default=<in-file>
-r Reverse operation (take off module
header/footer)
-to[=]<name> Specify target operating system, where
<name> is the target operating system:
os9 or osk OS-9 for 68K
os9000 or os9k OS-9
-tp[=]<name> Specify target processor and options,
where <name> is the target processor:
386 or x86 Intel x86 (386+) family
68k Motorola 68k family
arm ARM family
mips MIPS family
ppc PowerPC(™) family
sh or sh3 Hitachi SH3 family
sh4 Hitachi SH4 family
sparc SPARC family
Description
The mkdatmod utility packages a file into a data module. mkdatmod
can also strip the header adn footer off an existing data module.
To creat a data module, type mkdatmod, the processor type of the
destination module (using the -tp option), followed by the source file
<in-file> and the destination data module <out-file>. The
created data module <out-file> retains <in-file> as the module
name unless specified otherwise with -n[=]<name>.
To reverse the operation and strip the header and footer off and existing
data module, type mkdatmod -r, followed the by the data module
<in-file> and the destination file <out-file>.
Note
mkdatmod automatically calls the fixmod utility during data module
creation to set the module parity and CRC (fixmod -u), so fixmod
must be accessible on your system.
Examples
$ mkdatmod -tp=ppc junk junkmod
Module: junk - Fixing header parity -Fixing module CRC
$ mkdatmod -r junkmod junk
See Also
fixmod
Syntax
moded [<opts>] [<path>]
OS
OS-9 for 68K
Options
-d[=]<path> Uses <path> for the field descriptions
(moded.fields).
-e[=]<path> Uses <path> for the error message file.
-f[=]<path> Specifies a file consisting of one or more
modules to load into the moded buffer.
Description
The moded utility edits individual fields of certain types of OS-9 for 68K
modules. Currently, you can use the moded utility to change the init
module and any OS-9 for 68K device descriptor module.
The moded utility can edit modules which exist in their own files or
modules which exist among other modules in a single file such as a
bootstrap file. The moded utility updates the module’s CRC and header
parity if changes are made.
Regardless of how you call the moded utility, you always enter the
editor’s command mode. This is designated by the moded: prompt.
If parameters are not specified on the moded command line, the current
module is not loaded into memory.
If a file is specified on the command line, it is assumed to contain a
module of the same name. This module is loaded into the editor’s buffer
and becomes the current module.
If the -f option is used, the specified file is loaded into the editor’s
memory. If a module of the same name exists in the file, it becomes the
current module. If the module does not exist, there is not a current
module.
If the -f option is used and a module name is specified on the
command line, the specified module becomes the current module.
You can execute the following commands from command mode:
Command Description
Edit Mode
To edit the current module, use the e command. If there is not a current
module, the editor prompts for the module name to edit. The editor
prints the name of a field, its current value, and prompts for a new
value. At this point, you can enter any of the following edit commands:
Command Specification
Command Specification
If the definition of any field is unfamiliar, use the ?? command for a short
description of the current field.
Once you have made all necessary changes to the module, exit edit
mode by reaching the end of the module or by typing a period.
At this point, the changes made to the module exist only in memory.
To write the changes to the actual file, use the w command. This also
updates the module header parity and CRC.
Value Specification
The device type value is only used when a device descriptor module
is being described. The following device type values are accepted.:
Value Specification
0 SCF
1 RBF
2 PIPE
3 SBF
Value Specification
4 NET
6 UCM
7 SOCKET
11 GFM
Value Specification
1 Byte
2 Word
3 3 byte value
4 Long word
Value Specification
<offset> specifies the offset of the field from the beginning of the
module. This is a hexadecimal value.
Note
For device-specific fields (see <name>), this offset is the offset of the
field within the DevCon section of the descriptor (and not the module
start).
Value Specification
0 ASCII
8 Octal
10 Decimal
16 Hexadecimal
<name> specifies the driver name for this and each field description
that follows until a new <name> is specified or a module type line is
encountered. This field is optional.
For example, <name> allows descriptors with DevCon sections
specific to certain drivers to be edited.
The following lines describe a “descriptor name” field:
descriptor name
5,c,0,0
The field consists of a long-word offset to a string. It is offset 12
bytes from the beginning of the module. The display base is in
ASCII.
3. Description lines
After the Field Descriptor lines, you can use any number of lines to
describe the field.
This description displays when the edit mode command, ??, is used.
Each description line must begin with an exclamation point (!) to
differentiate it from a Field Descriptor. These lines are optional, but
they are useful when editing uncertain module fields.
The following lines might be used to describe the example used for
the Field Descriptor:
! This field contains the name that the descriptor
! will be known by when in memory.
4. Repeated Sequences.
Braces ({ })can be used to surround a sequence of field descriptor
and description lines to imply that the sequence is repeated one or
more times.
The fields are assumed to be repeated within the descriptor until the
value of the first field is zero. The offset values used within the
repeated sequence determine the format of each structure.
Syntax
mshell
OS
OS-9; OS-9 for 68K
Description
MShell is a command interpreter designed to help you become as
productive as possible when working with the OS-9/OS-9 for 68K
operating systems. It accomplishes this by providing keyboard
shortcuts and a means to automate menial tasks. It is compatible with
the current OS-9/OS-9 for 68K shell.
MShell started as a port of the OS-9 standard shell to OS-9 for 68K.
From that point, enhancements replaced some built-in features of OS-9
and features unique to MShell were added. Now, MShell contains
many of the same features as UNIX shells, as well as some OS-9/OS-9
for 68K specific options.
MShell Features
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
mv Move a File/Directory
From One Directory to Another
Syntax
mv [<opts>] <srcpath> [<srcpaths>] [<dstpath>]
OS
OS-9; OS-9 for 68K
Options
-f Forces move even if the <srcpath> is
write-protected. (OS-9)
-r Rewrites existing files. (OS-9)
-w[=]<dir name> Moves specified file(s) to <dir name>.
(OS-9)
-x Gets files from execution directory.
-z Gets file names from standard input.
-z[=]<file> Gets file names from <file>.
Description
The mv utility moves a file or directory from one directory into another.
You can also use the mv utility to do a rename operation although the
rename utility is better suited for this purpose.
Type mv, the pathlist of the file or directory to move, then the pathlist of
where it is to be moved. If more than one file is to be moved, type mv,
the names of the files to be moved separated by spaces. Use the -w
option to specify the directory where the files are to be moved.
Examples
Move joe from CMDS to CMDS/DAVEL.
$ mv CMDS/joe CMDS/DAVEL/joe
Description
Refer to cmp, os9cmp.
Description
Refer to del, os9del.
Description
Refer to dump, os9dump.
Syntax
os9gen [<opts>] <devname> {<path>}
OS
OS-9 for 68K
Options
-b[=]<num> Allocates <num> k bytes for use by
os9gen. The default memory size is
64K.
-e Allows you to use large (greater than
64K) and/or non-contiguous files.
Extended Boot. Bootstrap ROMs must
support this feature.
-q[=]<file> Set sector zero pointing to <file>.
Quick Boot.
-r Removes the pointer to the boot file.
This file is not deleted.
-x Searches the execution directory for
pathlists.
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The os9gen utility creates and links the OS9Boot file required on any
disk from which OS-9 for 68K is to be bootstrapped.
You can use the os9gen utility to:
• Make a copy of an existing boot file.
Note
Only super users (0.n) may use this utility. Also, you can only use the
os9gen utility on format-enabled devices.
After all input files are copied to TempBoot, any existing OS9Boot file
on the target device is renamed OldBoot. If an OldBoot file is already
present, the os9gen utility deletes it before renaming OS9Boot.
TempBoot is then renamed OS9Boot. Its starting address and size are
linked in the disk’s Identification Sector (LSN 0) for use by the OS-9 for
68K bootstrap firmware.
If your boot file is non-contiguous or larger than 64K, use the -e option.
Note
Your bootstrap ROMs must support this feature. If they do not, you
should not use this option.
If you use the -z option, the os9gen utility first uses the files specified
on the command line and then the file names from its standard input, or
from the specified pathlist, one pathlist per line. If the names are
entered manually, no prompts are given and the end-of-file key (usually
<escape>).
Examples
This command manually installs a boot file on device /d1 which is an
exact copy of the OS9Boot file on device /d0.
$ os9gen /d1 /d0/os9boot
The following three methods manually install a boot file on device /d1.
The boot file on /d1 is a copy of the OS9Boot file on device /d0 with
the addition of modules stored in the files /d0/tape.driver and
/d2/video.driver:
Method 1
$ os9gen /d1 /d0/os9boot /d0/tape.driver /d2/video.driver
Method 2
$ os9gen /d1 /d0/os9boot -z
/d0/tape.driver
/d2/video.driver
[ESCAPE]
Method 3
$ os9gen /d1 -z
/d0/os9boot
/d0/tape.driver
/d2/video.driver
[ESCAPE]
You can automatically install a boot file by building a bootlist file and
using the -z option to either redirect the os9gen utility’s standard input
or use the specified file as input:
$ build /d0/bootlist Create file bootlist
? /d0/os9boot Enter first file name
? /d0/tape.driver Enter second file name
? /d2/video.driver Enter third file name
? * V1.2 of video driver Comment line
? [RETURN] Terminate build
$ os9gen /d1 -z </d0/bootlist Redirects standard input
$ os9gen /d1 -z=/d0/bootlist Reads input from pathlist
Note
The os9gen utility treats any input line preceded by an asterisk (*) as
a comment.
The following command makes the OldBoot file the current boot and
saves the current OS9BOOT file as OldBoot:
$ os9gen /d1 -q=oldboot
Description
Refer to os9make.
Description
Refer to merge, os9merge.
Syntax
p2init <module>
OS
OS-9; OS-9 for 68K
Description
Use the p2init utility to install OS9P2 modules.
Note
Only the super user may use this utility.
Note
For Version 3.0 of OS-9/Atomic OS-9 for 68K, FPU and FPSP math
emulation modules may not be installed with the p2init utility.
Syntax
padrom {<option(s)>} <size> <file> [<file>]
OS
OS-9; OS-9 for 68K
Options
-b[=]<num>[k] Specifies the buffer size in bytes to use.
The ‘k’ sub-option converts <num> to k
bytes. The default is 16k.
Description
Use the padrom utility when making the ROMs for OS-9 Board Support
Packages (BSP).
The padrom utility appends bytes with a hex value of FF to the named
file, extending the file to the specified <size>.
Examples
The following shows how to use the padrom utility to extend the size of
the booter and modules files.
$ dir -e booter modules
Owner Last modified Attributes Sector Bytecount Name
------- ------------- ---------- ------ --------- ----
0.29 93/11/12 1142 ------wr 1CEB38 12153 booter
0.29 93/11/12 1143 ------wr 1CEB48 256 modules
If you try to pad a file to a size smaller than its current size, the padrom
utility displays the following message.
$ padrom 0x2000 booter
padrom: file booter already bigger than 8192
This example specifies a hex value for <size>.
Syntax
park [<opts>] [<device>] [<opts>]
OS
OS-9
Description
The park utility parks hard drive heads.
Syntax
paths [<opts>] [<process id list>]
OS
OS-9; OS-9 for 68K
Options
-e Displays all processes of all users.
Description
The paths utility displays path information about processes running on
the system owned by the user invoking the routine.
Processes can switch states rapidly, usually many times per second.
Therefore, the display is a snapshot taken at the instant the command
is executed and shows only those processes running at that exact
moment.
Display information about specific processes by listing their process IDs
in <process id list>.
The paths utility with no options displays ten pieces of information for
each process:
Name Specification
Id Process ID
Name Specification
Examples
$ paths -e
Id PId Grp.Usr MemSiz Module & I/O
2 0 0.0 4.00k sysgo <h0:startup >>>term 3)term
3 2 0.0 52.00k mshell <>>>term
22 0 0.0 32.00k telnetdc <pks00 4)pkm00 5)nil 6)socket
30 0 0.0 20.00k routed <>>>nil 3)socket
31 0 0.0 2.00k ifman
32 0 0.0 2.00k sockman
35 0 0.0 24.00k telnetd <>>>nil 3)socket
36 0 0.0 24.00k ftpd <>>>nil 3)socket
37 22 0.190 52.00k mshell <>>>pks00
52 37 0.190 44.00k umacs <>>>pks00
55 3 0.0 40.00k paths <>>>term
56 0 0.0 64.00k ftpdc <>socket >>nil
Syntax
partition [<opts>] <device name> [<descs>] [<opts>]
OS
OS-9 for 68K
Options
-r Replace any existing files.
-w=<dir> Write partition descriptors to specified
directory <dir>. Default is current
directory.
-z=<file> Reads names of partition descriptors
from <file>.
Description
OS-9 for 68K logical disk drives are limited to approximately 4GB in
size. The partition utility facilitates breaking a large (greater than 4GB)
drive up into a number of smaller logical drives. Using the partition
utility, the size of each partition is specified after which a device
descriptor is created for each partition. The created device descriptors
can then be read in by the partition utility to allow subsequent
modification of the partitions.
The partition utility takes the name of the device to be partitioned as
follows:
partition /h0
The first action of partition is to create partitions for any space on
the device that is not allocated. If descriptors for existing partitions were
included on the command line or via the -z option, only the space not
covered by those descriptors will be allocated. After completing the
initial allocation, the following options display:
1. create new partition
Exit (8)
This option exits the partition utility. If partition sizes have changed
since the partitions were formatted, the user is prompted as to whether
a format should be done. If the answer is yes, the Format All
Partitions (7) option is invoked. If partition information has
changed since the last time the device descriptors were written, you are
prompted as to whether or not the descriptors should be written before
exiting.
Syntax
pcformat [<opts>] {<devname>}
OS
OS-9
Options
-N Don’t create file system; just print out
parameters
-B <path> Get bootstrap from file
-F <type> FAT type (12, 16, or 32)
-I <value> Volume ID
-L <str> Volume label (up to 11 chars)
-O <str> OEM string
-S <count> Bytes/sector
-a <count> Sectors/FAT
-b <count> Block size
-c <count> Sectors/cluster
-e <count> Root directory entries
-f <count> Standard format (sectors per track)
-h <count> Drive heads
-i <sec> File system info sector
-k <sec> Backup boot sector
-m <type> Media descriptor (0xf0, etc.)
-n <count> Number of FATs
-o <count> Hidden sectors
Description
The pcformat utility creates a PC file system on a low-level formatted
random access device under PCF. It does not do low-level formatting or
sector integrity checking. Instead, pcformat uses information in the
device descriptor to create an empty PC file system that can then be
used with PCF.
For many removable media devices, it is important to verify that the
media being formatted has been low-level formatted and is free from
errors. The low-level formatting and error checking should be done
using the format utility.
The pcformat utility can format FAT12, FAT16 and FAT32 file
systems with a variety of options.
Note
PCF and pcformat support FAT12, FAT16, and FAT32 file formats.
Although PCF and pcformat have been tested to interoperate well,
some FAT32 file system configurations are not supported by
Windows®. It is recommended that FAT32 be used only on partitions
2GB and larger.
Syntax
pd [<opts>]
OS
OS-9; OS-9 for 68K
Options
-a Displays all directory paths.
-d Displays the current data directory.
-m Displays the current and alternate
module directory paths. (OS-9)
-x Displays the path to the current
execution directory.
Description
The pd utility displays a pathlist showing the path from the root directory
to your current data directory.
Programs can use the pd utility to discover the actual physical location
of files or by users to find their whereabouts in the file system.
The command pd -x displays the pathlist from the root directory to the
current execution directory.
$ pd
/d1/STEVE/TEXTFILES/MANUALS
$ chd ..
$ pd
/d1/STEVE/TEXTFILES
$ chd ..
$ pd
/d1/STEVE
$ pd -x
/d0/CMDS
Syntax
pinfo <device name>
OS
OS-9
Description
Although OS-9 only supports the use of four primary partitions it is
possible to use DOS extended partitions with the PCF file manager.
To use DOS extended partitions device descriptors must be created
which include the ’logical sector offset’ to the partition desired. Further,
the ’logical unit number’ must match the extended partition primary
entry.
To aid in creation of PCF DOS extended descriptors for OS-9, the
pinfo utility may be used.
The pinfo utility displays the value of the ’logical unit number’ and
’logical sector offset’ required to create the new descriptor. Also, the
"FMGR" section shows if the given partition is supported by PCF.
The pinfo utility displays information related to the way your hard disk
is currently partitioned. If the partitions are changed new descriptors for
the extended partitions are required.
The pinfo utility expects one argument, the device name. The device
name should be the name of the RAW device descriptor and not a
descriptor based on a partition.
IDE:/hcfmt or /hdfmt
SCSI:/hs0fmt, /hs1fmt through /hs7fmt
Primary Partitions
Partition LUN LSNOFFS Par_Type FMGR
----------------------------------------------------------
01 01 0x00000000 DOS 16-bit FAT >=32M PCF
02 02 0x00000000 DOS Extended NA
03 03 0x00000000 EMPTY NA
04 04 0x00000000 EMPTY NA
1. module header
2. Device descriptor data definitions
3. PCF path options
4. PCF Logical Unit Static Storage
Which? [?/1-4/p/t/a/w/q] 1
1. module owner’s group number : 0
2. module owner’s user number : 0
3. module name : "mhc1"
4. access permissions : 0x555
5. type/lang : 0xf01
6. rev/attr : 0x8000
7. edition : 1
Which? [?/1-7/p/t/a/w/q] 3
module name : "mhc1"
New string: mhc5
Which? [?/1-7/p/t/a/w/q] p
Which? [?/1-4/p/t/a/w/q] p
1. module header
2. Device descriptor data definitions
3. PCF path options
4. PCF Logical Unit Static Storage
Which? [?/1-4/p/t/a/w/q] 3
1. number of surfaces : 5
2. verify disk writes (0=verify) : 1
3. device format : 0x8003
4. number of cylinders : 930
5. default blocks/track : 17
6. default blocks/track for trk0 : 17
7. segment allocation size : 1
8. block interleave offset : 1
9. track base offset : 0
10. block base offset : 0
11. # tries : 7
12. size of block in bytes : 512
13. control word : 0x7
14. first write precomp cylinder : 128
15. first reduced write current cylinder : 930
16. park cylinder for hard disks : 0
17. lsn offset for partition : 0
18. max transfer size in terms of bytes : 0x10000
Which? [?/1-18/p/t/a/w/q] 17
lsn offset for partition : 0
New value: 0x00064680
1. number of surfaces : 5
2. verify disk writes (0=verify) : 1
3. device format : 0x8003
4. number of cylinders : 930
5. default blocks/track : 17
6. default blocks/track for trk0 : 17
7. segment allocation size : 1
8. block interleave offset : 1
9. track base offset : 0
10. block base offset : 0
11. # tries : 7
12. size of block in bytes : 512
Which? [?/1-4/p/t/a/w/q] p
1. module header
2. Device descriptor data definitions
3. PCF path options
4. PCF Logical Unit Static Storage
Which? [?/1-4/p/t/a/w/q] 2
1. device port address : 0x1f0
2. logical unit number : 1
3. path descriptor size : 0x168
4. device type : 10
5. device mode capabilities : 0xffff
6. file manager name : "pcf"
7. driver name : "rb1003"
8. sequential or random : 2
Which? [?/1-8/p/t/a/w/q] 2
logical unit number : 1
New value: 1
1. device port address : 0x1f0
2. logical unit number : 1
3. path descriptor size : 0x168
4. device type : 10
5. device mode capabilities : 0xffff
6. file manager name : "pcf"
7. driver name : "rb1003"
8. sequential or random : 2
Which? [?/1-8/p/t/a/w/q] w
Which? [?/1-8/p/t/a/w/q] q
$ editmod -dPORT -l mhc5
Method 3. If you want to automate the procedure show for Method 2, you can
create script files to do the same job.
-nx -t
copy mhc1 mhc5 -rf
editmod -e -dPORTS mhc5 >>>/nil
1
3
mhc5
p
p
3
17
0x00064680
p
p
2
2
1
w
q
Syntax
pr [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
An equal sign (=) specifies the additional parameters are optional.
-c[=]<char> Uses <char> as the specified column
separator. A <space> is the default
column separator.
-d[=]<num> Specifies the actual page depth in lines
(default is 66).
-f Pads the page using a series of \n (new
line), instead of a \f (form feed).
-h[=]<num> Sets the number of blank lines after title
line. The default is 5.
-k[=]<num> Sets the <num> columns that the output
file prints for multi-column output.
-l[=]<num> Sets the left margin to <num>. The
default is 0.
-m Prints files simultaneously, one file per
column. If three files are given on the
command line, each file is printed in its
own column on the page.
-n[=]<num> Specifies the line numbering increment:
<num>. The default is 1.
-o Truncates lines longer than the right
margin. By default, long lines are
wrapped around to the next line.
Description
The pr utility produces a formatted listing of one or more files to the
standard output.
Type pr and the pathlist(s) of the files to list. The listing is separated
into pages. Each page has the page number, the name of the listing,
and the date and time printed at the top.
The pr utility can produce multi-column output. When printing multiple
output columns with the -m option, if an output line exceeds the column
width, the output line is truncated.
The pr utility can also print files simultaneously, one per column.
If files are not specified on the command line and the -z option is used,
standard input is assumed to be a list of file names, one file name per
input line, to print out.
If files are not specified on the command line and the -z option is not
used, standard input is displayed on standard output.
Files and options may be intermixed.
Examples
The following example prints file1 using the default values of 55 lines
of text per page, one line for the title, and 5 lines each for the header
and trailer:
$ pr file1 >/p1
The following example prints file1 with no title. This uses 56 lines of
text per page:
$ pr file1 -t >/p1
The following example prints file1 using 90 lines per page.
Pagination begins with page 10:
$ pr file1 -x=10 p=90 >/p1
To display a numbered, unformatted listing of the data directory, type:
$ dir -u ! pr -n
Syntax
printenv
OS
OS-9; OS-9 for 68K
Description
The printenv utility prints any defined environment variables to
standard output.
Example
$ printenv
NAME=andy
TERM=abm85
LIST=/p1
As_long_as_you_want=long_value
See Also
setenv
unsetenv
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the Using OS-9 or Using OS-9 for 68K manuals for more
information.
Syntax
procs [<opts>][<process id list>]
OS
OS-9; OS-9 for 68K
Options
-a Displays alternate information.
-b Displays regular and alternate procs
information.
-e Displays all processes of all users.
-t Displays thread information (OS-9 only;
not valid for OS-9 for 68K systems).
-x Displays an extended process descriptor
listing (OS-9 only; not valid for OS-9 for
68K systems).
Description
The procs utility displays a list of processes running on the system
owned by the user invoking the routine.
Processes can switch states rapidly, usually many times per second.
Therefore, the display is a snapshot taken at the instant the command
is executed and shows only those processes running at that exact
moment.
Display information about specific processes by listing their process IDs
in <process id list>.
The procs utility with no options displays ten pieces of information for
each process:
Name Specification
Id Process ID
Name Specification
S Process status:
* Currently executing
w Waiting
s Sleeping
a Active
e Waiting on event
m Waiting for an mbuf
z Suspended process
Name Specification
Aging Age of the process based on the initial priority and how
long it has waited for processing
Examples
$ procs
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 1 0.0 128 0.25k 0 w 0.01 ??? sysgo <>>>term
3 2 0.0 128 4.75k 0 w 4.11 01:13 shell <>>>term
4 3 0.0 5 4.00k 0 a 12:42.06 00:14 xhog <>>>term
5 3 0.0 128 8.50k 0 * 0.08 00:00 procs <>>term
6 0 0.0 128 4.00k 0 s 0.02 01:12 tsmon <>>>t1
7 0 0.0 128 4.00k 0 s 0.01 01:12 tsmon <>>>t2
$ procs 1
Id Pld Grp. Usr Prior MemSiz Sig S CPU Time Age Module & I/O
1 0 0.0 65535 0.00k 0 86:42:07.19 90.58 Kernel <>>>term
Syntax
profile <path>
OS
OS-9; OS-9 for 68K
Description
The profile utility causes the current shell to read its input from the
named file and then return to its original input source which is usually
the keyboard.
The file specified in <path> may contain any utility or shell commands,
including those to set or un-set environment variables or to change
directories. These changes remain in effect after the command
executes. This is in contrast to calling a normal procedure file by name
only, which a child shell would then execute. This would not affect the
environment of the calling shell.
You can nest profile commands. That is, the file itself may contain a
profile command for another file. When the latter profile
command completes, the first one resumes.
A particularly useful application for profile files is within the .login
and .logout files of a system’s users. For example, if each user
includes the following line in their .login file, system-wide commands
(such as common environments and news bulletins) can be included in
the file /dd/SYS/login_sys:
profile /dd/SYS/login_sys
You can use a similar technique for .logout files.
Syntax
qsort [<opts>] {<path>}
OS
OS-9; OS-9 for 68K
Options
-c[=]<char> Specifies the field separation character.
If an asterisk (*), question mark (?), or
comma (,) are used as field separation
characters, You must enclose the option
and the character by quotation marks.
-f[=]<num> Specifies the sort field. Only one -f field
is allowed on a command line.
-z Reads the file names from standard
input.
-z=<file> Reads the file names from <file>.
Description
The qsort utility is a quick sort algorithm that sorts any number of lines
up to the maximum capacity of memory.
Type qsort and the pathlist(s) of the file(s) to sort.
The qsort utility sorts the file(s) by a user-specified field or field one by
default.
The field separation character defaults to a space if the separation
character is not specified.
If the file names are not given on the command line, standard input is
assumed.
Examples
$ qsort file1 file2 file3 Individually sorts the files and
displays.
$ list file1 file2 file3 ! qsort
Sorts the files together and
displays.
$ dir -ue ! qsort -f=2 Sorts extended directory listing by
entry date, field 2.
$ qsort file -f=2 "-c=*" Sorts file by field 2 using an
asterisk (*) as the field separation
character.
$ qsort file -f=2 "-c=," Sorts file by field 2 using a comma
(,) as the field separation
character.
$ qsort -z Reads file names from standard
input.
Syntax
rename [<opts>] <path> <new name>
OS
OS-9; OS-9 for 68K
Options
-f Forces rename even if the file is
write-protected (OS-9 only).
-x Indicates that <path> starts at the
current execution directory. You must
have execute permission for the
specified file.
Description
The rename utility assigns a new name to the mass storage file
specified in the pathlist.
Type rename, followed by the name of the file to rename, followed by
the new name.
You must have write permission for the file to change its name.
You cannot use the names “.” or “..” for <path>.
Examples
$ dir
Directory of . 16:22:53
blue myfile
$ rename blue purple
$ dir
Directory of . 16:23:22
myfile purple
Syntax
romsplit {<optopn(s)>} {<path>}
OS
OS-9; OS-9 for 68K; WIN; UNIX
Options
-b[=]<size> Specifies the buffer size in k bytes.
Defaults to 16k.
-q Splits the input file into four files.
-x Reads the input file from execution
directory (OS-9, OS-9 for 68K only).
Description
The romsplit utility splits the input file specified by <path> into two
or four files.
The romsplit utility converts a ROM object image into an 8-bit wide
file. This is useful when a PROM programmer cannot burn more than
one PROM at a time and the system has the ROMs addressed as 16-bit
or 32-bit wide memory.
If the -q option is not specified, the romsplit utility copies the even
bytes of data to a new file with the same name with a .0 extension. The
odd bytes are copied to a new file with the same name with a .1
extension.
0, 4, 8, 12 etc. <path>.0
1, 5, 9, 13 etc. <path>.1
Syntax
save [<opts>] {<modname>}
OS
OS-9; OS-9 for 68K
Options
-f[=]<path> Saves all specified modules to <path>.
-r Rewrites existing files.
-x Saves modules into the current
execution directory.
-z Reads the module names from standard
input.
-z=<file> Reads the module names from <file>.
Description
The save utility copies the specified module(s) from memory into your
current data directory. The file(s) created in your directory have the
same name(s) as the specified module(s).
Type save, followed by the name(s) of the module(s) to save.
<modname> must exist in the module directory when saved.
The new file is given access permissions for all modes except public
write.
If you specify more than one module, each module is stored in a
separate file, unless you use the -f option. In that case, all modules
listed are saved in the specified file.
The save utility uses the current data directory as the default directory.
You should generally save executable modules in the default execution
directory.
Examples
$ save -x dir copy
$ save -f=/d1/math_pack add sub mul div
Saving separate module directories in OS-9 requires that you either use
chm to change the module directory or create a directory of the same
name as the module directory to save.
$ makmdir MYMODS create module directory
$ makdir MYMODS create directory of same name
$ load -dw=MYMODS modules load modules into module directory
$ mdir -u ! save -z save modules back to disk
$ mdir -u ! save -z -f=memmodssave modules to a single file
Syntax
set [<opts>]
OS
OS-9; OS-9 for 68K
Options
Refer to your shell documentation for available options.
Description
The set utility changes shell options for the individual shell in which
they are declared.
To change the options for your current shell, enter set and the desired
shell options. This command is the equivalent of typing the options
directly after the shell prompt on the command line. This is the preferred
method of changing shell parameters within procedure files because of
its clarity.
The hyphen that usually proceeds declared options is unnecessary
when using the set command.
The options specified by the set utility change the shell parameters
only in the shell in which they are declared. All descendant shells have
the default parameters unless changed within the new shell.
Note
set is a built-in shell command. Therefore, it is not in the CMDS
directory.
Examples
All commands on the same line have the same effect:
$ set x $ set -x $ -x
$ set xp="JOE" $ set -xp="JOE" $ -xp="JOE"
Syntax
setenv <name> <evalue>
OS
OS-9; OS-9 for 68K
Description
The setenv utility sets environment variables within a shell for use by
the individual shell’s child processes.
<name> and <evalue> are strings stored in the environment list by
shell. These variables are known to the shell in which they are defined
and are passed on to descendent processes from that shell.
Note
Do not confuse setenv with the shell set command. It has a
completely different function. The setenv command is a built-in shell
command. Therefore, it is not in the CMDS directory.
Examples
$ setenv PATH ../h0/CMDS:/d0/CMDS:/dd/CMDS
$ setenv TERM abm85
$ setenv _sh 0
$ setenv As_long_as_you_want long_value
Syntax
setime [<opts>] [y m d h m s [am|pm]]
OS
OS-9; OS-9 for 68K
Options
-d Does not echo date/time when set.
-s Reads time from battery backed up
clock.
Description
The setime utility sets the system date and time. Once set, it activates
the system interrupt clock.
Type setime, and enter the year, month, day, hour, minute, second,
and am or pm as parameters on the command line.
The setime utility does not require field delimiters, but allows you to
use the following delimiters between the year, month, day, etc.:
colon (:), semicolon (;), slash (/), comma (,), or space ( )
If semicolons are used as field delimiters, the date and time string must
be enclosed by quotes so that the semicolons are not interpreted by the
shell. For Example
$ setime "91;1;15;1;25;30;pm"
If parameters are not given, the setime utility issues the prompt:
$ setime
yy/mm/dd hh:mm:ss [am/pm]
Time:
The yy field in the setime utility works as follows: for each yy value
from 70 to 99, the corresponding year value is 1970 through 1999. For
each yy value from 00 to 69, the corresponding year value is 2000
through 2069.
When no am|pm field is specified, the system time uses the 24 hour
clock. For example, 15:20 is 3:20 pm. Midnight is specified as 00:00.
Noon is specified as 12:00. Using the am|pm field allows you to use the
12 hour clock. If a conflict exists between the time and the am|pm field
(such as 15:20 pm) the system ignores the am/pm designation.
Note
The setime utility uses the date utility to echo the date and time after
it is set.
Note
The system ticker is required to be running so setime time sharing
operation can commence. The OS-9 kernel automatically starts the
system ticker during system cold start unless the init module’s
M$Compat flag (B_NoClock) is set. If the system has a battery-backed
clock, this command also sets the system’s date and time.
If this system does not have a battery-backed clock, (or the init
module flag is set), you should run this utility to set the system date and
time for the file system.
Examples
$ setime 91 01 13 15 45Set to: January 13, 1991, 3:45 PM
$ setime 910113 154500 Set to: January 13, 1991, 3:45 PM
$ setime 91/01/13/3/45/pmSet to: January 13, 1991, 3:45 PM
$ setime -s For systems with a battery-backup clock
sets time to the value of the
battery-backed clock.
If no parameters are specified, the user is prompted:
$ setime
yy/mm/dd hh:mm:ss [am/pm]
Time: 91 01 13 15 45
January 13, 1991 Sunday 3:45:00 pm
Syntax
setpr <procID> <priority>
OS
OS-9; OS-9 for 68K
Description
The setpr utility changes the CPU priority of a process.
Type setpr, the process ID, and the new priority value of the process
to change.
The setpr utility may only be used with a process having your ID. Use
procs to obtain the ID number and present priority of any current
process.
The priority number is a decimal number in the range of 1 (lowest) to
65535 (hex FFFF).
Note
This command does not appear in the CMDS directory as it is a built-in
shell command.
Example
$ setpr 8 250 Change the priority of process number 8
to 250
Syntax
shell [[set] <arglist>]
OS
OS-9; OS-9 for 68K
Options
-a Echoes command line if altered after
entry. (OS-9)
-na Does not echo altered command line.
(OS-9)
-c=<num> Specifies the number of previously
executed commands the shell should
“remember.” This provides a history of
your commands. If <num> is not
specified, the default is 40. (OS-9)
-nc Does not keep a command line history.
(OS-9)
-e Prints error messages from
/dd/SYS/errmsg.
-e=<file> Prints error messages from <file>.
-ne Does not print error messages, only
error numbers. This is the default.
-h Displays the command’s history number
in front of the command line prompt. This
is the default option. (OS-9)
-nh Does not display the command’s history
number. (OS-9)
See Also
For more information about using the shell utility, see Chapter 6:
Using the shell Utility.
Syntax
sleep [<opts>] <num>
OS
OS-9; OS-9 for 68K
Options
-s Changes count representation to
seconds.
Description
The sleep utility puts your process to sleep for a number of ticks or
seconds.
This utility is generally used to generate time delays in procedure files.
Type sleep, followed by the number of ticks you want the process to
sleep.
A tick count of one causes the process to give up its current time slice
and return immediately.
A tick count of zero causes the process to sleep indefinitely, usually
until awakened by a signal.
The duration of a tick is system-dependent.
Note
Only one number may be used on the command line. If none is
specified, <num> defaults to zero.
Syntax
su <name> [<,>] <password>
OS
OS-9; OS-9 for 68K
Options
-p Don’t change prompt.
Description
The su utility allows you to start a new shell with a different user ID.
This allows you to change user ID’s without logging off and logging
back on to the system. The system’s password file is searched for the
name and password given. If a matching entry is found in the password
file, a new shell is forked with the associated user ID specified in the
password file entry.
Syntax
suspend <process id>
OS
OS-9
Description
The suspend utility de-activates or suspends an active process.
Type suspend and the process ID of the process you wish to suspend.
Obtain the process ID from the procs utility.
The suspend utility uses the _os_suspend system call to remove the
process from the system’s active queue. It places the process in a limbo
state. While it is in this limbo state, it is not a member of any system
queue.
The queue identifier for suspended processes is a z. This indicates an
inactive state.
! WARNING
You must be extremely careful not to suspend a process that currently
owns a device. If a process is suspended while using a device, the
device is inaccessible until the process is activated.
Note
Only super users may suspend an active process of another user.
Example
$ procs -e
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 30.75k 0 w 0.04 0:10 tsmon <>>>term
3 5 0.0 128 11.00k 0 a 7.00 0:01 eatmpu <>>>term
4 0 0.0 128 30.75k 0 s 0.04 0:10 tsmon <>>>t3
5 2 0.0 128 9.00k 0 w 3.09 0:10 shell <>>>term
6 5 0.0 128 35.25k 0 * 0.07 0:00 procs <>>term >dd
$ suspend 3
$ procs -e
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 30.75k 0 w 0.04 0:10 tsmon <>>>term
3 5 0.0 128 11.00k 0 z 8.73 0:01 eatmpu <>>>term
4 0 0.0 128 30.75k 0 s 0.04 0:10 tsmon <>>>t3
5 2 0.0 128 9.00k 0 w 3.46 0:10 shell <>>>term
6 5 0.0 128 35.25k 0 * 0.05 0:00 procs <>>term >dd
$ procs -e
Id PId Grp.Usr Prior MemSiz Sig S CPU Time Age Module & I/O
2 0 0.0 128 30.75k 0 w 0.04 0:10 tsmon <>>>term
3 5 0.0 128 11.00k 0 z 8.73 0:01 eatmpu <>>>term
4 0 0.0 128 30.75k 0 s 0.04 0:10 tsmon <>>>t3
5 2 0.0 128 9.00k 0 w 3.47 0:10 shell <>>>term
6 5 0.0 128 35.25k 0 * 0.05 0:00 procs <>>term >dd
See Also
The activ utility.
Syntax
sysid [<opts>]
OS
OS-9
Options
-a Prints reserved string.
Description
The sysid utility prints out the identification information of the system.
This information includes the OEM number, serial number, specific
processor number, processor type, floating point processor, time zone,
and the system copyright message.
Syntax
tape {<opts>} [<dev>]
OS
OS-9; OS-9 for 68K
Options
-b[=<num>] Skips the specified number of blocks.
The default is one block. If <num> is
negative, the tape skips backward.
-e=<num> Erases a specified number of blocks of
tape. (* is to end of tape.)
-f[=<num>] Skips the specified number of
tapemarks. The default is one tapemark.
If <num> is negative, the tape skips
backward.
-o Puts tape off-line.
-r Rewinds the tape.
-s Determines the block size of the device.
-t Retains the tape.
-w[=<num>] Writes a specified number of tapemarks.
The default is one tapemark.
-z Reads a list of device names from
standard input. The default device is
/mt0.
-z=<file> Reads a list of device names from
<file>.
Description
The tape utility provides a means to access a tape controller from a
terminal. The tape utility can rewind, erase, skip forwards and
backwards, and write tapemarks to a tape.
If the tape device <dev> is not specified on the command line and the
-z option is not used, tape uses the default device /mt0.
The order of option execution is as follows:
1. Get device name(s) from the -z option.
2. Skip the number of tapemarks specified by the -f option.
3. Skip the number of blocks specified by the -b option.
4. Write a specified number of tapemarks.
5. Erase a specified number of blocks of tape.
6. Rewind the tape.
7. Put the tape off-line.
Examples
$ tape /mt0 -r Rewind tape on device /mt0.
$ tape -f=5 -e=2 -r Skip forward five files on device /mt0,
erase the next two blocks, and then
rewind the tape.
Syntax OS-9
tapegen [<opts>] <devnam> [<filename>] [<opts>]
OS
OS-9; OS-9 for 68K
Options
-b=<bootfile> Installs an OS-9 for 68K boot file. (OS-9
for 68K)
-b[=]<num> Use buffer of <num> kilobytes. (OS-9)
-bz Reads boot module names from
standard input. (OS-9 for 68K)
-bz=<bootlist> Reads boot module names from the
specified bootlist file. (OS-9 for 68K)
-c Checks and displays header information.
(OS-9 for 68K)
-d[=]<dev> Specifies the tape device name. The
default is /mt0. (OS-9 for 68K)
-i[=]<file> Installs an initialized data file on the
tape. This is usually a RAM disk image.
(OS-9 for 68K)
-o Takes the tape drive off-line when
finished. (OS-9 for 68K)
-s Swaps bytes in tape header. (OS-9)
-t[=]<target> Specifies the name of the target system.
(OS-9 for 68K)
Description
The tapegen utility creates the “bootable” tape.
The tapegen utility performs a function similar to the os9gen utility.
Both utilities place the bootstrap file on the media and mark the media
identification block with information regarding the bootstrap file. In
addition, the tapegen utility can add an initialized data on the tape, for
application-specific purposes.
Type tapegen followed by any desired options.
OS-9 Example
$ chd /h0/MWOS/OS9000/603/PORTS/MVME1603/CMDS/BOOTOBJS/BOOTFILE
$ chd /h0/MWOS/OS9000/603/PORTS/MVME1603
Syntax
tapestart [<opts>] [<device name>] [<opts>]
OS
OS-9 for 68K
Options
<device name> RBF device to initialize (defaults to
whatever is specified in the init
module).
-d=<tdevname> Specifies the tape device (default is
‘/mt0’).
-o Forces the tape drive “offline” when
finished.
Note
On some drives the -o option ejects the tape.
Description
This utility is used to initialize the ram disk when booting off tape.
Syntax
tar <options> <file or directory names>
OS
OS-9; OS-9 for 68K
Options
-b N Specifies blocking factor N (block size =
Nx512 bytes).
-B Re-blocks as we read.
-c Creates an archive.
-D Dumps record number within archive
with each message.
-e Swaps bytes within 16-bit hunks.
-f F Reads/writes archive from file or device
F.
-i Ignores blocks of zeros in the archive,
which normally mean EOF.
-k Keeps existing files, does not overwrite
them from the archive.
-m Does not extract file modified time.
-o Writes an old V7 format archive, rather
than P1003 format.
-p Extracts protection information.
-s Sorts list of names to extract to match
the archive.
-t Lists a table of contents of an archive.
-T F Gets names to extract or create from file
F.
Description
The tar utility archives multiple files or directories onto a magnetic tape
or file, lists a table of contents of an archive, or restores (extracts)
multiple files or directories from a tape to another media maintaining
integrity of attributes as archived.
The tar utility’s action is controlled by the first option indicating exactly
one function from the set -c, -t, or -x.
Other arguments to the tar utility are file or directory names that
specify which files to archive, list, or extract.
In all cases, the appearance of a directory name refers recursively to
the files and subdirectories of that directory.
Example
$ tar cvf tarfile *.output
dos.output
dosexxp.output
expr.output
$ tar tvf tarfile
-rw------- 110/30 21056 Jun 27 14:29 1994 dos.output
-rw------- 110/30 9 Jul 11 11:48 1994 dosexp.output
-rw------- 110/30 9 Jul 11 12:46 1994 expr.output
$ tar xvf tarfile
-rw------- 110/30 21056 Jun 27 14:49 1994 dos.output
-rw------- 110/30 9 Jul 11 11:48 1994 dosexp.output
-rw------- 110/30 9 Jul 11 12:46 1994 expr.output
Syntax
tee {<path>}
OS
OS-9; OS-9 for 68K
Description
The tee utility is a filter that copies all text lines from its standard input
to its standard output and any other additional pathlists given as
parameters.
Type tee and the pathlist(s) to which standard input is to be redirected.
This utility is generally used with input redirected through a pipe.
Examples
The example below uses a pipeline and the tee utility to
simultaneously send the output listing of dir to the terminal, printer,
and a disk file:
$ dir -e ! tee /printer /d0/dir.listing
This example sends the output of an assembler listing to a disk file and
the printer:
$ asm pgm.src l ! tee pgm.list >/printer
This example broadcasts a message to three terminals:
$ echo WARNING System down in 10 minutes ! tee /t1 /t2 /t3
Syntax
tmode [<opts>] [<arglist>]
OS
OS-9; OS-9 for 68K
Options
-a Prints input mapping table values in
ASCII format. (OS-9)
-c Prints input mapping table values as
control characters. (OS-9)
-h Prints input mapping table values in
hexadecimal format. (OS-9)
-v Displays all mapped control characters
including those passed through. (OS-9)
-w=<path#> Changes the path number <path#>
affected.
Description
The tmode utility displays or changes the operating parameters for a
path. It accomplishes this by getting and optionally setting a path’s
options.
The changes made by the tmode utility only last as long as the path
that it modifies lasts. That is, if the modified path is closed the
modifications are lost. This differs from the xmode utility in that it
modifies the default options used to create paths so any changes made
with it are permanent, but largely do not effect any open paths. See
your technical reference manual for more information on paths and the
xmode utility documentation for more information on permanently
changing path and device options.
Note
If you use the tmode utility in a shell procedure file, you must use
-w=<path#> to specify one of the standard paths other than standard
input (1 or 2) to change the terminal’s operating characteristics.
The change remains in affect until the path is closed. For a permanent
change to a device characteristic, you must change the device’s initial
operating parameters using xmode. See the xmode utility for more
information.
OS-9 for 68K:Two of the options that are displayed by tmode effect all
paths open to the device: type and baud. baud is the baud rate for the
device and type contains bit-fields for the word size, stop bits, and
Name Description
Name Description
Examples
For OS-9
tmode noupc nopause Disable upper-case lock and page pause
tmode REPRINT=0x04 Change reprint character to
<control>D
tmode pause page=65 Enable page pause and set page size to
65
Syntax
touch {<option(s)>) {<path>} OS-9 for 68K or OS-9
os9touch {<option(s)>) {<path>} DOS or UNIX
touch OS
OS-9; OS-9 for 68K
os9touch OS
WIN
Options
-c Does not create a file if not found.
-q Does not quit if an error occurs.
-x Searches the execution directory for the
file.
-z Reads the file names from standard
input.
-z=<path> Reads the file names from <path>.
Description
The touch utility updates the last modification date of a file. Usually,
this command is used with a os9make command’s makefile.
Associated with every file is the date the file was last modified. The
touch utility opens a file and updates the modification date to the
current date and closes it.
Type touch and the pathlist of the file to update. The touch utility
searches the current data directory for the file to update if another
directory or the -x option is not specified.
Examples
$ touch -c /h0/sys/motdDon’t create file if it does not exist.
$ dir -u ! touch -z Update all files in current directory.
tr Transliterate Characters
Syntax
tr [<opts>] <str1> [<str2>] [<path1>] [<path2>]
OS
OS-9; OS-9 for 68K
Options
-c Transliterates all ASCII characters (1
through $7F) to <str2>, except for the
set of characters in <str1>.
-d Deletes all matching input characters
and expressions.
-s Squeezes all repeated output characters
or expressions in <str2> to single
characters or expressions.
-v Same as -c.
-z Reads standard input for list of file
names.
-z=<path> Reads the file names from <path>.
Description
The tr utility transliterates characters from <str1> into a
corresponding character from <str2>.
If <str1> contains more characters than <str2>, the final character in
<str2> is used for each excess character in <str1>.
Type tr and the characters to search for (<str1>), and optionally, the
replacement characters (<str2>), the input file’s pathlist (<path2>)
and the output file’s pathlist (<path2>).
<str1> is required.
! WARNING
tr always deletes ASCII nul ($00).
Char Specification
- RANGE
The hyphen (-) is defined as representing all characters
lexicographically greater than the preceding character and
less than the following character. For Example
[a-z] is equivalent to the string
abcdefghijklmnopqrstuvwxyz.
[m-pa-f] is equivalent to the string mnopabcdef.
[0-7] is equivalent to the string 01234567.
See Appendix A: ASCII Conversion Chart for character
values.
\ ESCAPE
The backslash (\) removes special significance from special
characters. It is followed by a base and a numeric value or a
special character. If the base is not specified, the base for
the numeric value defaults to hexadecimal. An explicit base
of decimal or hexadecimal can be specified by preceding the
numeric value with a qualifier of d or x, respectively. It also
allows entry of some non-printing characters such as:
\t = Tab character
\n = Newline character
\l = Line feed character
\b = Backspace character
\f = Form feed character
Syntax
tsmon [<opts>] {/<dev>}
OS
OS-9; OS-9 for 68K
Options
-d Displays statistics when a ^\ character
(control-backslash or hex $1C) is typed
on a monitored terminal.
-l=<prog> Forks <prog>, an alternate login
program.
-p Displays an “online” prompt to each
timesharing terminal being monitored by
the tsmon utility.
-r=<prog> Forks an alternate shell program for
remote commands.
-z Reads the device names from standard
input.
-z=<path> Reads the device names from <path>.
Description
The tsmon utility supervises idle terminals and starts the login utility
in a timesharing application.
Typically, the tsmon utility is executed as part of the start-up procedure
when the system is first brought up and remains active until the system
shuts down.
/<dev> specifies a terminal to monitor. This is generally an SCF
device.
Examples
This command starts timesharing on term and t1, printing a welcome
message to each. A similar command might be used as the last line of a
system startup file.
Note
The standard input device shown for the tsmon utility by the procs
utility always indicates the last device to gain the tsmon utility’s
attention.
Syntax
umacs [<opts>] {<files>}
OS
OS-9; OS-9 for 68K
Description
µMACS is a screen-oriented text editor you can use to create and
modify text files. µMACS can maintain multiple buffers so you can work
with several files and/or portions of the same file at once.
See Also
For more information about the µMACS Utility, see Chapter 7.
Syntax
unassign <name> {<name>}
OS
OS-9
Description
Discards relationships assigned with the assign command.
Note
This command does not appear in the CMDS directory as it is a built-in
shell command.
Example
$ assign
cd chd
h hist
l list
ls dir
printenv prenv
$ unassign cd
$ assign
h hist
l list
ls dir
printenv prenv
Syntax
undel [<opts>] <path> [<dstpath>]
OS
OS-9 for 68K
Options
-o[=]<dev> Specify alternate device.
Description
The OS-9 for 68K undel utility provides a way to possibly recover an
undeleted file. The undel utility allows you to copy the data of the
deleted file to a new file on another device.
The OS-9 for 68K undel utility is only capable of restoring one file at a
time.
If the -o option is not selected, the OS-9 for 68K undel selects the
destination device as follows:
Note
OS-9 for 68K RBF marks files as deleted by placing a null in the first
byte of the filename in the directory entry. For that reason, the OS-9 for
68K undel cannot tell the difference between the names of files that
were deleted that only differ by the first character. For instance, the file
boo, foo, and zoo would all look the same. undel select the first
name that matches all but the first character of the indicated filename.
The OS-9 undel does not have this problem.
Examples
The following command line attempts to recover the file procs, from
the current directory, by copying it to /r0/procs.
$ undel procs
The following command line attempts to recover the file procs, from
the current directory, by copying it to /h1/procs.
$ undel procs -o=/h1
The following example demonstrates that you don’t always get what
you want (see Note).
$ build foo
? foo
?
$ build boo
? boo
?
$ del foo boo
$ undel boo
$ list /r0/boo
foo
Syntax
undel [<opts>] <srcpath> [<dstpath>]
OS
OS-9
Options
-b[=]<num> Allocates <num> k bytes of memory to
be used as a buffer for undel. undel
uses 4K by default.
-r Overwrites the existing file(s).
-w[=]<dir> Restores one or more files to <dir>.
This option prints a message as to which
file is being restored.
-x Uses the current execution directory for
<srcpath>.
-z Reads file names from standard input.
-z=<file> Reads file names from <file>.
Description
When OS-9 RBF deletes a file, the file can be recovered if none of the
disk storage formerly being used by the deleted file is allocated to some
other file on the disk.
The OS-9 undel utility provides a way to possibly recover an undeleted
file. The undel utility allows you to copy the data of the deleted file to a
new file on another device.
The under utility copies the data of the deleted file <srcport> to
<dstpath>. <dstpath> must not be on the same device as
<srcpath>.
Examples
The following command line attempts to recover the file
/h0/CMDS/procs by copying it to /r0/procs.
undel /h0/cmds/procs /r0/procs
The following command line attempts to recover all files ending in .c by
copying them to the directory /r0/MYSOURCE. A message displays
telling you which files are being undeleted.
undel "*.c" -w=/r0/MYSOURCE
The following command line attempts to recover the main.c and
funcs.c files by copying them to the directory /r0/MYSOURCE:
undel main.c funcs.c /r0/MYSOURCE
The following command line attempts to recover main.c by overwriting
the existing file in the directory /r0/MYSOURCE:
undel main.c /r0/MYSOURCE/main.c -r
Syntax
unlink [<opts>] {<modnames>}
OS
OS-9; OS-9 for 68K
Options
-f Forces a module (if not in use) to be
purged from the module directory.
-z Reads the module names from standard
input.
-z=<file> Reads the module names from <file>.
Description
The unlink utility tells the operating system that you no longer need
the memory module(s) named.
Type unlink and the name(s) of the module(s) to unlink. The link
count decrements by one. If the link count becomes zero, the module
directory entry is deleted and the memory is de-allocated.
Note
The -f option can be slow on OS-9 for 68K because of retries. Unlike
OS-9, the OS-9 for 68K _os_unload() does not return an error code
in some cases when it fails to unlink the module.
See Also
The link and load utilities.
Examples
$ unlink pgm pm5 pgm9 Unlinks pgm, pgm5, and pgm9 and
lowers the link count of each module by
one.
$ dir -u ! unlink -z Pipes an unsorted listing of the current
data directory to unlink. This unlinks all
modules contained in the directory,
lowering the link count of each module
by one.
$ mdir -u ! unlink -f -z
Pipes the current module directory listing
to the unlink which then flushes all
modules (which are currently not in use)
from the system. Under OS-9 for 68K
this may take awhile because of the
number of retries.
$ unlink -z=namefile Unlinks each module listed in namefile
and lowers the link count of each module
by one.
$ mdir
Module Directory at 14:44:35
kernel init p32clk rbf p32hd
h0 d0 r0 edit mdir
$ unlink edit
$ mdir
Module Directory at 14:44:35
kernel init p32clk rbf p32hd
h0 d0 r0 mdir
Syntax
unsetenv <name>
OS
OS-9; OS-9 for 68K
Description
The unsetenv utility deletes the specified environment variable from
the environment list.
Type unsetenv, followed by the environment parameter to delete. This
removes the variable from the environment list.
Note
If the specified variable has not been previously defined, the unsetenv
utility has no effect and it gives you no message.
Note
These commands do not appear in the CMDS directory as they are
built-in to the shell.
Examples
$ unsetenv _sh
$ unsetenv TERM
See Also
setenv and printenv utility descriptions.
Syntax
what [<opts>] <file names> [<opts>]
OS
OS-9; OS-9 for 68K; DOS
Options
-s Stop searching after the first occurrence
of the pattern.
Description
The what utility searches each filename for occurrences of the pattern
@(#) and prints what follows up to a ", >, or null character.
This utility is useful for finding embedded version stings that exist in
some modules.
Examples
$ what OS9/68000/CMDS/maui
Syntax
w
wait
OS
OS-9; OS-9 for 68K
Description
The w utility causes the shell to wait for the termination of one child
process before returning with a prompt.
The wait causes the shell to wait for all child processes to terminate
before returning with a prompt.
Type w or wait and a carriage return. When the shell prompt is
displayed, the child process(es) have terminated.
Note
This command does not appear in the CMDS directory as it is a built-in
shell command.
Examples
$ list file1 >/p1&
$ list file2.temp ! filter >file2&
$ wait
$ list file2 >/p1
In this example, the prompt returns when the first of these three
processes (one, two, or three) terminates:
$ one&
Syntax
xmode [<opts>] <devname> [<arglist>] {<devname>}
OS
OS-9; OS-9 for 68K
Options
-a Prints input mapping table values in
ASCII format. (OS-9)
-c Prints input mapping table values as
control characters. (OS-9)
-h Prints input mapping table values in
hexadecimal format. (OS-9)
-v Displays all mapped control characters
including those passed through. (OS-9)
-z Reads device names from standard
input.
-z=<file> Reads device names from <file>.
Description
The xmode utility displays or changes the default operating parameters
for a device. It accomplishes this by getting and optionally setting a
device’s default options.
For OS-9, the changes made by the xmode utility last as long as the
device that it modifies is initialized (see iniz, devs). That is, if the
modified device is de-initialized the modifications are lost.
Note
You can only use xmode for SCF, GFM and UCM devices.
Note
OS-9 for 68K: On SSM systems, the module header permissions of the
module must allow the appropriate write permission; otherwise an
access error occurs. The typical default for modules is write-protected,
this means you need to use fixmod on the module before it is loaded
into memory.
Generally, changes made with using the xmode utility should be made
prior to iniz-ing the device as changes made after the device is
initialized will only affect paths opened after the changes have been
made. For Example Assuming that device t1 is not initialized, the
following command sequence opens all paths to t1 without the pause
option.
The exceptions are the five parameters type, par, cs, stop, and
baud. Any change to these options affects all currently open paths as
well as any paths opened to the device in the future.
OS-9 for
68K Name OS-9 Name Specification
OS-9 for
68K Name OS-9 Name Specification
OS-9 for
68K Name OS-9 Name Specification
OS-9 for
68K Name OS-9 Name Specification
OS-9 for
68K Name OS-9 Name Specification
OS-9 for
68K Name OS-9 Name Specification
OS-9 for
68K Name OS-9 Name Specification
Table 1-33 OS-9 Control Keys that Affect the Input Line
Name Description
Name Description
Table 1-33 OS-9 Control Keys that Affect the Input Line (continued)
Name Description
Examples
For OS-9
tmode /term noupc nopause
Disables upper-case lock and page
pause.
The debug utility is a software tool for debugging and testing user-state
68000 machine language programs written for the OS-9 for 68000
operating system.
debug uses:
• The F$DFork and F$DExec system calls to create and execute the
process to debug. These system calls provide an environment that
allows the debugger to control how a process executes without
affecting other processes on the system.
363
2 Using the debug Utility
Symbolic Debugging
The OS-9 linker (l68) produces a symbol module for a program if you
specify the l68 -g option when the program is linked. This option
places global data and code symbols in a data module. debug
automatically loads the symbol table data (STB) module when the
debugging session begins.
This method of separating symbolic debugging information from the
executable program module provides a number of advantages. The
symbol information is not loaded into memory until the program is
actually debugged. No production linkage or symbol stripping is
required to remove the symbols from the code. You can keep the STB
module for possible future debugging of the production code. The CRC
of the program module is stored in the STB module and validated by the
debugger to ensure that the symbol module matches the version of the
program being debugged.
Type debug at the shell prompt. The debug utility then waits for a
command with the prompt: dbg:
The f command is the first command entered in a debug session. This
creates a process to execute the program to debug.
If any parameters are specified on the shell command line, they are
assumed to be arguments for the f command.
If any parameters are specified, the f command is implicitly executed
upon startup.
If redirection, priority specification, and stack size (<, >, ^, #) are given,
be sure to enclose the arguments in quotes to protect them from
interpretation by the shell.
The f command can pass up to 64 arguments to the process.
A full explanation of entering debug via the shell command line and the
f command appear in later sections of this chapter.
Relocation Registers
Command Specification
Examples
dbg: @
the default relocation register is .r0 00000000
dbg: .r4 1fe00
dbg: @
the default relocation register is .r4 0001fe00
dgb: .r
rn: 00000000 00000000 00000000 0001fe00 00000000 00000000
00000000 00000000
Command Specification
Examples
dbg: b
breakpoint count = 0
dbg: b main
dbg: b
breakpoint count = 1
main (00162f40)
dbg: b main+1f0
dbg: b
breakpoint count = 2
main (00162f40)
main+1f0 (00163130)
dbg: k main+1f0
dbg: k
clear all breakpoints? y
dbg: k *
Execution Commands
The debug utility provides a number of commands to initiate and
control program execution:
Command Specification
i Instruction count
Displays the number of instructions the program
executed. This count does not include instructions
executed in system state or during the x -1 command.
g Go
Runs the program until a breakpoint, exception, or the
F$Exit system call is encountered.
gs Go and stop
Executes the program until the next instruction is
encountered. This is the same as the Go command, but
it sets a breakpoint at the next instruction. The
breakpoint is automatically removed when the
debugger regains control.
Command Specification
t Trace
Executes one instruction and re-displays the machine
registers.
Note
The program may stop before the next instruction breakpoint is reached
if another breakpoint, exception or F$Exit is reached first.
Note
class is the stack frame special status word on the 68010/68020; for
the 68000 this is the first word of the exception frame. violation
address is the access address that caused the exception. inst is the
instruction input buffer for the 68000/68010; for the 68020 this is the
instruction pipe stage B word. On the 68010, the PC shown by the
debugger may be advanced up to five words due to instruction pipeline
buffering.
Command Description
Example
dbg: gs printf
dn: 001972BE 00000000 00000001 00000003 00000001 0008434A 00004380 000000
an: 001972BE 00000000 00084342 00084338 00084334 00084218 00088000 000841
pc: 00197506 cc: 00 (-----)
<FPCP in Null state>
printf >4E550000 link.w a5,#0
dbg: t
dn: 001972BE 00000000 00000001 00000003 00000001 0008434A 00004380 000000
an: 001972BE 00000000 00084342 00084338 00084334 000841D4 00088000 000841
pc: 0019750A cc: 00 (-----)
<FPCP in Null state>
printf+0x4 >48E7C080 movem.l d0-d1/a0,-(a7)
tra: w
Stack traceback via (a5):
printf+0x4 (0019750A)
main+0xA4 (00196F04)
_cstart+0xE4 (00196D24)
Command Specification
Memory Commands
Memory is displayed using the memory display command: d. This
command allows interpretation of memory in a number of ways. The
general form of the display memory command is:
Parameter Specification
Code Specification
I Instruction disassembly.
Code Specification
Note
In the ASCII field of the hex/ASCII dump, bytes in the range of
$20 - $7E are displayed as the ASCII character equivalent. All other
values are displayed as a period (.)
Instruction Description
Instruction Description
Example
dis: di _cstart Instruction disassembly
_cstart >2D468010 move.l d6,_totmem(a6)
_cstart+0x4 >2D468014 move.l d6,_sbsize(a6)
_cstart+0x8 >3D438018 move.w d3,_pathcnt(a6)
_cstart+0xC >4A85 tst.l d5
_cstart+0xE >671E beq.b _cstart+0x2E
_cstart+0x10 >08050000 btst.b #0,d5
_cstart+0x14 >6614 bne.b _cstart+0x2A->
_cstart+0x16 >41F55800 lea.l 0(a5,d5.l),a0
_cstart+0x1A >4A68FFFE tst.w -2(a0)
_cstart+0x1E >660A bne.b _cstart+0x2A->
_cstart+0x20 >5988 subq.l #4,a0
_cstart+0x22 >49E8FFFC lea.l -4(a0),a4
_cstart+0x26 >7001 moveq.l #1,d0
_cstart+0x28 >6020 bra.b _cstart+0x4A
_cstart+0x2A >423558FF clr.b -1(a5,d5.l)
_cstart+0x2E >204D movea.l a5,a0
dis: di _cstart 5 Disassemble 5 instructions
_cstart >2D468010 move.l d6,_totmem(a6)
_cstart+0x4 >2D468014 move.l d6,_sbsize(a6)
_cstart+0x8 >3D438018 move.w d3,_pathcnt(a6)
_cstart+0xC >4A85 tst.l d5
_cstart+0xE >671E beq.b _cstart+0x2E
Command Specification
The first two lines of the display show the data and address registers
from D0 - D7 and A0 - A7 respectively. The third line shows the program
counter and status register. Only the user byte (containing the
processor condition code values) is available. The condition code bits
are interpreted and displayed after the condition code register hex value
in parentheses.
The bit interpretation is:
(XNZVC)
C = Carry
V = Overflow
Z = Zero
N = Negative
X = Extend
The following discussion of the 68881 coprocessor registers applies
only to OS-9 systems running on a 68020 processor with the 68881
installed as a coprocessor.
If the display 68881 registers option is set, the next line(s) indicate the
state of the 68881 coprocessor. If the coprocessor is not present on the
system, the following message appears:
<No 68881 available>
If the process has yet to access the 68881, the following message
appears:
<68881 in Null state>
When the process accesses the 68881, a floating point register dump
appears. If the setting of the debugger decimal register display option
indicates hex display, the 68881 coprocessor registers appear as
follows:
fp0:40010000 D5555555 55555200 fp4:7FFF0000 FFFFFFFF FFFFFFFF fpcr: 0000 XN
fp1:7FFF0000 FFFFFFFF FFFFFFFF fp5:7FFF0000 FFFFFFFF FFFFFFFF fpiar: 00000000
fp2:7FFF0000 FFFFFFFF FFFFFFFF fp6:7FFF0000 FFFFFFFF FFFFFFFF fpsr: 00000208
fp3:7FFF0000 FFFFFFFF FFFFFFFF fp7:7FFF0000 FFFFFFFF FFFFFFFF (---- 0)
The value of the registers are printed in decimal using scientific notation
when the value becomes very large or very small. IEEE not-a-number
values are printed as <NaN>, plus and minus infinity values are printed
as <+Inf> and <-Inf>, respectively. The extended precision values
are converted to double precision before printing, so conversion
overflow may result. The hexadecimal format display can be used to
determine the exact values in the registers.
The eight 68881 floating point registers are displayed in either
hexadecimal or decimal form depending on the floating point register
display option setting.
The 68881 status registers appear to the far right of the display:
fpcr: 0000 -- 68881 control register
fpiar: 00000000 68881instruction address register
fpsr: 00000000 68881 status register
(---- 0) FPSR interpretation bits
The -- field next to the FPCR register displays an interpretation of the
68881 rounding mode and precision. These fields are interpreted as
follows:
fpcr: 0000 --
Rounding mode: N = Nearest
Z = Toward zero
- = Toward minus infinity
+ = Toward plus infinity
Rounding Precision: X = Extended
S = Single
D = Double
The FPSR condition code byte and the quotient byte are displayed as
follows:
(---- 0)
? = NaN or Unordered
¸
I = Infinity
Z = Zero ″ Floating point condition codes
N = Negative
You can change processor registers with the period (.) command. Any
processor register or coprocessor control register can be changed with
this command:
.<regname> <expr>
Valid register names are:
.d0 - .d7
Example
dn: 00000000 00000000 00000001 00000003 00000000 000000A6 00001210 00000000
an: 0001DB78 00000000 0001E7EE 0001E7E2 0001E7DE 00000000 00025610 0001E770
pc: 000F8FA8 cc: 04 (--Z--)
_exit+0x6 DEADDEAD add.l -8531(a5),d7
dbg: .d4 100 Set D4 to 100
dbg: . Display registers
dn: 00000000 00000000 00000001 00000003 00000100 000000A6 00001210 00000000
an: 0001DB78 00000000 0001E7EE 0001E7E2 0001E7DE 00000000 00025610 0001E770
pc: 000F8FA8 cc: 04 (--Z--)
dbg: .d4 .d2+.a6 Set D4 using an expression
dbg: . Display registers
dn: 00000000 00000000 00000001 00000003 00025611 000000A6 00001210 00000000
an: 0001DB78 00000000 0001E7EE 0001E7E2 0001E7DE 00000000 00025610 0001E770
pc: 000F8FA8 cc: 04 (--Z--)
dbg: .d4 No <value> means zero
dbg: .
dn: 00000000 00000000 00000001 00000003 00000000 000000A6 00001210 00000000
an: 0001DB78 00000000 0001E7EE 0001E7E2 0001E7DE 00000000 00025610 0001E770
pc: 000F8FA8 cc: 04 (--Z--)
The floating point register change command allows the change value to
be either a double precision decimal constant or a left-justified
hexadecimal value:
.fp<n> <float-decimal constant> or
.fp<n> <96-bit left-justified hex constant> or
.fp<n> .fp<n>
<n> is one of 0 - 7 representing the desired 68881 general floating point
register.
The syntax for <float-decimal constant> is:
[+/-]digits[.digits][Ee[+/-]integer]
The syntax for <96-bit left-justified hex constant> is:
0xh
Parameter Specification
[S] Specifies the size of the fill. If [S] is not given, byte
length is assumed. Three values are allowed for the [S]
parameter: b, w, or l for byte, word, or longword,
respectively.
* If the length of the fill determined from <start> and <end> is not an
even word or longword multiple (for a word and longword fill), the length is
trimmed to the next lowest respective multiple.
There are two special types of memory fill when using the byte fill size:
1. <value> may start with a double quote character ("") in which
case all remaining characters are used as a fill string.
Example
d3 70000 Display memory
0x00070000 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070010 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070020 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
dis: mfb 70000 70003 a1 Fill with byte
dbg: d2 70000
0x00070000 - A1A1A1A1 FEEDC0DE FEEDC0DE FEEDC0DE !!!!~m@^~m@^~m@^
0x00070010 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
dis: mfw 70000 7000f 5252 Fill with word
dbg: d2 70000
0x00070000 - 52525252 52525252 52525252 52525252 RRRRRRRRRRRRRRRR
0x00070010 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
dis: mfl 70000 70002 81186226 Fill with longword
dbg: d3 70000
0x00070000 - 81186226 81186226 81186226 81186226 ..b&..b&..b&..b&
0x00070010 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070020 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
dis: mfwn 70001 70007 0102 Non-aligned fill word
dbg: d3 70000
0x00070000 - 81010201 02010201 81186226 81186226 ..........b&..b&
0x00070010 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070020 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
dbg: mfb 70000 7000f "shazam! Fill with a string
dbg: d4 70000
0x00070000 - 7368617A 616D2173 68617A61 6D217368 shazam!shazam!sh
0x00070010 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070020 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070030 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070040 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070050 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070060 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070070 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
dis: mf 70000 70010 1 2 3 4 3+2 Fill with multiple byte values
dbg: d4 70000
0x00070000 - 01020304 05010203 04050102 03040501 ................
0x00070010 - 02EDC0DE FEEDC0DE FEEDC0DE FEEDC0DE .m@^~m@^~m@^~m@^
0x00070020 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
0x00070030 - FEEDC0DE FEEDC0DE FEEDC0DE FEEDC0DE ~m@^~m@^~m@^~m@^
Parameter Specification
* If the length of the search determined from <start> and <end> is not
an even word or longword multiple (for a word and longword search), the
length is trimmed to the next lowest respective multiple.
There are two special types of memory search when using the byte
search size:
• <value> may start with a double quote character (") in which case
all remaining characters are used as a search string.
Example
dbg: d1 btext
Linking to a Module
Use the l command to link to a memory module. If the named module
is not in memory, debug tries to load a file (in the execution directory) of
the given name. The module’s address is placed in the .r7 relocation
register. Subsequent l commands unlink the previously linked module
and link to the new module. The module is automatically unlinked when
the debugger terminates.
Command Specification
Symbolic Debugging
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the shell documentation in Using OS-9 for details on the PATH
environment variable.
Command Specification
Examples
dbg: f progx Create process running progx
default symbols belong to ’progx’ Current symbol module set to progx
dn: 0000000A 000C0064 00000080 00000003 00000000 000000A2 00001050 00000000
an: 00000000 0001B660 00000000 0016F030 00000000 0001B5BC 00022610 0001B5BC
pc: 0016F07E cc: 00 (-----)
<68881 in Null state>
_cstart >2D468010 move.l d6,_totmem(a6)
dbg: sm Display known symbol modules
Program
Upper data module name
Symbol address Current
Upper code
Module Lower code Lower data symbol module
address
Address address address Number of symbols
Code Lo and Code Hi are the base and end addresses of the
program module. Data Lo and Data Hi are the lower and upper
addresses of the initial process data area when the process was forked.
Note that the data addresses have the (a6)+32768 bias removed.
dbg: gs main
Installed symbol module for trap handler ’cio’
dn: 00000001 0001B62E 0001A62A 0001B636 00000000 000000A2 00001050 00000000
an: 0001A9BE 001F214A 0001B62E 0001B626 0001B622 00000000 00022610 0001B5B4
pc: 0016F280 cc: 00 (-----)
<68881 in Null state>
main >48E7F080 movem.l d0-d3/a0,-(a7)
Note
The shell pipe (!) and concurrent (&) features are not supported. You
cannot redirect the standard error path as this is the path that the
debugger uses for command input and display output. Shell filename
wildcards cannot be used on the f command but can be given when
debug is run directly from the shell.
You can use the f command at anytime during the debugging session.
If a process was already being debugged, that process is terminated
before the new process is created.
After the new process is created, control is returned to the debugger
immediately. The debugger displays the first instruction to be executed
in the program:
dbg: f progx -e Create process running progx with
argument -e
default symbols belong to ’progx’
dn: 0000000C 000C0064 00000080 00000003 00000000 000000AA
00001060 00000000
an: 00000000 00015F90 00000000 000F52A0 00000000 00015EE4
0001CF30 00015EE4
pc: 000F52EE cc: 00 (-----)
<68881 in Null state>
You can start the debugger from the shell command line. Any
arguments given to debug are processed as if the f command was
given. Any metacharacters recognized by the shell must be quoted if
intended for debug. Metacharacters seen by the shell affect debug
itself rather than the program being debugged.
For example:
shell: debug progx -e h1 h2
This command is the equivalent to the f command issued in the
debugger:
dbg: f progx -e h1 h2
To pass a memory override to the progx process, the following two
commands are equivalent:
shell: debug progx "#32k" -e h1 h2
dbg: fprogx #32k -e h1 h2
The debugger uses the standard error path to determine the console
device on which the debugger is running. The debugger opens a
separate path to this device so as not to interfere with the debugged
process’ standard error path. This action is useful to debug programs
that run as filters:
shell: qsort data.file ! debug datafilter ! datamerge
In this case, the pipes are set up by the shell and the datafilter process
runs within the pipeline but under control of the debugger.
If shell filename wildcard processing is desired, run the debugger from
the shell command line as normal:
shell: debug progx -f *.c
The wildcards are expanded and passed to debug, which in turn
passes the filenames to progx.
Option Description
Examples
dbg: v 10Display 10
0x00000010 (16) 0x00000010
dbg: ob 10Change radix to base 10
Hexformat = 0x, Input radix = 10
Show 68881 registers ON in
dbg: v 10Display 10
0x0000000A (10) 0x0000000A
Operand Specification
Operand Specification
Note
In the following tables, e1 and e2 represent any legal expression.
Operator Function
e1 + e2 Add e2 to e1.
e1 * e2 Multiply e1 by e2.
e1 / e2 Divide e1 by e2.
Operator Function
Operator Function
- e1 Negate e1.
~ e1 Complements e1.
Indirect Operators
Indirect operators are shown in Table 2-18 Indirect Operators.
Operator Function
Operator Function
Command Summary
Table 2-19 debug Utility Command Summary shows a list of all debug
commands and a brief description.
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
editmod creates, displays, and edits OS-9 and OS-9 for 68K modules.
In addition, it can also generate header files for inclusion in code that
deals with these modules. It has the following attributes:
• Extensible — End users can write the supporting files necessary for
editmod to understand modules of their own creation.
419
3 Using the editmod Utility
Creating Modules
The -c option is used to create modules. For example, the following
command line creates a device descriptor called term:
editmod -c term -dTERM
• -c specifies the creation mode.
• term is the name of the output file.
• -dTERM defines the identifier TERM.
Refer to the programmer’s guide for more information about creating
modules.
Listing Modules
The contents of a module are displayed using the -l option. For
example, the following command line lists the contents of the init
module.
editmod -l init
• -l selects the view mode.
• init is the file name of the module to list
Editing Modules
The contents of a module can be edited by using the -e option. A series
of navigable menus access all the editable fields in the module. The
following is a sample annotated editing session.
To start editing a module, use the following command line:
editmod -e init
Which? [?/1-2/p/t/a/w/q]
The valid responses appear in the table below:
Response Description
Which? [?/1-9/p/t/a/w/q]
There are nine editable items in the menu. Entering 1 displays the
prompt:
Group number : 0x1
New value:
At this point, any of the following may be entered: ?, <CR>, or
a C expression.
? prints help on the semantics of the item. For example:
New value: ?
New value:
Pressing <CR> leaves the item at its present value.
A C expression may also be entered. This expression may contain
pre-processor identifiers, operators, and constants. Assuming a
#define SUPER_GROUP 0 had appeared in the description files, you
might enter:
New value: SUPER_GROUP
The menu is re-displayed below. Notice the change in the first line.
1. Group number : 0x0
2. User number : 0x0
3. Module name : "init"
4. Module access permissions : 0x555
Which? [?/1-9/p/t/a/w/q]
This example is trivial because you are editing an integer field. Module
editing may involve the editing of arrays, strings, or variable length lists.
Editing an Array
The array is displayed and you are asked which item in the array you
want to edit:
Which array
0x01, 0x02, 0x03
Which element? (0 - 2)
At this prompt, a C expression may be entered specifying which item in
the array to edit or ? may be used to get help on the semantics of the
array elements.
Entering 1 yields:
Old value = 0x2
New value =
Again, a C expression for the new value may be entered or ? may be
used to get semantics help.
Which? [?/1-5/p/t/a/w/q]
This indicates that there are currently four nodes in the list (numbered
zero through three).
Selecting menu item six allows any of the four memory list nodes to be
deleted.
Selecting menu option five adds one to this list and re-displays the
menu as follows. Note the change in item 5.
1. Memory list nodes [0]
2. Memory list nodes [1]
3. Memory list nodes [2]
4. Memory list nodes [3]
5. Memory list nodes [4]
6. Add additional item to list
7. Delete item from list
Which? [?/1-5/p/t/a/w/q]
The items in the list are edited using the procedures described above.
Expressions
editmod contains an user input expression interpreter. When editing
fields within the editor, you may enter expressions that contain the
following elements:
• Constants character, hexadecimal, octal, decimal (See
below for additional constant types)
• Operators all the non-assignment operators are
supported
• Preprocessor macros any preprocessor macros entered are
replaced with their appropriate values
The expression interpreter has been extended for use within editmod
to include additional constant types.
$ prefix
The ’$’ can be used as the prefix for hexadecimal constants. For
example, $555 is the same as 0x555.
Internet address
Internet addresses may be used. They appear as a dot(.) separated
four item sequence of decimal numbers in the range zero to 255. For
example: 190.20.0.45.
Ethernet address
Ethernet addresses may be used. They appear as a colon(:) separated
six item sequence of hexadecimal numbers in the range zero to
255(0xff). The 0x or $ prefix is not valid. For example,
6f:ab:0:65:6:4.
DPIO Descriptors
editmod contains some support for OS-9 Dual Ported Input/Output
(DPIO) descriptors. editmod assumes an OS-9 system-state program
module is a DPIO “secondary” descriptor and that, in creation mode,
OS-9 system-state programs may have initialized data.
A utility called DPSplit is also provided to separate and join “primary”
and “secondary” descriptors. To edit a DPIO descriptor, use the
following process:
Step 1. Use DPSplit to split the file into the individual modules.
Step 2. Edit either module.
Step 3. Use DPSplit to join the individual modules back into a single DPIO
descriptor.
If you create a new driver, file manager or system module, you need to
know how to create the description files necessary for editmod to
understand the format of your descriptors or modules.
Generally, you define the structure of all the sections of the module and
the format of the module itself. With this information, editmod has what
it needs to create a module from scratch, display the contents of an
existing module, edit the contents of an existing module, or generate C
structure definitions suitable for inclusion in code that manipulates the
modules.
The remainder of this section describes some basic aspects of
editmod’s source language, shows the syntax of the language used to
describe the module contents, gives some ground rules that must be
followed when creating module descriptions, and details how to use the
editmod utility.
Features
The description files have the following features:
• C-like pre-processor editmod features a C-like pre-processor
that should be familiar to C programmers.
The additions and omissions are outlined in
a following section.
• C-like syntax editmod’s description files are written
much like C structure definitions and
assignment statements. The extensions to
the expression interpreter were outlined in a
preceding section.
The description language has the following features:
• Structures definition of a sequence of possibly
non-identically typed data items. A structure
may contain other structures or pointers to
other data items.
Pre-Processor
editmod has a built-in pre-processor that is very much like a C
pre-processor. The following sections give more specific information.
Exclusions
The following items are not included in editmod’s pre-processor:
• Macros editmod does not support the definition of
macros with arguments. The following is not
valid:
#define field(x, y) x->y
• Identifier catenation The ##syntax used by ANSI compilers is
not supported in editmod.
Additions
The following additional pre-processor directive is supported by
editmod.
#cinclude <filename> or #cinclude "filename"
• The #cinclude directive tells editmod to include filename as a
C header file. This syntax is used to allowed editmod to extract all
the non-macro #define’s from a C header file. Any header files
included by a header file included with #cinclude are considered
to be a C include file. With this technique, description writers can
include system header files and use symbolic names in help text to
aid the user while editing. For example, if modes.h was included,
S_IREAD could be used when entering device mode capabilities.
• All symbol names are available to the pre-processor during
pre-processor expressions. That is, one can test for the definition of
data structures with #ifdef, #ifndef, or #if defined(). This
can be useful for determining of a given structure has already been
defined by a previously processed .des file.
For example,
#if !defined(devcon)
struct devcon
{
u_int32 empty = 0;
};
#endif
Macro Definitions
_editmod is defined automatically to indicate that the editmod utility is
currently being used. For example,
• _editmod indicates that the editmod utility is being used. This
might be useful for C header files that are included via #cinclude
in description files.
• _editmod_HM indicates that editmod is reading a description file
while in header mode. See the emit keyword for an example of
where this may be useful.
• _DPIO indicates that the module being edited or listed is a DPIO
OS-9 system state program.
• M_EDIT is set to the edition of the module being edited or listed.
This may be used to allow editmod to handle multiple formats for the
same module.
The remainder of the automatically defined macros are operating
system or processor specific.
OS-9/68000 _OSK
OS-9 _OS9000
Expressions
The description file contains expressions in various contexts. editmod
has an extended expression interpreter that includes additional
constant types and operations on non-integer constants. The following
are the basic features:
• Constants character, hexadecimal, octal, decimal (See
below for additional constant types).
• Operators all non-assignment based operators are
included.
• sizeof() operation
• Variables members of other structures can be
referenced within expressions.
The following additional features are provided:
• Additional constant types
See the Use Instructions section on
expressions.
• numof() operation provided to determine the number of items
in a repeat structure.
Search Directories
The list of search directories is built of the following components in the
order listed:
1. User-specified directories.
Any directories specified on the command line with -v are added to
the list.
2. Directories dictated by the module (see options -nd, -nf, and -nm).
The directories that relate to the module being edited/listed are
added. If creation mode is being used, no additional directories are
added at this point.
For all types of modules the directory:
MWOS/SRC/DESC
is added to the list. This is where description files for non-descriptor
modules that are not operating system specific are located.
For non-descriptor modules, the configuration file is examined for an
entry indicating that the current module being edited needs a
specific directory added (refer to the section on the configuration file
for more information). If so, that directory is added to the list.
For all types of modules the directory
MWOS/os/SRC/DESC
Note
The location of MWOS and the pathlist separators varies on different host
OS’s.
OS-9/68000 MWOS/SRC/DEFS
MWOS/OS9/SRC/DEFS
OS-9/80386 MWOS/SRC/DEFS
MWOS/OS9000/SRC/DEFS
MWOS/OS9000/80386/SRC/DEFS
OS-9/PPC MWOS/SRC/DEFS
MWOS/OS9000/SRC/DEFS
MWOS/OS9000/PPC/SRC/DEFS
Configuration File
A configuration file is read to augment the search directories shown in
the preceding section. The configuration file can be found at
MWOS/SRC/DESC/editmod.cfg. It contains lines with the format:
name,os,directory
where name is the module, file manager, or device driver name whose
description files reside in a nonstandard directory, os is the operating
system that this particular override applies (OS9 or OS9000), and
directory is the directory to used in place of the standard pathlist.
Note
The items specified in the configuration file are only considered when
modules are being edited or listed. During module creation, the
directories for the description files are provided by using the -v option.
Help Text
Various parts of a description file may have help text associated with
them. This is the ASCII text that editmod uses to communicate with
the user as well as for emitting comments in the generated header files.
There is more information detailing where help text is used in the
following sections. The basic format of the help text is:
"name:semantics_help"
name is a short (generally less than 30 characters) name for the field.
This part of the help text is used when displaying the field for the user or
as the comment associated with the item in the generated header file.
semantics_help is the description the user sees when they ask for
help on entering a new value for the field.
As in ANSI C the help text does not have to be, nor is it allowed to be, all
in a single double-quoted string. editmod concatenates multiple
double-quoted strings in a row. The following example illustrates how a
help text appears in the description file, assuming module.h had been
included in the description files.
"Module permissions:"
"The module permissions enable/disable various classes of users
from accessing a\n"
"module. The following values can be used to set the bits:\n"
" MP_OWNER_READ (0x0001)\n"
" MP_OWNER_WRITE (0x0002)\n"
" MP_OWNER_EXEC (0x0004)\n"
" MP_GROUP_READ (0x0010)\n"
" MP_GROUP_WRITE (0x0020)\n"
" MP_GROUP_EXEC (0x0040)\n"
" MP_WORLD_READ (0x0100)\n"
" MP_WORLD_WRITE (0x0200)\n"
" MP_WORLD_EXEC (0x0400)\n"
If an item has help text it implies that the member is editable. Many
fields are not editable, yet they should have comments in the emitted
header file. Use dot(.) as the first character of the help text to indicate
an non-editable field that should have a comment if emitted in a header
file. For example:
u_int32 v_lun, ".Logical Unit Number";
This would define a non editable unsigned 32-bit integer item called
v_lun that would appear as
u_int32 v_lun; /* Logical Unit Number */
in a generated header file.
Refer to the following data structure specific section for information
concerning what style of help text is valid in what context.
#if defined(TERM)
/* /term descriptor specific information */
#endif
You must also define a pre-processor identifier (TERM or INIT in the
example above) to specify which module is being created.
A sample command line to create a module is as follows:
editmod -c term -dTERM
• -c specifies the creation mode.
• term is the name of the output file.
• -dTERM defines the pre-processor identifier TERM to the empty
string.
Description Files
Description files are text files that describe the format of modules. They
reside in directories shown in the following section. The description files
read by editmod vary depending on editmod’s operational mode.
editmod’s creation mode reads, by default, a single description file
called systype.des. Generally, this description file #include’s the
appropriate description files to generate a module. Again, the locations
of these included files is described in the following section.
editmod’s display and edit modes read description files based on the
module’s contents. If the module is a non-descriptor module, the
module name is used to construct a file name in the form
module_name.des. This description file and those that are
#include’s are read to determine the format of the module. For
descriptor modules, two description files with names based on the file
manager and driver names are read in sequence: a file named
driver_name.des then a file named file_manager_name.des.
These description files together define the format of the module.
File names generated by editmod are limited to the MS-DOS file
name format of a maximum of eight characters followed by an optional
dot and three character maximum extension. Since the extension is
always .des, the file’s base name is limited to eight characters.
Therefore, if a module’s name, file manager, or driver has a name
greater than eight characters, it is truncated to be exactly eight. For
example, if the driver was scp68681lc, the description file would be
named scp68681.des.
Description files contain three basic elements:
• Definition blocks
• Initialization Block
• Module Block
Structures
Structures define all the information related to a set of members. The C
struct is very similar in syntax to a structure definition.
location struct tag {
members
}, helptext;
• tag is the name that is associated with the structure. The importance
of the name will be seen later.
• members define the layout of data within the structure. The following
section describes the syntax of the members.
• helptext is a double-quoted string that is used when
communicating with the user during module display and editing. The
current user interface in editmod does not use the semantics
portion of the help text on structure definitions.
Each member of the structure may be either a:
• Numerical Member
• Pointer to Another Definition Block
• Sub-Structure
Numerical Member
A numerical member definition is in the form:
type name = expr , helptext;
type specifies the type of the numerical member. The valid types and
their general size and alignments are listed in the table below.
char 1 1 ’<val>’
u_char 1 1 hexadecimal
int8 1 1 decimal
u_int8 1 1 hexadecimal
int16 2 2 decimal
u_int16 2 2 hexadecimal
int32 4 2 decimal
u_int32 4 2 hexadecimal
The alignment shown in the table above is the most likely alignment for
the object with the exception of et_addr which has the same size and
alignment on all processors. Some target processors may have different
alignment characteristics.
See the section on header generation for information about type
aliases.
• name is the name of the member. This name is referenced by
initialization blocks.
• expr is an optional initialization expression. A numerical member
that does not have an initialization expression has a default value of
zero.
• helptext is a double-quoted string that is used when
communicating with the user during module display and editing.
Sub-Structure
A member of a structure may also be a sub-structure. The syntax for
defining such a member is:
struct name tag, helptext;
• name is the tag for the structure that is to be in the structure being
defined.
• tag is an optional name for the included structure. When editmod
is operating in header generation mode the tag field is not optional
so it is best to always include a tag field.
• helptext is the text emitted as a comment in a generated header
file. It must being with a dot(.). This text is not used to communicate
with the user; instead, the help text for the structure being named is
used.
A given structure can only be named as the sub-structure of only one
structure. Otherwise, it would be impossible to initialize sub-structures
because the name would be ambiguous.
u_int32 mem_start;
u_int32 mem_end;
} until (rep_struct.is_last), "Example repeat structure";
Arrays
Array definitions define a block of identically typed objects. The syntax
for defining an array is:
location array type name [ expr ] = { data } , helptext;
• location is where the array is to be placed. It may be either data
or code. If a location is not specified, the code area is assumed.
• type specifies the type of each element of the array.
• name is the name of the array. It may be referenced by pointer
structure members.
• expr is an expression for the size of the array. The array size may
be dependent on members of structures.
• data is a comma-separated list of expressions that initialize the
array. The array can be uninitialized. This is indicated by not
providing any initialization expressions.
• helptext is the text used to communicate with the user regarding
the array.
An example array might be:
code array int16 example_array[10] = {
1, 3, 5, 7, 9, -2, -4, -6, -8, 0
}, "An example array of numbers";
Strings
A string definition defines a NIL terminated list of characters. The
syntax is:
location string name = value , helptext;
• location is where the string is to be placed. It may be either data
or code. If a location is not specified, the code area is assumed.
• name is the name for the string. It may be referenced by pointer
arrays or pointer structure members.
• value is a double quoted string that defines the value for the string
data structure.
• helptext is the text used to communicate with the user regarding
the string.
An example string might be:
data string larry_string = "Larry", "Example string";
Initialization Block
Initialization blocks set values in data structures. They are used by
editmod when a module is being created from scratch. The syntax is:
init name[index] {
inits
};
• name specifies the name of the structure/repeat that is to be
initialized.
• index is the index into the variable length list of a repeat structure.
Although index is an expression, it must resolve to a positive integer.
If the item to be initialized is a structure, then index is omitted.
• inits is a series of assignments in the form:
name = expr;
• name is the member of the struct/repeat member that is to be
initialized.
• expr is the expression that the member is to be initialized with.
The following example demonstrates an initialization block:
struct example {
u_int16 mem1 = 0x10;
u_int32 mem2;
char mem3 = ’\0’;
};
init example {
Module Block
The module block defines the format for the entire module. Each valid
set of description files has a single module block. The syntax for a
module blocks is:
module { names };
names is a comma-separated list of names of data structures that are
part of the module.
Assuming two code area data structures (mod_head and code_info)
and a data area structure (data_info) had been defined, the following
is an example module block:
module {
mod_head,
code_info,
data_info
};
This defines the module to be mod_head followed by code_info in the
code area and data info in the data area. More information about
module blocks is presented in the full example at the end of this section.
Header Generation
editmod has the ability to generate C header files for inclusion in code
that deals with modules. The information related to this capability has
been gathered in this section for easy reference.
A header is generated by giving editmod the name of the description
file containing the symbol and the name of the symbol(s) to be emitted.
A number of features can be used within the description file to generate
an appropriate header file.
Type Aliases
Any basic type may have a type alias associated with it. The type alias
is the string to be emitted for the symbol when editmod is operating in
header file generation mode. The syntax is
<basic type> ("<type alias>")
The <type alias> string may include the printf-like format escape
%s that is replaced by editmod with the name of the symbol. Use of the
%s escape is not required. If the type alias is an empty string ("") then
editmod does not emit any information for that symbol. For example, if
the type desired for the header file is "char os9rev[4]", that array
might be represented in editmod’s language as:
int8 ("char os9rev[4];") os9level;
int8 ("") os9release;
int8 ("") os9major;
int8 ("") os9minor;
This would generate a header file containing
char os9rev[4];
and would allow editing of the individual fields of the four byte array.
emit <string>;
This syntax allows text to added to the emitted header file. It may only
be used within a struct or repeat. If editmod is not in header mode,
these lines are ignored. The following is an example of its use:
#if defined(DEV_SPECIFIC)
emit "#if defined(DEV_SPECIFIC)";
struct dev_specific v_devspec;
emit "#endif";
#endif
would appear as:
#if defined(DEV_SPECIFIC)
struct dev_specific v_devspec;
#endif
emit is useful for inserting pre-processing information into a header
file.
_editmod_HM macro
The pre-processor macro EM_HEADER_MODE is defined when editmod
is operating in header mode. This is useful for allowing editmod to see
an entire structure even when certain defines aren’t present. From the
previous example, if one were to generate a header file for the .des file
containing the text above with a command line like:
editmod pcf.des -h=pcf_lu_stat
One would not get any of the text shown above because
DEV_SPECIFIC would not be defined so the pre-processor would skip
all the text between the #if/#endif.
The example shown above should be written:
#if defined(DEV_SPECIFIC) || defined(EM_HEADER_MODE)
emit "#if defined(DEV_SPECIFIC)";
struct dev_specific v_devspec;
emit "#endif";
#endif
This causes the expected result while generating headers.
Example
The following example shows how to build, display, and edit a data
module. There are a number of steps involved:
number of wishes
names array
revenues list
"<name string>"
"<name string>"
"<name string>"
Revenues List
"<date string>"
date string
"<date string>"
date string
Line(s) Description
Line(s) Description
69 - 72 This init block creates the first node in the revenues list.
The amount is set to 10,000,000 and the string is
redirected to point to date1_string.
Line(s) Description
The following annotated hex dump shows the module follows the format
we chose:
Addr 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 2 4 6 8 A C
-------- ---- ---- ---- ---- ---- ---- ---- ---- --------------
00000000 fc4a 0100 b400 0000 0000 0000 a600 0000 |J..4.......&.
00000010 5505 0004 0080 0700 0000 0000 0000 0000 U.............
00000020 0000 0000 5000 0000 0000 0000 0000 0000 ....P.........
00000030 0000 0000 0000 0000 0000 0000 0000 0000 ..............
00000040 0000 0000 0000 0000 0000 0000 0000 1234 ..............
00000050 0300 0000 ab00 5c00 0000 7000 8d00 0000 ....+.\...p...
00000060 9b00 0000 9500 0000 a100 0000 8500 0000 ........!.....
00000070 8096 9800 7c00 0000 0000 0000 3933 2f30 ....|.......93
00000080 362f 3034 004a 6173 6d69 6e65 0041 6c61 6/04.Jasmine.A
00000090 6464 696e 004a 6166 6172 0047 656e 6965 ddin.Jafar.Gen
000000a0 0049 6167 6f00 6461 7461 0001 0203 0000 .Iago.data....
000000b0 00dd c420 .]D
Revenue amount : 0
New value: 50000000 enter the $50,000,000 revenue
1. Revenue amount : 0
2. Revenue date : NULL
#if !defined(_TYPES_H)
#include <types.h>
#endif
/* Module Data */
struct mod_body
{
u_int32 num_wishes /* Number of wishes */
u_int16 wishes; /* Offset to wish_array */
u_int32 names; /* Offset to name_array */
u_int16 revs; /* Offset to revenues */
};
467
4 Using the os9make Utility
os9make Commands
Dependency Entry
This specifies the relationship of a target file and the file(s) used to build
the target file. The entry has the following syntax:
<target>: [<dependent>] {[<dependent>]}
The list of files following the target file is known as the dependency list.
Comment Entry
This consists of any line beginning with an asterisk (*) or pound sign
(#).
In addition, in a Command Entry, all characters following a pound sign
(#) are treated as comments. The one exception to this is a digit
following a pound sign is considered part of a command entry. This is
because the OS-9 resident shell uses #<num> to increase stack space.
Note that an asterisk (*) in a Command Entry is treated as a wildcard
character, not a comment.
All blank lines are ignored.
Here is an example:
-b
# comment example
* comment line
all:
# example command
Include Entry
A makefile include entry tells the os9make utility to use a file that has
entries common to more than one makefile. The os9make utility
processes the lines of the “included” file as if they were in the current
makefile. This makes it easier to change information because you can
change it in one common file rather than each individual makefile. For
example:
include <pathname>
include opens the specified file <pathname> and processes the lines
from that file as if they appeared in the current makefile. You can nest
included makefiles up to seven times. For example:
include ../../../makesub.com
Macro Entry
A macro definition line has the following syntax:
<name> = [<value>]
This defines a macro called <name> with <value>. <value> can
contain references to other previously defined macros.
User defined macro names may contain any combination of “normal”
characters (A-Z, a-z) and numbers (0-9). Other “special” characters
may work in the current version of os9make, but this could change in
future versions.
Conditional Entry
Conditional entries allow the conditional parsing of the makefile.
Syntax
Conditional entries take advantage of ’if’ and ’endif’, and have the
following syntax:
if <boolean expression>
{lines}
endif
Entries may be extended using ’elif’ and/or ’else’:
if <boolean expression>
{line(s)}
elif <boolean expression>
{line(s)}
else
{line(s)}
endif
Conditionals may be nested to a maximum depth of 30 and may occur
anywhere (except in a comment, of course).
Boolean Expressions
The following boolean expressions are valid:
• make
The syntax for a make boolean expression is 'make(<target>)',
and is TRUE if <target> has been specified. For example, if make
is invoked from the command line, specifying 'ppc' as the target:
$ os9make ppc
then the following make expression is TRUE:
if make(ppc)
{line(s)}
endif
• defined
The syntax for a defined boolean expression is
'defined(<macro>)', and is TRUE if <macro> is defined. For
example, if TRGTS is defined, then the defined expression is
TRUE:
TRGTS = SunOS
if defined(TRGTS)
{line(s)}
endif
Operators
Boolean expressions may take advantage of the standard C boolean
operators &&, ||, and !, and the standard relational operators ==, !=,
>, >=, < and <=. The relational operators == and != are overloaded,
allowing string comparison capability. These operators are defined as
follows:
Operator Description
! Logical Not
== Equal
!= Not Equal
Operator Description
|| Logical OR
Arithmetic and string operators may only be used to test the value of a
variable. The left-hand side must contain the variable expansion, while
the right hand-side may contain either a string enclosed in double
quotes or a numeric value. Standard C numeric conventions (except for
specifying an octal number) apply to both sides. Examples:
if $(REVISION) == 87
if $(TARGET) == "403GAEVB"
Precedence
Arithmetic and string operators take precedence over &&, || and !.
The ! operator takes precedence over &&, which has precedence over
||. Parentheses may be used to further prioritize.
Table 4-2
Abbreviations Equivalent
ifdef if defined
ifexists if exists
ifmake if make
ifndef if !defined
ifnexists if !exists
ifnmake if !make
os9make Operation
The os9make utility starts by reading the entire makefile and setting up
a table of dependencies exactly as listed in the makefile. When the
os9make utility encounters a name on the left side of a colon, it first
checks to see if it has encountered the name before. If it has, the
os9make utility connects the lists and continues.
After reading the makefile, os9make determines the target file(s). The
target file is the main file to be made on the list. It then makes a second
pass through the dependency table.
During the second pass, the os9make utility looks for object files with
no relocatable files in their dependency lists and for relocatable files
with no source files in their dependency lists. This facilitates program
compilation. If the os9make utility needs to find any source files or
relocatable files to complete the dependency lists, it looks for them in
the specified data directory, unless a macro is specified.
The os9make utility does a third pass through the list to get the file
dates and compare them. When the os9make utility finds a file in a
dependency list that is newer than its target file, it executes the
specified command(s). If a command entry is not specified, a command
is generated based on the assumptions given in the next section.
Because the operating system only stores the time down to the closest
minute, the os9make utility remakes a file if its date matches one of its
dependents.
When a command is executed, it is echoed to standard output unless
the -s, or silent, option is used or the command line starts with an “at”
sign (@). When the -n option is used, the command is echoed to
standard output but is not actually executed.
If your system runs out of memory while executing a command, you can
redirect the output of the os9make utility into a procedure file and
execute the procedure file.
The os9make utility normally stops if an error code is returned when a
command line is executed. Errors are ignored if the -i option is used or
a command line begins with a hyphen.
Files Definition/Rule
Files Definition/Rule
Description Default
Compiler cc
Assembler r68, a386, or a ppc
Linker cc
Mode ucc
Directory for all files The current data directory (.)
Note
Only use the default linker with programs that use Cstart.
Modes
Three modes are built into the os9make utility.
Mode Specification
compat The compat files reflect the compat mode of the Ultra C
executive. This is also the mode you use if you are still
using the V3.2 C Compiler.
c89 The c89 rules reflect the c89 mode of the Ultra C
executive.
ucc The ucc rules reflect the ucc mode of the Ultra C
executive
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
Refer to the Using Ultra C/C++ manual, the Using the Executive
chapter for more information about Ultra C/C++ modes.
Note
If a macro is defined in your makefile and then redefined on the
command line, the command line definition overrides the definition in
the makefile. This feature is useful for compiling with special options.
In order for the os9make utility to be more flexible, you can define
special macros in the makefile. The os9make utility uses these macros
when assumptions must be made in generating command lines or
searching for unspecified files. For example, if a source file is not
specified for program.r, os9make searches the specified directory,
SDIR, or “.”, for program.a (or .c, .p, .f).
Macro Description
Macro Description
Macro Description
$@ The current target, including its full path and any suffix.
$* The base name of the target. That is, the target name
minus any pathlist or extension.
$? The list of files that were found to be newer than the target
on a given dependency line.
Generates:
cc x.r, not cc x.r y.r z.r or cc prog.r
You can include options on the command line when running the
os9make utility or in the makefile for convenience.
Note
The os9make utility language is highly specific. Therefore, use caution
when using dummy files with names like print.
The mshell utility started as a port of OS-9’s standard shell to OS-9 for
68K. From that point, enhancements replaced some built-in features of
OS-9 and features unique to the mshell utility were added. Now, the
mshell utility contains many of the same features as UNIX shells, as
well as some OS-9/OS-9 for 68K specific options.
Note
The mshell utility is a superset of the shell utility, thus the shell
utility’s command line options, syntax, built-in commands, and behavior
are not re-documented here.
The mshell utility has many features that do not exist in the standard
OS-9/OS-9 for 68K shell. These features fall into three basic categories:
• Procedure files
487
5 Using the mshell Utility
To automatically execute the mshell utility when you log in, you must
change your password file to include mshell as the initial program to
execute. Also, you should load the mshell utility when the system
starts so that it is in memory when the login utility runs. login
requires that the initial process be in memory or in the user’s personal
execution directory. Place a line like the following in your start-up file to
load mshell from the disk into memory:
load mshell
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
Refer to the Using OS-9 or Using OS-9 for 68K manual for information
about the login utility and system start-up file.
Key Description
^f Cursor forward
Key Description
** The first time you press ^z, the cursor goes to the beginning of the line, the
next time it goes to the end of the visible line, in effect toggling back and
forth between the beginning and end of the line.
* When you use ^p or ^n, insert mode returns to its default value. Refer to the
-m command line option for information about the insert mode.
You can press <return> when the cursor is at any point in the command
line. mshell processes the entire command.
Note
Insert mode remains in its current state until a new command line is
displayed. The command line editing keys that work on the current
command line (for example, ^b) do not reset the insert mode to its
default. Keys that replace the entire command line (^p or ^n) cause
the insert mode flag to return to its default.
Note
When changing text in the middle of a command line, use ^z instead of
^a. ^a displays and goes to the end of the previous command line. ^z
allows you to edit the current command line.
Note
The control characters from the path descriptor take precedence over
your command line editing keys. Use the tmode utility to check your
path descriptor. If any of the SCF control characters clash with
mshell's editing characters, you should either choose a new character
for the mshell editing key or change your path descriptor. For
example, to override the reprint line (^d) character in your path
descriptor, put a tmode reprint=0 command in your .login file.
Then, you can use ^d to delete characters.
History Buffer
mshell maintains a variable sized history buffer for each of its shells.
The history buffer contains a record of each command line that you
enter. You can use this buffer to duplicate and/or edit previously entered
commands. By default, mshell preserves as many as 40 command
lines in the history buffer.
The built-in hist command allows you to view your history buffer. Key
in hist to display the history of commands and corresponding buffer
index numbers.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the Built-in Commands section, and the mshell Command Line
Options section, to learn how to change the size of the history buffer.
Note
The ~<num> and ~<word> syntaxes are forms of history substitution
that you can do anywhere on the command line. If your eighth history
entry was procs, your ninth entry was dir, and you entered ~8 -e;
~di -e mshell would execute procs -e ; dir -e.
History Substitution
To re-execute a command from history:
~<num> or <word>
To place history entry into the ^A buffer for editing:
~~<num> or ~~<word>
View History
To display the history buffer:
hist
Use the -r option to pass your history from mshell to mshell. That is,
you could accumulate some history, use µmacs, fork a shell out, and
still retain your history. Of course, upon exit any history created in the
child shell of µmacs would not be available to the parent of µmacs.
Use the -s option to save your history across login sessions. The -s
option saves your history into a temporary file when you log out, and
reads from that same file when you log in the next time.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the Built-in Commands section, and the mshell Command Line
Options section, for details about the -r and -s command line options.
If you enter the same command line twice in succession, mshell does
not increment your history counter. This keeps the history buffer from
filling up with duplicate commands, and allows as many unique
command lines as possible.
History Compression
The -h option enables history compression. -h causes the mshell
utility to search the entire current history for a matching command
before adding a new history entry. When the -h option is in effect, the
history index numbers can be misleading.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the Built-in Commands section, and the mshell Command Line
Options section, for details about the -h command line option.
Command Completion
You enter a partial file name in the command line and mshell
completes it. mshell does a wildcard match on the partial pathlist and
displays the matching file name on the command line.
For example, in a directory with the files test1.c, file, file2, and
file3, if you enter:
del fi<esc>
mshell replaces your command line with the matching file name and
places the cursor at the end of the line:
$ del file
You are free to backspace over the file name if it is not the one you are
looking for. Press <esc> again before typing any other characters;
mshell displays the next file (in alphabetical order) in the directory that
begins with fi (file2), and so forth. A bell sounds when there are no
more files that match the pattern.
mshell’s file name completion feature is intelligent; it knows the
structure of file names. When you enter make -f=make and press
<esc>, mshell knows that you are looking for a file that begins with
make, not -f=make.
As an environment variable, FILEC is also available to control how
mshell behaves when performing command completion. There are four
different possible values for command completion. These values are
shown below:
<not set> or histbell when the pathlists that match the pattern
are exhausted, the terminal bell rings
and the last matching entry remains
loop when <esc> is hit after the last
matching entry, the list of matching
entries starts over again from the
beginning
bounce when <esc> is hit after the last matching
entry, mshell moves backward through
the list
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the Built-in Commands section, and the mshell Command Line
Options section, for the mshell command line options (-q), details
about changing the default.
Assign
To view all of your current aliases, enter assign with no arguments.
Unassign
Use the unassign command to remove assigns. unassign takes any
number of arguments and does not report errors when unassigning
words that are not assigned.
mshell allows you to pipe standard output and/or standard error from
one process to another. You may use this to capture all output and error
messages of a process. Use the following command separators:
Separator Description
! Standard output
!! Standard error
For example, to pipe both the normal and error output of cc to pr:
cc -g -td=/r0 testprog.c !!! pr
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the Built-in Commands section, and the mshell Command Line
Options section, for information on -np.
To start the batchfile process, enter the first line of the batchfile on the
command line, but put a backslash (\) character at the end. This tells
mshell that you want to create a batchfile. mshell then begins
prompting with a question mark (?). Carriage return (<cr>) on a blank
line terminates the batchfile creation and starts the execution. Press
<esc> as the first character on any line to terminate the creation of the
batchfile and return to the normal shell prompt.
The question mark (?) prompt is treated like any other prompt. mshell
provides file name completion and history access via <esc>.
The following is an example batchfile creation session to copy all *.c
files to BACKUP/*.bak:
$ while (next_file(fn,"*.c")) \
? copy -rb=32 %fn BACKUP/%(fn:r).bak
? endwhile
? <cr>
You can set the environment variable _BATCHDEV to the device that you
want mshell to use for the temporary batchfile. For example, the
following line causes the command line batchfile facility to use the RAM
disk for its temporary file:
$ setenv _BATCHDEV /r0
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the mshell Command Line Options, for more information about the
PN argument.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
For instance, use the following line to fork mmacs from within a
procedure file:
umacs $(HOME)/tempfile <>>>$(PORT)
This allows a user at any terminal with any HOME directory to use the
procedure file.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
For example:
$ let a = "hello there"
$ echo %a or echo %(a)
hello there
Programming variable substitution is performed after environment
variable substitution.
Note
You must specify modifiers after the variable name and separate them
from the variable name by a colon (for example, $(HOME:q) or
%(filename:rq). The modifiers are applied in the order in which they
appear and may be separated by any number of colons (:).
Modifier Description
h Strip the file name and slash (/) (if applicable) from the
variable, leaving the directory that contains the file name.
r Remove the suffix (all characters from the last period (.)
forward) from the variable.
e Remove the entire pathlist and file name, leaving only the
suffix portion of the variable.
Modifier Description
The following examples show the modifier applied and the resulting
value if the variable had the value at the top of the column:
h . /h0/USR/RIC .
e c c (empty
string)
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
Built-in Commands
Note
To change a command line option:
You can change a command line option at any time with the dash (-) or
set command.
profile Command
The built-in profile command allows you to execute a procedure file
without forking a child shell. This can be useful for changing directories
and setting the environment from within a procedure file. A profile
procedure file can take arguments just like a normal procedure file. The
syntax is:
Command Description
Command Description
pushd -<num> Take stack item number num, put it on the top of
the stack, and chd you to that directory.
popd Pop the top off the stack and chd to the new top
item.
Note
You can also use prenv to display specific environment variables. For
example, to examine the variables HOME and frog you use:
set Command
Use the built-in set command to examine the current mshell options.
Enter set on the command line to display all of the current options and
any strings associated with them. You can also use set to examine the
current command line editing keys. The following is sample output of the
set command:
Current Shell Options
Prompt = ON (@%(nBugg_$ )
Error Messages = OFF
Invocation Initialization = OFF
Echo = OFF
Verbose = OFF
Debug Mode = OFF
Debug Message Log = OFF
Profile Batchfiles = ON
Auto Logout = ON
Abort on Error = OFF
Fancy ReadLn = ON
Default Insert Mode = OFF
Alter-Echo = ON
History = OFF
History Save/Load = OFF
History Passing = ON
History Compression = ON
Alias Passing = ON
Shell Line Editing Chars:
PvLine=^P NxLine=^N PvChar=^B NxChar=^F Ins=^I Del=^D
Ends=^Z Kill=^K
which Command
The which built-in command displays where to find a module or file of
the given name and the nature of the files (module or procedure file).
For example:
$ which procs
procs - in-memory module
/h0/CMDS/procs - module - on PATH
$ which procfile
procfile - procedure file - current data directory relative
$ which cd
cd - aliased to ’chd’
$ which chd
chd - built-in mshell command
-<char> -n<char>
Option Description
-a Alter-echo
When this option is enabled, all lines that are changed
between the time they are entered and when the process is
ready to be forked are echoed. Changes might include
environment variable, interpreter variable, or history
substitution. Command name alias substitution does not
cause the line to be echoed. The default is -a.
-b Profile batchfiles
This option determines the execution method of batchfiles
created from the command line. If you use -b, batchfiles
are executed as profiled procedure files. Otherwise,
batchfiles are executed as procedure files under a different
mshell. The default is -b.
Option Description
-c History buffer
This option sets the size of the history buffer, turns on the
default history buffer, or turns the history buffer off. It may
take a size argument: the number of command lines saved.
For example:
-c: Turns on the default 40 command line history buffer.
-c=10: Turns on a ten command line history buffer.
-nc: turns off the command line history buffer.
The default is -c=40.
-d Debug mode
This option enables/disables the debugging mode built into
mshell. When -d is enabled, processes are forked under
user control. The default is -nd.
-f Fancy readln
Fancy-readln controls the routine mshell uses to read
from the user on an SCF device. -f enables command and
pathlist completion, editing control characters, and a
non-blocking readln command line. This mode has two
drawbacks:
• I/O can be done to the device between characters.
• When running mshell over the network, it can cause
excessive traffic.
-nf causes mshell to use the standard SCF readln. The
default is -f.
Option Description
-h History compression
-h, when enabled, causes mshell to search the current
command line history after each command is entered. If a
matching command line is found, no new history entry is
created. This prevents repetition of matching command
lines. The default is -nh.
-m Insert mode
When you enable -m, the default editing mode is insert. If
you back into the command line’s text (with ^b) and type,
the characters are inserted into the command line rather
than overwriting existing characters. The default is -nm,
overwrite mode.
Note
The insert mode remains in its current state until a new
command line is displayed. The command line editing keys
that work on the current command line (for example, ^b)
do not reset the insert mode to its default. Keys that
replace the entire command line (for example, ^p) cause
the insert mode flag to return to its default.
Option Description
-o Time-out
The -o option allows you to specify the number of minutes
to allow an mshell sit at an empty command line prompt
before timing out. The default is -nf (no time-out). The
syntax to enable -o is:
-o[[=]<n>]
n is the number of minutes to sit before timing out. The
default for n is 480 minutes (eight hours).
-q Alias passing
This option controls whether or not your assigns are kept in
the environment. Regardless of this option, assigns are
passed to all procedure files executed.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
-r History passing
This option controls whether or not your history is passed
from mshell to mshell. The default is -nr.
Option Description
-s History saving
This option determines if your history is saved when you log
out and read when you log in. Without -s, you start each
login session with an empty command line history. The
default is -ns.
Each time mshell starts, it searches for the .shellrc file in your
HOME directory. You can use the .shellrc file to set shell options
which are not passed in the _SHELLPARAMS environment variable. If
the file is found, it is executed in the same manner as the .login file is
executed when you log in. This feature is controlled by the -i option
(see the mshell Command Line Options section). In the case of the
“login shell” it is executed after the .login script file. Therefore, any
options set in the.login file can be changed in the .shellrc file. It is
not considered fatal if there is no .shellrc file, but if it does not, it is
more efficient to use the -ni option (default) to keep it from being
checked each time.
For example, the -c option is not passed in the _SHELLPARAMS
variable. You can create a one line procedure file named .shellrc in
your HOME directory containing the -c=50 command. Then, as long as
the -i option is in effect, each forked mshell automatically has a
50-entry history buffer.
To use the -i option effectively, you must understand the order of
certain mshell operations. When you run mshell, it:
1. Processes the .login file (login shell only)
2. If the -i option is enabled, processes .shellrc
3. Processes the initial command line specified as arguments to
mshell
4. Prompts you for further command lines
Note that the .shellrc file processing is done before the initial
command line to mshell. This means that a password file line such as
the following does not behave as expected:
joe,user,1.0,128,/h0/CMDS/JOE,/h0/USR/JOE,
mshell -ip="Joe: "
mshell enables the -i option after the check to see if -i is enabled. It
is better to place the -i option in the .login file. Also, the following
command line does not behave as you might expect:
$ mshell -i
Escape Replacement
Escape Replacement
Escape Replacement
%h, %n, and %s may have any of the following optional delimiter
characters specified:
These characters and their matching close characters delimit the value
if the value is non-zero. If the value is zero, no characters appear for the
format escape. For example:
$ -p="[%h]Test%(n: " set the prompt
[31]Test: pushd .. push a directory
0. /h0/usr the directory stack
1. /h0/usr/ric
[32]Test(2): -nc turn off the history buffer
[0]Test(2): notice the [0] is there because
no delimiter character was used
with the %h
Any unrecognized escapes are simply left in the prompt text. For
example:
-p="%xHello: "
Yields a prompt of %xHello:. To include a percent sign (%) in a prompt
use %%.
Note
This feature causes read errors for background processes that read
from the same port as an mshell.
mshell Directives
You may follow directive lines with an optional semi-colon (;) and any
other text. The following lines are valid:
do execute(strcat("del ", %fn))
do execute(strcat("del ", %fn));
do execute(strcat("del ", %fn)); This is a comment
do execute(strcat("del ", %fn)) ;* This is a comment
Directives take expressions as their argument. Expressions may
contain any of the following four elements:
• Operators
• Variables
• Function Calls
• Constants
Operators
Expressions are formed from operands separated by operators. The
operands may be any combination of variables, functions, and
constants. See the following table for a list of operators and their
precedence.
~, -, + Unary
*, /, %, &, ^ Arithmetic/Bit
+, -, | Arithmetic/Bit
Variables
When you reference a variable in an mshell procedure file, you can
specify either the variable’s name or its value. To assign a new value to
a variable, refer to the name of the variable. To use the value of a
variable, precede the variable name with a percent character (%). For
example, the following command assigns a value to x (by referring to
the name x only), and refers to the value in var (by preceding the name
var with a percent character (%).
let x = %var
Note
Global variables are given values by the let directive and assign()
function. They may be assigned in or out of procedure file functions
(PFFs).
Local variables are assigned values inside of PFFs via the llet
directive or the lassign() function.
For each variable reference, the locals are searched first (if applicable),
then the globals are searched. This causes local variables to take
precedence over globals of the same name. See the function and
return directives for more information on PFFs.
Functions
mshell has a number of built-in subroutines (functions) which you can
call from within expressions. A function may take as many as three
expressions as parameters (which may, in turn, have functions in them).
The number of parameters for each function varies.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
Example:
let a = len(%b)
The statement above places the length of the string held by %b into the
variable a.
Constants
There are four types of constants:
• Quoted String Constants
• Integer Constants
• Logical Constants
• Identifier Constants
Escape
Character Replacement
b Backspace (0x08)
l Line feed
n Carriage return
r Carriage return
Escape
Character Replacement
t Tab
\ Backslash
Integer Constants
Integer constants begin with a digit and continue until the first non-digit
character is reached. All integers are stored as signed 32-bit values and
may not have values that would require more storage.
Logical Constants
Logical constants are TRUE, FALSE, READ, WRITE, and UPDATE. They
appear in expressions as strings of characters without the double-quote
characters. As in C, TRUE is equal to 1 and FALSE is equal to 0. READ,
WRITE, and UPDATE are explained in more detail in the section on I/O
functions.
Identifier Constants
An identifier consists of a string of characters beginning with an
alphabetic (A-Z, a-z) or underscore (_) character, followed by any
number of alphanumeric characters and underscores.
Examples
In the examples that follow, constants are shown in italics.
Quoted string:
let a = "This is a test."
if (strcmp(%a, "HELLO") == 0)
print("%s\n", "Something is very wrong here!")
endif
Integer:
let a = 127
if (%a >= 256)
print("Something is very wrong here! %s >= 256\n",
%a)
endif
Logical:
let a = TRUE
if (%a == FALSE)
print("%s\n", "Something is very wrong here!")
endif
Identifier:
let a = 127
label infinite_loop
echo "Stop me!"
goto infinite_loop
Note
The representation of items within the interpreter is strings of
characters. Conversion to integer is done when necessary, but only for
computations. The end result of all expressions is a string.
Directive Descriptions
Directives tell mshell how to execute a particular procedure file. There
are directives which support unconditional and conditional branching,
looping, variable assignment, functions, and the printing of expressions.
This chapter contains the syntax and descriptions of all mshell
directives. Unless otherwise noted, directives may only appear in
procedure files; you may not enter them directly from the command line
(with the exception of batch file creation as described in the Command
Line Batchfiles section.)
Syntax
Throughout the directive descriptions, certain conventions are used to
describe directive syntax:
Convention Description
[] Optional
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
while (get_data(fn))
print("I’m about to rename %s\n",
%fn);
endwhile
**** restart at the beginning of the data
data reset
while (get_data(fn))
rename %fn %(fn:r).bak
endwhile
Any number of data/enddata sets may appear in
a procedure file. You can use a backslash (\) to
continue the data lines on the next physical line.
Command Description
mshell Functions
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Command Description
Example Programs
This program segment asks the user for a new TERM environment
variable, allowing <cr> or <esc> to accept default:
setenv TERM kt7
print("TERM = (%s) ", env("TERM")); print the prompt
let ans = input(); get some input
* if they typed something and it wasn’t escape
if (len(%ans) && asc(%ans) != 27)
setenv TERM %(ans:q); * set a new TERM
endif
569
6 Using the shell Utility
The shell utility reads data from its standard input which is usually the
keyboard or a file and interprets the data as a sequence of commands.
The basic function of the shell utility is to initiate and control execution of
other programs.
Usually you enter the shell utility automatically when you log into the
system. The shell utility displays a dollar sign ($) prompt to show that it
is ready and waiting for a command line. You can create a new shell by
typing shell optionally followed by a command line.
The shell utility reads and interprets one text line at a time from
standard input. After interpreting each line, the shell utility reads
another line until an end-of-file condition occurs, at which time it
terminates itself.
The shell utility may also be given a command in its argument list. In
this case, the shell utility processes the specified command as if it was
typed on a shell command line. Control returns to the calling program
after the single command line is processed. If a command is not
specified (shell<cr>) or the command is a shell utility option or
built-in command (such as chd and chx), more lines are read from
standard input and processed as normal. This continues until an
end-of-file condition or the logout command is executed.
Note
The shell’s ex command does not recognize utility options unless they
are separated from the utility name with a space. For example,
ex procs -e works properly, but ex procs-e does not.
Note
If a command uses an option to search for a file in the current execution
directory, wildcards may produce unexpected results.
The shell utility reads the current data directory or the given relative
pathlist containing a wildcard and passes these file names to the
command. If the command then tries to find the files relative to the
execution directory, the search fails.
For each user on a system, the shell utility maintains a unique list of
environment variables. These variables affect the operation of the shell
utility or other programs subsequently executed. They are
programmable defaults that you can set to meet your individual needs.
All environment variables can be accessed by any process called by the
environment shell or descendent shells. This allows you to use the
environment variables as global variables.
Note
If a subsequent shell redefines an environment variable, the variable is
only redefined for that sub-shell and its descendents.
Name Specification
Name Specification
USER This is the user name you type when prompted by login.
Name Specification
Name Specification
_sh This specifies the base level for counting the number
of shell levels. For example, set the shell prompt to
"@howdy: " and _sh to 0:
$ setenv _sh 0
$ -p="@howdy: "
howdy: shell
1.howdy: shell
2.howdy: eof
1.howdy: eof
howdy:
Note
The following section applies to OS-9 systems only (does not apply to
OS-9 for 68K systems).
When the following syntax is used, the shell utility replaces the
environment variable with the value of the environment variable:
$(<env var>)
Note
The following section applies to OS-9 systems only (does not apply to
OS-9 for 68K systems).
Note
The shell utility keeps track of the number of parameters passed to
any given procedure file with the PN variable.
When the procedure file has finished executing, the shell utility
environment returns to its previous state. The variables P0, P1, etc. are
not passed from the procedure file back to the shell utility.
Note
Microware suggests that you not use setenv to set variables such as
P0, P1, etc. as they are not passed between the shell and the
procedure file.
The login shell is the initial shell created by the login program to
process the user input commands after logging in.
Two special procedure files are extremely useful for personalizing the
shell environment:
• .login
• .logout
To use these files, they must be located in your home directory. The
.login and .logout files provide a way to execute desired
commands when logging on to and leaving the system.
The login shell processes .login as a command file immediately after
successful login. This allows you to run a number of initializing
commands without remembering each and every command. After
processing all commands in the .login file, the shell prompts you for
more commands.
The main difference in handling the .login file is that the login shell
itself actually executes the commands rather than creating another shell
to execute the commands.
You can issue such commands as set and setenv within the.login
file and have them affect the login shell. This is especially useful for
setting up the environment variables PATH, PROMPT, TERM, _sh, and
for OS-9 (non-68K), MDHOME and MDPATH.
The following is an example .login file:
setenv PATH ..:/h0/cmds:/d0/cmds:/dd/cmds:/h0/doc/
spex
setenv PROMPT "@what next: "
setenv _sh 0
setenv TERM abm85h
querymail
date
dir
The shell command line consists of a keyword and any of the parts
listed below. The keyword appears first on a command line. The order
of the optional parts depends on the nature of the command and the
The µMACS utility is a screen-oriented text editor you can use to create
and modify text files. The µMACS utility maintains multiple buffers so you
can work with several files and/or portions of the same file at once.
591
7 Using the uMACS Utility
uMACS Overview
The µMACS utility features an extensive command set. You can bind a
command name to a key or key combination. When a command is
bound to a key or key combination, instead of typing the command
name, you can press the key(s) to execute it. By binding and unbinding
keys to commands, you can personalize µMACS to your own
configuration.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
All key sequences have one or two characters. All two character key
sequences begin with a <control>x or an <escape> character.
To simplify personalizing commands, use µMACS to build macros. The
macro command can consist of any sequence of commands that are
bound to keys.
Terminal Capabilities
The termcap file contains information about terminal capabilities.
µMACS looks for the termcap file in the /dd/SYS directory (/dd is the
default device for your system). If it is not found, µMACS looks in
/h0/SYS and then /d0/SYS.
Refer to the section titled: The Termcap File, for information about the
termcap file and basic terminal capabilities required by µMACS.
Format Commands
Extensive formatting commands allow you to reformat paragraphs with
new user-defined margins, transpose characters, capitalize words, and
change words or sections into upper or lower case. Tab handling
features allow µMACS to work with most existing text files.
Buffers
µMACS holds as many buffers as memory permits. If buffers contain
µMACS commands, you can execute them like procedure files. At all
times, µMACS keeps a precise account of where you are in each buffer.
This allows easy access and easy editing between buffers.
Note
In this manual, references to control characters use the circumflex (^)
notation unless specifically referring to the <control> key or a
command that uses the circumflex.
Execute Commands
To execute any command by name, type <esc> x. This is the
execute-named-command command. It moves the cursor to the bottom
of the terminal screen. Type the name of the command and press
<return>. µMACS tries to execute a command by that name. If the
specified command does not exist or is incorrectly spelled, µMACS
returns the error message [No such function].
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
This is useful as a short cut or when you are uncertain of the spelling or
full name of the command.
Key Bindings
Most commands are bound to keys. All key bindings consist of one or
two characters. All two character bindings begin with the <escape>
character or ^x. Use the following commands to change the default key
bindings.
bind-to-key <esc> k
unbind-key <esc> ^k
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
Repeat Commands
You can use an argument buffer to execute a command a specified
number of times. To specify an argument buffer, press <esc> and type
<n>, where <n> is the number of times to execute the command. You
can use a positive or negative number. If you use a negative number,
the normal direction of the command is reversed.
For example:
• <esc>-10^f
Move the cursor back ten characters.
• <esc>10^f
Move the cursor forward ten characters.
Abort Command
You can abort commands that have not begun moving the cursor or
formatting or editing text. This is useful when aborting commands that
require input.
To abort a command, press ^g.
Macro Commands
µMACS allows you to create macro commands. To do this, use the
following commands:
Step 1. Start the macro command with the name begin-macro or the
begin-macro key sequence:
^x(
All commands and text entered between the execution of these two
commands make up the macro command.
To execute the macro, use the execute-macro command or the key
sequence ^x e. This executes all commands and enters all text that
makes up the macro. The commands are executed in entry order.
For example, the following series of commands or key sequences would
move the cursor to the beginning of the line, insert a tab and move the
cursor to the beginning of the next line..
begin-macro ^x(
begining-of-line ^a
handle-tab ^i
next-line ^n
begining-of-line ^a
end-macro ^x)
commands to the given bindings before loading any files into µMACS.
Any other µMACS commands in this file are also executed at this time
(for example, macro definitions).
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
This section acquaints you with µMACS window and buffer handling.
This will help you understand many of the related commands and how
µMACS is organized.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
µMACS can display multiple buffers on the screen through split screen
windows. A window may be as small as one line of text and a status line
or it may fill the entire screen. At the bottom of each window is a status
line. At the bottom of the entire screen is a single blank line that µMACS
uses to display prompts and error messages for the current window.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
File name
Buffer name
Current modes
µMACS version
Switching Windows
µMACS supports many commands that allow you to move the cursor
between windows. To move to another window, do one of the following:
• Specify a buffer by name.
• Specify the next or previous buffer.
• Specify the next or previous window.
µMACS uses a global buffer to copy text, thus allowing you to move text
from one buffer to another.
Start uMACS
Option Description
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the uMACS Editing Modes section of this chapter for information
about changing modes.
Opening a file in VIEW mode allows you to look at the file; you cannot
edit it. To edit the file, you must change the mode.
When you execute the umacs command, if the file(s) are found, µMACS:
• Reads and displays the first file specified on the command line.
Input/Output Command
µMACS allows you to load files into existing or new buffers. With two
exceptions, all files are read into buffers unchanged.
• All unprintable characters, with the exception of tabs and carriage
returns, are displayed as control characters. For example, a form
feed is displayed as ^L.
• All lines with more than 255 characters have a carriage return
inserted after the 255th character, regardless of word breaks.
µMACS alerts you to this with a message at the bottom of the screen.
This limitation only affects loading files. Once loaded, a file may
have lines of any length.
The following summarizes the commands used to access files and the
shell.
Insert File
The insert-file command (^x ^i) prompts you for a file to insert. If
the file is found, it is inserted directly before the cursor.
Read File
The read-file command (^x ^r) prompts you for a file to read into
the current buffer. If the file is found and you have edited any portion of
the file currently in the buffer, µMACS asks if you wish to save the
changes in the file. If you do, the new file is not read.
Note
If you do not wish to save the existing file, the new file is read into the
active buffer. In this case, saving the file removes the currently existing
file from the µMACS work space, not from your directory. It also changes
the filename associated with the buffer.
Find File
The find-file command (^x ^f) prompts you for the name of a file to
read into a new buffer. The new buffer is given the name of the file,
unless a buffer with that name already exists. In this case, µMACS
prompts for a new buffer name.
View File
The view-file command (^x ^v) is similar to the find-file
command. It also prompts you for the name of a file to display. Unlike
find-file, in which the buffer is opened in EDIT mode, view-file
opens the file in VIEW mode. If a new buffer is opened, it is given the
name of the specified file, unless there is an existing buffer with that
name. In this case, µMACS prompts for a new buffer name.
In all cases, if you specify a file that exists in the µMACS buffer list, that
file is used instead of reading a file from your directory. If this is done,
µMACS displays a message at the bottom of the screen.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
When saving or writing files, µMACS rewrites any file with the same
-6-
All files read into µMACS are by default in EDIT mode, unless you
specify the VIEW mode. µMACS has six modes of operation.
You can run any of these modes simultaneously, although some
combinations do not make sense. For example, EXACT mode is often
used in combination with any other mode. The VIEW mode, however,
takes precedence when any other mode is on and does not allow you to
overwrite or insert any character. Unless you specify VIEW mode, all
modes are by default EDIT modes. This means that all unbound
characters are inserted into the text at the cursor position.
Mode Description
Mode Description
CMODE Lines ending with a left bracket ({) cause the next line to
be indented an extra tab.
Lines beginning with a right bracket (}) are indented
one less tab than the previous line.
A pound sign (#) with only preceding tabs or blanks
causes all tabs and blanks to be deleted on that line.
This causes all lines beginning with a # to be formatted
at the left margin. This is used to identify preprocessor
commands.
Adding tabs, brackets, or pound signs does not change
the rest of the file.
CMODE is automatically turned on for any buffer-name
ending in .c or .h.
The following is a summary of the commands you can use to add and
delete modes.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
Exit uMACS
Save or write your files, one at a time, using the save-file command
(^x s) or the write-file command (^x ^w). Then, use the
exit-emacs command (^x ^c). This alerts you if there are any
unsaved files that have been changed. If there are no changed,
unsaved files, you exit µMACS. If there are changed, unsaved files, you
must answer a y/n (yes/no) prompt to stay in µMACS or exit without
saving the files.
The quick-exit command (<esc> z) automatically saves all files
that you changed in µMACS and exits.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
• Delete.
Use delete commands to delete a character, a word, lines, regions,
and blank lines. You can place text in a kill buffer and insert text from
the kill buffer to the position before the cursor.
• Search and replace.
Use search and replace commands to find and replace strings.
• Region commands.
Use region commands to mark region boundaries, copy and delete a
region, change all letters within a region to upper or lower case, and
paste the kill buffer at the cursor position.
• Format.
Use format commands to format text. For example, you can change
a word’s character case, reformat paragraph margins, and transpose
characters.
• Buffer commands.
Use buffer commands to list information about buffers and change
file and buffer names.
• Window commands.
Use window commands to open new windows, duplicate a window,
scroll to another window, and delete, move, shrink, or enlarge
windows.
Note
Note that the commands above use the eight-character substring
beginning rather than the nine-character substring beginning.
Note
A word is defined by any character(s) enclosed by either space, tab,
and/or newline characters.
Go to a Specified Line
The go-to-line command (<esc> g) moves the cursor to the first
character of the specified line. The <esc> g command needs a line
number argument before the command.
To find the current line number, use the buffer-position command
(^x =). The correct syntax is thus changed to <esc> <line#><esc> g
Insert Text
See the Cursor Positioning section of this chapter for information about
moving the cursor.
Step 1. Use any of the cursor positioning commands to move the cursor and
type any unbound key.
Step 2. The character is inserted into the text at the cursor position. Any
unbound key always inserts text unless you have specified VIEW mode
for that buffer.
In OVER mode, the character replaces any character under the cursor.
In all other modes, with the exception of VIEW, the character is inserted
before the character under the cursor.
New Lines
The newline command has exactly the same effect as entering a
carriage return.
The open-line command (^o) inserts a newline character to create a
blank line directly after the cursor.
The newline-and-indent command (^j or <linefeed>) inserts a
newline character, then inserts the same number of tabs or spaces as
the previous line. This indents the character under the cursor on a new
line. This could be useful when splitting lines or indenting text.
Insert a Tab
The handle-tab command (^i) inserts a tab before the cursor
position. If you specify a numeric argument (<esc> <num> ^i), the
tab character is redefined to the specified number of spaces.
Insert a File
The insert-file command (^x ^i) prompts for a file name. If the
file is found in your directory, it is loaded into the buffer at the cursor
position.
This section discusses deleting text, placing it in the kill buffer, and
inserting text from the kill buffer to another location.
There are six commands you can use to search for and replace strings.
Each of these commands requires a search string. Once set, this string
is used by any search or replace command, until you replace it with
another search string.
More In
fo More
Informatio
n More Inf
ormation M
ore Inform
ation More
For More Information
-6-
See the uMACS Editing Modes section for information about changing
modes.
Replace
The replace-string command (^r) prompts for the search string
and a replacement string. The prompt is given in the same format as the
search commands: the current search string is displayed. You have the
option of accepting the current string (press the <esc> key) or changing
the string (type the new string):
Replace [delete]<esc>:
After you press <esc> or type the new string, you are prompted for the
replacement string:
With [kill]<esc>:
The replacement string is also saved between execution of replace
commands. The example above used kill as the current replacement
string.
All matching strings that occur after the cursor are replaced by the
replacement string. The cursor is positioned one character after the last
occurrence of a matching string. The number of substitutions made is
displayed after the final substitution. If substitutions are not made,
0 substitutions is displayed and the cursor is not moved.
Response Description
y Yes.
n No.
Region Commands
A region is the text between the cursor and a previously specified point
in the buffer. Regions are used in µMACS to cut, paste, delete, or format
sections of text.
Paste
To paste the kill buffer contents elsewhere in the file, use the yank
command (^y).
When pasting the kill buffer into a file, place the cursor at the end of the
pasted section. Often, when editing a program or text file, you need to
move some code or a section of text to another area of the file and then
return to the original point to continue editing. Use the
exchange-point-and-mark command to do this.
Note
We recommend that you update your mark after executing this
command to avoid creating a large region and accidentally editing it.
! WARNING
fill-paragraph (<esc> o) has one or two drawbacks. For example,
two spaces are inserted after initials in names. If a real number is
indicated in the text by a number followed by a period with no decimal,
two spaces are also inserted.
Transpose Characters
You can use µMACS to transpose characters. The
transpose-characters command (^t) transposes the character
under the cursor with the character before the cursor. This is an easy
way to handle some typographical errors.
Buffer Commands
The following are commands you can use to change buffer and file
names.
Edit a Buffer
Once you are aware of the buffers currently available (see the
list-buffer Display Current Buffers command), you can use the
select-buffer command (^x b) to edit a buffer.
select-buffer prompts for the name of the buffer you wish to edit. If
you name an existing buffer that has not yet been edited, µMACS:
• Reads the file.
• Displays the number of lines in the file.
• Places the cursor at the beginning of the file.
Buffer List
Switch Buffers
Use the next-buffer (^x x) command to switch between buffers.
This places you in the next buffer in the buffer list (see the
list-buffer command). When you are editing the last buffer in the
list, the next-buffer command wraps around and places you in the
first buffer.
Buffer Position
The buffer-position command (^x =) displays a status line with
information concerning your current position in the buffer. The following
is an example status line:
Total number of
characters in file.
Percentage of all
characters in the file.
Number of characters up to
and including the cursor.
Hexadecimal value for the
character under the cursor.
The current line number.
X and Y are the current screen coordinates.
Delete Buffer
Use the delete-buffer command (^x k) to delete a specified
buffer. delete-buffer prompts for the name of the buffer to delete.
You cannot delete the currently displayed buffer.
When you delete a buffer, it is removed only from your µMACS
workspace. This does not affect any file in your directory.
Window Commands
Scroll Text
Use the cursor commands to scroll the text of the current window. There
are two additional commands to scroll the window one line at a time:
• move-window-down (^x ^n).
• move-window-up (^x ^p).
These commands affect the current window. To scroll the text of the
other displayed window, use:
• scroll-next-up (<esc> ^v).
• scroll-next-down (<esc> ^z).
These commands scroll the next window one page forward or
backward, respectively.
termcap is a text file containing control code definitions for one or more
types of terminals. Each entry is a complete description list for a
particular kind of terminal.
Note
Each part of a termcap entry is separated by a vertical bar (|) and is
another way of naming the terminal.
Terminal Capabilities
Each item begins with a terminal capability. Each capability is a two
character abbreviation. Each capability is either a boolean itself or it is
followed by a string or a number. If a boolean capability is present in the
termcap entry, then the capability exists on that terminal.
All numeric capabilities are followed by a pound sign (#) and a number.
For example, the number of columns capability for an 80 column
terminal could be described as follows:
co#80:
All string capabilities are followed by an equal sign (=) and a character
string. You can enter a time delay in milliseconds directly after the equal
sign (=) if padding is allowed in that capability. The padding characters
are supplied by the editor after the remainder of the string is transmitted
to provide the time delay. The time delay may be either an integer or an
integer followed by an asterisk (*). The asterisk (*) specifies that the
padding is proportional to the number of lines affected.
Note
When you use an asterisk (*), it may be useful to specify the time delay
in tenths of milliseconds. For example, use the following entry to specify
the clear screen capability as ^z with a time delay of 3.5 milliseconds:
cl=3.5*^z:
Special Characters
Use \E to indicate an escape sequence.
A control character is indicated by a circumflex (^) preceding the
character.
The following special character constants are also supported:
\b backspace \f formfeed
\n newline \r return
\t tab \\ backslash
\^ circumflex
You can also specify characters as three Octal digits after a backslash
(\). For example:
• If you must use a colon in a capability definition, it must be specified
by \072.
• If you need to place a null character in a capability definition, use
\200.
C routines using termcap strip the high bits of the output, therefore
\200 is interpreted as \000.
Cursor Addressing
Of the above capabilities, the most complex and important capability is
cm (cursor addressing). The string specifying the cursor addressing is
formatted similar to the C printf() command. It uses % notation to
identify addressing encodings of the current line or column position.
The line and the column to address could be considered the arguments
to the cm string. All other characters are passed through unchanged.
Notation Description
%2 Same as %2d.
%3 Same as %3d.
%% Give a single %.
Example Notations
The following examples illustrate the use of the above notations:
cm=6\E&%r%2c%2Y:
This terminal (HP2645) needs:
• A six millisecond delay.
baud rate
The speed (in bits per second) of a data link. Divide baud rate by ten to
determine characters per second (i.e., 300 baud = 30 c.p.s).
data link
A communications connection between two computers or between a
computer and a terminal.
downloading
Transmission of data from a remote computer to a file on the host
computer.
full duplex
A transmission mode where data is echoed back over the data link.
half duplex
A transmission mode where data is not echoed back over the data link.
hardwired
A direct wired connection between two devices.
663
Glossary
modem
A device that converts digital data to audio tones for transmission over
telephone lines.
null modem
A connector device that reverses the transmit and receive wires for
hard-wired connection of two computer ports.
uploading
Transmission of data from a file on the host computer to a remote
computer.
XOFF
A control character (decimal value = 19) which is used to tell a remote
system to stop transmitting.
XON
A control character (decimal value = 17) which is used to tell a remote
system to resume transmitting.
Index
Symbols
$* macro 483
$? macro 483
$@ macro 483
%ret 556
%s 559
.c or .h buffer names 613
.login 525
.login file 278, 582
.logout file 201, 278, 582, 583, 585
.shellrc 521, 525
.umacsrc file 601
<esc> 595
<esc> escape key 496
[No such function] error 595
^B cursor back 489
^D delete character 490
^F cursor forward 489
^I toggle insert mode 490
^K kill to end of line 490
^N next line 489
^P previous line 489
^Z end of line 490
_BATCHDEV 504
_EDKEYS 491
_sh environment variable 290, 343, 576, 577, 582
_SHELLPARAMS 524
A
-a option 519
abort 599, 654
abort process 186
B
-b option 519
backslash 511
start batchfile 504
backup 23
directory restoration 150
incremental 152
procedure
multiple drive 25
single drive 24
backup file 611
backup utility 23
backward-character 654
begining-of-file 621, 654
begining-of-line 621, 654
begin-macro 654
beginning of a paragraph
defined 620
bfed commands
see table 2 27
bfed utility 26
binary files
compare 52
convert to S-record 32
bind key 592
bind-key 601
bind-to-key 597, 654
binex utility 32
bitmap
repair 78
bootgen utility 35
bootstrap file
build and link 241
bracket 613
break utility 40
breakpoints 367, 369, 370, 371, 412, 413, 416
buffer 604, 623
commands 618, 638
buffer-position 621, 642, 654
build and link a bootstrap file 35
build text file from standard input 42
build utility 42
built-in command 514, 532
assign 501
dirs 515
hist 492
noassign 502
popd 516
prenv 517
pushd 515
pushd dir 516
pushd -h 516
pushd -num 516
pushd -x 516
set 517
unassign 502
which 518
built-in functions
list of 560
C
-c option 520
cache
enable, disable 98
capability 649
capitalize word 593
capture output 503
case matching 612
case-region-lower 654
case-region-upper 654
case-word-capitalize 636, 655
case-word-lower 636, 655
case-word-upper 636, 655
CC macro 483
CFLAGS macro 482
cfp utility 43
change
buffer and file names 640
character case 634, 635
current data directory 49
current execution directory 49
current module directory 49
file name 282
file security attributes 19
module directory permissions 212
ownership of file/directory 51
change command line option 514
change-file-name 610, 655
character
print hex value of 54
transliterate 328
characters
count of 73
chd utility 49
chm utility 49
chown utility 51
chx utility 49
clear-and-redraw 655
clock
activate/set 291
close the help window 599
clusters
defined 146
cm 651
CMODE mode 613
cmp utility 52
code utility 54
com utility 55
command
file processor 43
history 165
interpreter 297, 569
command completion 496
Command Line
single word substitution 18
command line batchfile 504
command line editing keys
display current 517
command line interface
options 489
command line option
change 514
command line options 514
command monitoring 512
command output substitution 508
command separators
! Standard output 503
!! Standard error 503
!!! Both standard output and standard error 503
communicate with remote system 55
compare binary files 52
compress ASCII files 67
compress utility 67
conditional branch
elsewhile 547
endswitch 546
list of directives 539
constants
types 536
control
character 595, 608
control characters from path descriptor 491
control code
definitions 648
specifications 648
control keys 489
conversion to integer 538
convert
binary files to S-record 32
S-record to binary 127
text
dosfile utility 101
copy
backup of disk 23
data file to RBF device 308
data from file 69
files to standard output 219
generate procedure to 104
standard input to multiple output 311
copy text 605
copy utility 69
copy-region 633, 655
count characters, words, lines 73
count utility 73
CRC
repair 137
create
bootable tape 307
directory file 203
directory link 193
new module directory 209
create a batchfile 504
current line number 621
cursor
addressing 651
D
-d option 512, 520
date
display 75
update last modification date on file 326
date utility 75
dcheck utility 76
de-activate an active process 301
debug
breakpoints 367, 369, 370, 371, 412, 413, 416
commands
d (display memory) 375
debug options 406
execution 369
fork 401
link 392
memory change 374
memory search 392
mf (memory fill) 387
ms (memory search) 389
o (options) 404
summary 412
symbol table 396
v(evaluate expression) 410
expressions
operands 407
operators 408
invoke debug 403
memory fill command 387
symbolic debugging 364, 394
debug mode 520
debug utility 80
debug, test 68000 machine language programs 80
debugging
facilities 512
log 523
defined 532
directive 532
directives
classes of 539
conditional branch 539
miscellaneous 539
procedure file function 539
unconditional branch 539
variables 539
directories
change current data 49
change current execution 49
change current module 49
change ownership of a file 51
directory
backup restoration 150
delete 85, 87
display file names 94
Home 574
incremental backup 152
move to another directory 236
print working directory 260
unformatted listing 95
directory file
create 203
directory link
create 193
dirs 515
disable MShell option 519
discard single word commands 336
disk
file structure 76
initialize media 141
make backup 23
disk editor
screen-oriented 26
diskcache utility 98
display
files in directory 94
free space on device 146
processes 273
status of cache 98
system date, time 75
system events 122
system’s device table 89
display current options 517
display environment variables 517
display process paths 251
display version strings 345
DOS
convert text 101
dosfile utility 101
download of files 62
DPIO
split/rejoin descriptors 102
dpsplit utility 102
dsave utility 104
dump utility 110
duplicate andexecute a command from history 492
E
e modifier 509
-e option 606
echo text to output path 112
echo utility 112
edit file 606
EDIT mode 610, 612
edit OS-9 modules 225
editor
editmod 114
editors
screen-oriented disk 26
umacs screen 335
edt utility 119
enable MShell option 519
end of a paragraph
defined 620
end-macro 656
end-of-file 621, 656
end-of-line 621, 656
endswitch 546
endwhile 547
enlarge window 646
enter text into buffer 623
environment variable 505
_BATCHDEV 504
_EDKEYS 491
_SHELLPARAMS 524, 525
PWD 516
substitution 506
environment variables
_sh 576
delete 343
HOME 200, 201, 574
PATH 195, 200, 575
PORT 574
print 272
PROMPT 575
set 290
SHELL 200
TERM 576
USER 200, 575
erase all files in a directory 85
erase existing module directories 87
erase files 84
errors for background processes 531
escape
sequence 650
escape characters 527, 530
escape in quoted string constants 536
events utility 122
ex utility 125
EXACT mode 612, 630
examine file security attributes 19
examine MShell options 517
exbin utility 127
exchange-point-and- mark 656
exchange-point-and-mark 633
execute
command 595
macro 600
operating system commands 611
F
-f option 520
F$DExec system calls 80, 363
F$DFork system call 80, 363
F$STrap system calls 370, 371
F$TLink system calls 370
file
.login 581
.logout 581
check disk file structure 76
copy
data file to RBF device 308
copy data from one to another 69
copy to standard output 219
count characters, words, lines 73
move to another directory 236
update, maintain, regenerate 207, 467
file name completion 499
files
.login 278
.logout 278
archive multiple files 309
build and link bootstrap file 241
change name 282
compare binary 52
compress 67
convert to S-record 32
copy
via procedure file 104
create bootable tape 307
create files
build utility 42
create, edit files
edt utility 119
delete 84
delete all in directory 85
expand compressed file 129
formatted dump in hexadecimal and ASCII 110
password 198
print 270
procedure file
.login 278
.logout 278
procedure files
.login 581
.logout 581
password 198
put on tape 306
read commands from 278
relocatable 478
retrieve deleted OS-9 files 337
retrieve deleted OS-9000 files 339
split into two or four files 284
S-record
convert to binary 127
S-record files
convert binary to S-record 32
update last modification date 326
fill-paragraph 636, 637, 656
find a module or file 518
find current key bindings 598
find-file 610, 657
fixmod utility 137
force a break
wbreak 542
fork new shell 300
format commands 593, 617
format escapes
%s 559
format utility 141
forward-character 657
free utility 146
frestore utility 150
fsave utility 152
function 535
functions 560
G
global buffer 605
global variable
%ret 556
global variable assignment 565
go-to-line 621
goto-line 657
Group and User ID
getuid() 566
grow-window 646, 657
H
h modifier 509
-h option 521
handle-tab 624, 657
help 598, 657
help utility 164
hex
formatted file dump 110
hex values 54
hist 492
hist utility 165
history buffer 492
-c 520
option 520
set size 520
history compression 521
-h option 494
I
-i option 521, 522, 525
I/O functions
list of 560
ident utility 167
identifier constants 537
IDIR macro 482
initialization file
invoke 525
initialization script
invoke 521
initialize disk media 141
iniz utility 170
in-memory quick sort 280
input character
print hex value of 54
insert 617
control character 623
kill buffer 626
tabs or spaces 624
text 622
insert mode 490
insert-file 609, 624, 657
insert-space 657
integer constants 537
interpreted procedure files 508
IRQ polling table
display 172
irqs utility 172
i-shell 611, 657
K
kermit utility 179
key
bindings 596
sequence 592
kill buffer 626
kill process 186
kill utility 186
kill-paragraph 626, 627, 657
kill-region 627, 633, 657
kill-to-end-of-line 626, 657
L
l68 364, 394
language interpreter 505
LC macro 483
LFLAGS macro 482
line 621
length 608
wrap 612
line concatenation 511
line-oriented text editor 119
lines
count of 73
link and build a bootstrap file 35
link utility 188
link, initialize OS9P2 module 247
list command names and key bindings 598
list contents of text file 189
list utility 189
list-buffer 639, 645, 658
lmm utility 191
ln utility 193
load file into buffer 608
load modules at pathlist 191
load utility 194
logical constants 537
login
shell 582
M
-m option 521
machine language programs
test and debug 80, 363
macro 592, 599
$* 483
$? 483
$@ 483
CC 483
CFLAGS 482
IDIR 482
LC 483
LFLAGS 482
ODIR 482
RC 483
RDIR 482
RFLAGS 482
SDIR 482
macro recognition 481
makdir utility 203
make
command entry 469
comment entry 469
dependency entry 468
ROM for BSP 248
make backup copy of disk 23
make utility 207, 467
makefile
defined 207, 468
makmdir utility 209
maps utility 211
margins 593
mark a region 627
mdattr utility 212
mdir utility 215
memory
list of 519
-m insert mode 521
-o time-out 522
-q alias passing 522
-r history passing 522
-s history saving 523
-u debugging log 523
mv utility 236
N
name-buffer 658
newline 624, 658
newline-and-indent 624, 658
next-buffer 641, 658
next-line 620, 658
next-page 621, 658
next-paragraph 621, 658
next-window 645, 658
next-word 620, 658
No pattern set message 630
noassign 502
non-blocking readln 531
Not bound message 598
Not found message 630
-np option 504
numeric capability 649
O
-o option 522
object file 477
ODIR macro 482
on-line utility reference 164
open
another window 645
new buffer 641
open-line 624, 658
operands 534
operators 534
OS-9
convert text 101
OS-9 for 68000 operating system
test and debug 80, 363
os9cmp utility 52
os9gen utility 241
oso9dump utilitiy
formatted file dump in hex or ASCII 110
OVER mode 612, 623
overwrite mode 521
P
P* 506
p2init utility 247
padrom utility 248
page 621
parameter passing 505, 507
park hard drive heads 250
park utility 250
partial command 596
Partition OS-9/68k hard disks 253
pass control to caller 556
password file 198
paste 593
path descriptor control characters 491
PATH environment variable 195, 200, 575
pathlist alias 16
paths
copy standard input to multiple output 311
paths utility 251
pd utility 260
pipe
standard output/standard error 503
PN 506
popd 516
popd -num
built-in command
popd -num 516
PORT environment variable 574
pound sign (#) 613
pr utility 270
prenv 517
previous-buffer 598
previous-line 620, 658
previous-page 621, 659
previous-paragraph 621, 659
previous-window 645, 659
previous-word 620, 659
print environment variables 272
print files 270
print hex value 54
print process memory information 211
print system identification 303
print value of input character 54
print working directory 260
printenv utility 272
procedure file 594
.login 278, 581
.logout 278, 581
execute 539
generate to copy files 104
interpreter 532
password 198
procedure file function
list of directives 539
procedure files 505
process
abort 186
activate 14
de-activate 301
display list of running processes 273
kill 186
set CPU priority 294
suspend 298
wait for termination 346
process memory
print usage infomation 211
procs utility 273
profile
defined 514
profile batchfiles option 519
Q
q modifier 510
-q option 522
qsort utility 280
query-replace-string 631, 659
quick sort 280
quick-exit 616, 659
quotation marks 643
quote-character 623, 659
quoted string constants 536
R
r modifier 509
-r option 493, 522
RAM
display free system RAM 221
RC macro 483
RDIR macro 482
read buffer into window 645
read commands from file 278
read-file 609, 645, 659
readln 520, 531
redraw-display 659
referencing variables 534
reformat
margins 636
paragraph 593
region 617
commands 632
defined 627, 632
relocatable files 478
remote system
communication with 55
remove all files from directory 85
remove device from system device table 81
remove existing module directories 87
remove files 84
rename file 610
rename utility 282
repeat commands 599
replace 617
kill buffer contents 626
string 593
replace-string 630, 659
required capabilities 651
reset system 40
restart a construct
continue 542
retrieve deleted OS-9 files 337
retrieve deleted OS-9000 files 339
return integer ASCII value
asc() 561
RFLAGS macro 482
ROM
make for BSP 248
romsplit utility 284
RS-232 serial port communications 55
S
-s option 493, 523
save memory module to file 286
save utility 286
shell variables
% 507
%() 507
shell, continued 297
shell-command 611, 660
shrink-window 646, 660
single word command line substitutions 18
sleep utility 298
special character constants 650
split file 284
split-current-window 645, 660
S-record files
convert to binary 32, 127
start batchfile execution 504
start batchfile process 504
start uMACS 606
status
display cache 98
status line
buffer position 642
window 604
string capability 649
string functions
list of 560
su utility 300
substitutions
single word command line 18
supervise idle terminals 332
suspend process 298
suspend utility 301
switch construct
example 546
switching windows 605
symbolic debugging 364, 394
syntax
directive 540
sysid utility 303
system
clock
activate/set 291
display date and time 75
T
t modifier 510
-t option 513
tab 593, 613, 624
tape
archive 309
controller 305
put files on 306
tape utility 305
tapegen utility 307
tapestart utility 308
tar utility 309
tee utility 311
temporary batchfiles 504
TERM environment variable 576, 648
termcap
file 592
file location 647
terminal
supervise idle terminals 332
terminates batchfile creation 504
test, debug 68000 machine language programs 80
text
convert DOS files to OS-9 101
echo to output path 112
text file
list contents 189
text formatting 635
time
display 75
timesharing system
login 197
logout 201
tmode
parameter names 315
tmode utility 491
touch utility 326
tr utility 328
transfer of control
goto 541
transfer sequential files 179
transliterate characters 328
transparent transmissions 56
transpose-characters 637, 660
tsmon utility 332
two stroke commands 597
U
-u option 513, 523
umacs 606
umacs utility 335, 591
unassign 502
unassign utility 336
unbind-key 597, 660
unconditional branch
list of directives 539
undel utility 337, 339
unlink memory module 341
unlink utility 341
unsetenv utility 343
upload of files 62
upper case 636
USER environment variable 200, 575
user input 601
V
-v option 606
variable
global 534
local 534
variable substitution 507
variables
list of directives 539
view history buffer
hist 492
VIEW mode 606, 610, 612, 623
view-file 610, 660
W
w utility 346
wait for process(es) to terminate 346
wait utility 346
what utility 345
which 518
wildcard 508
wildcards
command line 571
window 618
and buffer handling 604
commands 644
status line 604
word
defined 620
words
count of 73
wrap line 612
WRAP mode 612, 636
write-file 611, 616, 661
X
xmode
parameter names 352
Y
yank 626, 627, 633, 661
693