User guide

exer
You can use a random number generator to seek to varying device locations
before performing either a read or write operation. Randomization is achieved by
calling the function
random
, which uses a linear congruential generator (LCG) to
generate the numbers. This algorithm is not truly random, but it comes closest
to meeting the needs of the exer command. Each time that
random
is called, it
returns a number from a specified range. If the range of numbers is a power
of two, then each subsequent call to
random
is guaranteed to return a different
number from the range until all possible numbers within the range have been
chosen. If the range of numbers is not a power of two, then
random
is used with
an upper bound that is greater than the actual range size but is a power of two.
Then a modulus operation with the range size is performed on the number that
random
returns, thereby ensuring that a random number is generated within the
random range size.
The total number of bytes read or written on each pass of the exerciser is specified
by the length in blocks or the starting/ending block address option arguments.
If neither the ending address nor the length options are specified, then on each
pass the number of bytes processed could vary depending on whether or not the
file stream is being written to or just being read.
If the exer command does not write to the file stream, the command reads until
it reaches the EOF.
If the exer command is writing to the file (as specified in the action string), then
the number of bytes processed per pass is equal to the allocation size of the file,
which is usually larger than the length of the file for RAM disk files, but equal to
the length for disk devices.
Note
Disk device I/O fails if the block size is not equal to 1 or a multiple of
512. Partial block read or write operations are not supported; therefore, a
length that is not a multiple of the block size results in no errors, but the
last partial block I/O of data does not occur.
Any combination of writing, reading, or comparing buffer1 and buffer2 can be
executed in the sequence as specified in the action string. Depending on the
option arguments, one or two of these three operations (read/write/compare) can
be omitted without affecting the execution of the other operations.
13–44 Console Commands