sash(8) (RM400 only) sash(8)
NAME
sash - stand-alone shell used to bootstrap Reliant UNIX on an RM400
SYNOPSIS
The SASH is invoked from the RM400 firmware, manually or automati-
cally.
DESCRIPTION
The Stand Alone Shell (SASH) is used to boot the Reliant UNIX operat-
ing system. The SASH is loaded into main memory by the RM400 firmware
from a specified hard disk, CD-ROM, disk, or tape. Commands are then
processed by the SASH to load the operating system. Control is passed
to the operating system when the load operation is completed.
SCSI I/O (IOS) disk, CD-ROM and tape drives can be used as boot
devices. Alternatively LAN can be used to boot the SASH. Any disk
drive containing a ufs file system can then be used by the SASH to
boot any kernel executable file on that device. A previous mount of
that device is not necessary.
Tape devices are generally used to install the operating system
software. It is possible however, to boot only a kernel from a CD-ROM
or tape device. This is useful for system recovery if the boot disk
has been corrupted, preventing the SASH from reading the disk.
After loading the kernel image, an argument vector is created in
memory in the first page (4k) in front of the kernel text. This is
where options such as the Reliant UNIX root device, root file system
type, etc. are passed to the operating system. Once this vector has
been created, the SASH launches the kernel by branching to its entry
point. Eventually, the SASH is cleared from memory by the operating
system.
At startup, the SASH tries to find a special file, called STARTUP, at
various locations for diagnostic purposes. When the file is found,
normal startup is canceled and a special part of the SASH, the test-
and-diagnostics shell (TDSH/TDFSH) is activated. Normally this is done
only when a system technician runs diagnostic tests. The file must
reside in a special file system and is looked after at floppy and
hard-disk (swap-partition). If the file is not found, normal startup
continues until the SASH command parser is entered or the Reliant UNIX
operating system is successfully loaded.
The SASH command parser issues a sash: prompt while the RM400 firmware
issues a >> prompt. The commands of the SASH are listed below, giving
their syntax and an explanation of all of the optional and required
arguments.
At almost any time, pressing ^D or ^C will cause the SASH to fall back
into the RM400 firmware. It can then be reloaded again from that
point.
Page 1 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
SASH Commands
The following list describes the commands and options provided by the
SASH, as identified by the sash: prompt. The commands are listed in
alphabetical order. The named environment variables are described in
nvram(7).
Any number or address in the list below may have one of the following
formats:
______________________________________________________________________
| Format | Description |
|__________________|__________________________________________________|
| decbase | decbase is a number consisting of decimal |
| | digits (0..9) |
| 0xhexbase | hexbase is a number consisting of hexade- |
| | cimal digits (0..9a..f) |
| 0octbase | octbase is a number consisting of octal |
| | digits (0..7) |
|__________________|__________________________________________________|
Example:
The numbers 0xff, 0377 and 255 resemble the same number.
Any range mentioned in the list below specifies a memory range and may
have one of the following formats:
______________________________________________________________________
| Range | Description |
|__________________|__________________________________________________|
| base | Specifies the contents of the memory address |
| | base. |
| base#count | Specifies the contents of the memory start- |
| | ing at base and ending at base + count. |
| base:limit | Specifies the contents of the memory |
| | addresses starting at base and ending at |
| | limit. |
|__________________|__________________________________________________|
Example:
The ranges 0xa0400000#36 and 0xa0400000:0xa0400020 represent the same
memory range beginning at 0xa0400000 (hex) and ending at 0xa0400020
(hex) inclusively.
Any length mentioned in the list below specifies a length and may have
one of the following characters:
Page 2 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
____________________________________________________________
| Character | Length |
|_____________|_____________________________________________|
| -b | Byte (8 bits) |
| -h | Halfword (16 bits) |
| -w | Word (32 bits) (default) |
|_____________|_____________________________________________|
______________________________________________________________________
⊕ auto
Performs autoboot, i.e. loads the file specified in the environ-
ment variable bootfile. The device from which this bootfile is
loaded must already be part of bootfile.
Example:
If the environment variable bootfile contains dkncr(0,0,10)sash,
the SASH will be loaded from hard disk #0, partition #10.
______________________________________________________________________
⊕ boot [-n] [-f file] [args]
Loads and executes a file from a specified device.
-n For SNI internal development use only. The executable
is loaded but not launched. After the SASH has loaded
the executable, it returns to the command parser. A
subsequent boot command must be used to load and/or
launch another executable. This command is useful when
an executable is loaded in addition to a debug monitor.
An executable loaded with this option may be launched
later with the go command.
-f file Specifies the file name to be booted. If no file name
is given, the boot command uses the content of the
environment variable bootfile. The file name itself may
contain the name of the device where the file resides.
If no device is given, the environment variable path is
prepended to the file name.
Page 3 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
The file name may have one of the following formats:
___________________________________________________________________________
|Device | Format |
|_______|_________________________________________________________________|
|Tape | tpncr([hostadapterno.],[SCSIID],fileno.) |
| | or |
| | tpncr([hostadapterno.],[SCSIID],)filename |
|_______|_________________________________________________________________|
|Disk | dkncr([hostadapterno.],[SCSIID],[partitionno.])filename |
|_______|_________________________________________________________________|
If one of the optional arguments is not given, its
value is set to 0.
args Arguments which are passed to the booted image when
immediately launched. Arguments which begin with "-"
must be prepended with another "-" to tell the SASH
command parser that it is not a boot option; this extra
dash is removed before the argument is passed to the
program.
Example:
The following example loads the file unix from partition#0 of
disk#0 which is connected to host_adapter#0 and executes the file
with run level S:
sash: boot -f dkncr(,,)unix initarg=-s
______________________________________________________________________
⊕ cat [file1 file2 ... fileN]
Displays the contents of the listed file(s).
If a given file name does not contain a device specification, the
environment variable path is prepended to the file.
______________________________________________________________________
⊕ cp [-b blocksize] [-c count] file1 file2
Copies the contents of file1 to file2.
file1 is the file to be copied, and file2 is the file to which it
is to be copied file1. file1 and file2 may be raw devices.
Page 4 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
While this command is being executed, a period (.) is printed on
the screen for each record that is transferred.
-b blocksize
blocksize gives the amount of bytes which are copied at
each read/write access from file1 to file2. blocksize
may be followed by one of the following characters,
meaning:
_________________________________________________________
| Character| Description |
|__________|_____________________________________________|
| b, B | blocksize is multiplied with 512 |
| k, K | blocksize is multiplied with 1024 (1 KByte)|
|__________|_____________________________________________|
NOTE: There must be no spaces between blocksize and the
following multiplying character!
If -b is not specified, then the blocksize defaults to
512 bytes.
For raw devices the blocksize should be an integral
multiple of the device's physical record length.
-c count Specifies the maximum byte count to be transferred. If
-c is not specified, the copy terminates at EOF of
file1.
Example:
To copy file3 (the fourth file, zero is the first file) on the
streamer tape to partition 1 of the disk, type:
sash: cp -b 16k tpncr(,6,3) dkncr(,,1)
______________________________________________________________________
⊕ disable [consoledev]
Does not allow input from and output to the specified console
device. If you use disable without arguments, then the current
set of enabled console devices is displayed.
Example:
disable tty(1) disables the serial remote port tty(1).
Page 5 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
______________________________________________________________________
⊕ dump [length] [format] [range]
Formats and displays the contents of memory.
length is a character that specifies the length of the loca-
tion to dump.
format is a character that specifies how to display the con-
tents of memory as follows:
___________________________________
| Character| Format |
|__________|_______________________|
| -B | binary |
| -c | ASCII character |
| -d | decimal |
| -o | octal |
| -u | unsigned decimal |
| -x | hexadecimal (default)|
|__________|_______________________|
range is a valid address in memory with optional decimal del-
imiters.
Example:
The following example shows a base#count range specified in half-
words. The default for the format of hexadecimal is used because
no argument was specified.
sash: dump -h 0xbfc04000#5
0xbfc04000: 8dce 514 6 6900 1a3
______________________________________________________________________
⊕ enable [consoledev]
Allows input from and output to the specified console device from
the SASH command parser.
If you use enable without arguments, then the current set of
enabled console devices is displayed.
Example:
enable tty(1) enables the serial remote port tty(1).
Page 6 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
______________________________________________________________________
⊕ end
Ends the command parser of the SASH and falls back to the caller
of the SASH.
The return value is the last return value from a program booted
and executed by the SASH.
______________________________________________________________________
⊕ fill [length] [-v val] [range]
Fills the contents of a specified range of addresses with val.
length is a character that specifies the length of the loca-
tion to fill.
val is a number with which to fill memory.
range is a valid address in memory with optional decimal del-
imiters.
Example:
The following example fills the contents of memory with a word
with the value 0xff00ff00 starting at 0xafffffff for 10 32-bit
locations:
sash: fill -w -v 0xff00ff00 0xafffffff#10
______________________________________________________________________
⊕ g [length] [address]
Displays the contents of a single memory location in decimal,
hexadecimal, and ASCII character formats.
length is a character that specifies the length of the loca-
tion to dump.
address is either a single memory location or a register name.
Page 7 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
Example:
sash: g 0xa0013cfc
address value in decimal value in hex value in ASCII
0xa0013cfc: -192471552 0x8e200000 '\'
______________________________________________________________________
⊕ go [address] [-c args]
Launches an executable previously loaded into memory by the boot
command.
address Specifies the address at which to begin execution of a
previously loaded image. Useful for choosing the
desired address where several images are loaded. If
omitted, the image most recently loaded is launched.
-c args Used for passing arguments to the program. All argu-
ments following this options are passed to the program;
there must be no additional dash prepended to arguments
beginning with a dash.
______________________________________________________________________
⊕ help [commandlist]
⊕ ? [commandlist]
Displays the syntax for all the commands in commandlist.
commandlist
is one or more commands separated with a space.
If you do not specify a command list, then the help command
displays the syntax for all commands. You may enter a question
mark (?) instead of help.
______________________________________________________________________
⊕ inittod [secs]
Initializes the time-of-day chip.
secs is the number of seconds since 1972. If secs is omit-
ted, it defaults to zero.
It is very important that the time-of-day chip is running; other-
wise, the operating system will not work properly. This command
is normally executed at the factory.
Page 8 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
NOTE: This command works only in bootmode "d".
Example:
The following procedure gives the recommended method of initial-
izing the time-of-day chip.
1. Type the inittod command without any arguments.
2. Run the date(1) command after the operating system has been
booted.
______________________________________________________________________
⊕ load [chardevice]
For internal SNI use (system technicians) only.
The load command allows you to load memory over a serial line
connection from a system running the program tip.
______________________________________________________________________
⊕ p [length] [address] [value]
Puts a specified value into a single memory location.
length is a character that specifies the length of the loca-
tion to fill.
address is the address of a single memory location.
value is the value to which you want to set the address.
______________________________________________________________________
⊕ printenv [varlist]
Displays the value of the environment variables in varlist.
varlist is a specific environment variable or more variables
separated by a space. If no environment variables are
specified, printenv shows all currently defined envi-
ronment variables.
Page 9 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
Example:
The following example prints the value of the environment vari-
able netaddr.
sash: printenv netaddr
netaddr = 141.29.51.3
______________________________________________________________________
⊕ prtod
Prints the contents of the time-of-day register from the time-
of-day chip.
The displayed value is the number of seconds since 1972, printed
in hexadecimal.
You can determine whether the time-of-day chip is functioning by
running this command twice. If you run the command once and then
run it again 5 seconds later, the value displayed the second time
should be about 5 more than the first time. If the displayed
value does not change or if the value decreases, then run the
inittod command.
Example:
The following example shows the hexadecimal value for the number
of seconds since 1972.
sash: prtod
tod = 0x24bdda99
______________________________________________________________________
⊕ setenv [var] [value]
Creates a new environment variable or changes the value of an
existing environment variable.
var is the environment variable you want to set.
value is the value at which you want to set the variable.
Environment variables are represented as ASCII strings. The
current values of the environment variables are passed to pro-
grams booted by the SASH.
Page 10 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
Example:
The following example sets the environment variable rbaud to
9600.
sash: setenv rbaud 9600
______________________________________________________________________
⊕ sload [-a] [-b] [consoledev]
Accepts a subset of the Motorola S-record protocol. The record
types accepted are 0, 3 and 7.
-a Disables the sending of acknowledgements. If you do not
specify -a, sload replies with an ASCII ACK to each S-
record received that has a valid checksum. sload
replies with an ASCII NACK for records that have
incorrect checksums.
-b Directs sload to expect hybrid ASCII-binary records. If
you specify -b, sload expects hybrid ASCII-binary
records, which are produced by the sdownload program.
Using these hybrid ASCII-binary records roughly doubles
the throughput of serial transfers.
consoledev
The name of the console device.
Use the SPP command convert to produce S-record images.
Example:
The following example shows the command to download S-records via
tty(1).
sash: sload tty(1)
sload is now waiting for the S-records sent by sdownload over the
tty(1) port.
______________________________________________________________________
⊕ spin [[-i count1] [-c count2] [-v value] -(r|w) (b|h|w) address]
Performs load or store operations on the specified address using
the specified byte, halfword or word width.
-i count1 count1 is an iteration counter that executes each "sub-
group" as specified, then repeats it count1 times.
Page 11 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
-c count2 count2 is a numeric value that specifies the repetition
or copies that apply to all subsequent reads.
-v value value indicates a numeric value for writes that applies
to all subsequent writes.
address is the hexadecimal address you want to look at.
count defaults to 1 and value defaults to 0. A negative count is
interpreted as infinity.
You can specify a sequence of reads and/or writes of byte (b),
halfword (h) or word (w) width with combinations of -r and -w
options.
Example:
The example below writes the value 9200 to the location
0xa0300000 for 100 iterations, reads location 0xa0300004 100
times, and then repeats the entire operation 20 times.
sash: spin -i 20 -c 100 -v 9200 0xa0300000 -r 0xa0300004
______________________________________________________________________
⊕ tdsh
For internal SNI use (system technicians) only.
A special test-and-diagnostic shell is entered. This point
describes how to return to the sash prompt.
_____________________________________
| If you see| enter |
|___________|________________________|
| & | e followed by RETURN |
| % | !;e followed by RETURN|
|___________|________________________|
______________________________________________________________________
⊕ unsetenv [var]
Deletes an existing environment variable.
var is the specified environment variable.
Page 12 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
Example:
The following example unsets the rbaud variable.
sash: unsetenv rbaud
______________________________________________________________________
⊕ warm
Performs a warm boot of the system. Use this command to see a
core dump of memory before rebooting.
The SASH monitor looks for the restart block at location 0x400 in
physical memory. It considers the restart block valid under these
conditions:
- (offset 0) word 0 = 0xfeedface
- (offset 8) word 2 = 0
- (offset 12) word 3 = the 32-bit two's complement sum of the
first 32 words to which word 1 (offset 4) of the restart block
points.
The warm command uses the default values contained in the PROM's
restart block (shown below):
/*
* Restart block -- monitor support for "warm" starts
*
* prom will perform "warm start" if restartblk is properly set up:
* rbmagic == RESTARTMAGIC
* rboccurred == 0
* rbchecksum == 2's complement, 32-bit sum of first 32, 32-bit words
*/
define RESTARTMAGIC 0xfeedface
define RESTARTCSUMCNT 32 /* chksum 32 words of restart routine */
define RESTARTADDR 0xa0000400 /* prom looks for restart block here */
define RBBPADDR (RESTARTADDR+24) /* address of rbbpaddr */
ifdef LANGUAGEC
struct restartblk
{
int rbmagic; /* magic pattern */
int (*rbrestart)(); /* restart routine */
int rboccurred; /* to avoid loops on restart failure */
int rbchecksum; /* checksum of 1st 32 wrds of restrt */
char *rbfbss; /* start of prom bss and stack area */
char *rbebss; /* end of prom bss and stack area */
/*
Page 13 Reliant UNIX 5.44 Printed 11/98
sash(8) (RM400 only) sash(8)
* These entries are for communication between the debug monitor
* and the client process being debugged
* NOTE: a return value of -1 from (*rbvtop)() is distinguished
* to indicate that a translation could not be made.
*/
int (*rbbpaddr)(); /* breakpoint handler */
int (*rbvtop)(); /* virtual to physical conversion rtn */
/*
* config table goes here
*/
};
endif LANGUAGEC
SEE ALSO
nvram(7), prom(8).
Page 14 Reliant UNIX 5.44 Printed 11/98