AN INTERACTIVE DIGITAL IMAGE PROCESSING SYSTEM GEORGE FAWCETT JR. Submitted in Partial Fulfillment

advertisement
AN INTERACTIVE DIGITAL IMAGE
PROCESSING SYSTEM
by
GEORGE FAWCETT JR.
Submitted in Partial Fulfillment
for the
of the Requirements
Degree of Bachelor of Science
at the
MASSACHUSETTS INSTITUTE OF TECHNOLOGY
January,
1975
. ........
Signature of Author.Department of Electrical Engineering, January 25, 1975
Certified
.
by
.
.
.
.
.
.
.
.
.
Thesis Supervisor
Accepted
..
by .
.
.
.
.
.
.
.
Chairman, Departmental Committee on Theses
ARCHIVES
MAY 23 1975)
.r..~..~
AN_ INTERACTIVE
_
_ _
_
IMAGE
_-__ _ _ _ _PROCESSING
_ _ _ _ _ _ _ _ _ _ SYSTEM
_ _ _ _ _ _
DIGITAL
by
George Fawcett Jr.
ABSTRACT
An interactive system for processing digital images has
The images are recorded on magnetic tape
been developed.
photometer.
vidicon
silicon
two-disensional
with
a
Distortion corrections and calibrations are described. The
Princeton 801 graphics terminal is presented as the major
I/O device of the system. A command language and an
interpreter for the language are developed. The interactive
environment is implemented on an IBM 360/65 computer system
system.
the operating
modifications to
with several
Finally, an example of a terminal session showing the system
use is presented.
Thesis supervisor:
Thomas B. McCord
Associate Professor of Planetary Physics
2
ACKNOWLEDGEMENTS
my thesis supervisor, Tom McCord,
I would like to thank
orking for him for
for his support throughout this project.
the
years has
last three
computer when
who was
to modify it.
I an
Princeton terminal and helped
me throughout the entire
with
the
programming
experience
suggestions
for implementation
of
were invaluable. Finally, a word of
who made
working at
Paul Kinnucan
deeply indebted to
worked closely with
Petro
uch of
system
the operating
the LNS
his
and how
Grant Snellen was instrumental in the initial
installation of the
its bugs.
during this work.
started, contributed
e understand
experience.
programmer at
the systems
this work
time to helping
a pleasurable
people who have helped
There are several
Harvey Baumel,
been
the
batch
3
who has
project.
His
and
his
system
the interactive
system
thanks must go to Larry
project possible
ITPAL in 1971.
iron out
when
he started
me
TABLE OF CONTENTS
... 2
.....
0..............
ABSTRACT
ACKNOWLEDGEMENTS
...............
LIST OF FIGURES
.
.
606000
.
.......
006660
1. INTRODUCTION
..................
.
2.
BACKGROUND
....
...
0 ,.
0007
00
...................
.......
000...0
0060660
2.1 IMAGE PROCESSING................
.000.0
......
......
..-...
. .
9
0
9
060606
2.2 EXISTING SOFTWARE..............
.0000..
660060
3. PRINCETON 801 TERMINAL....... ......
.
.
.
00014
.......
0000060
3.1 HARDWARE
FEATURES..............
000000
6006060
.............
3.2 SOFTWARE SUPPORT ..
.
0 .
00.00.
000666
4. COMMAND LANGUAGE..................
0006060
0.0
4.1 COMMAND LANGUAGE PROCESSOR......
..
018
.0066.
.*...*
......
..18
......
a....
0000066
4.2 PROCESSOR ROUTINES...
.
0- .
0
.0
.. 19
......
0966000
4.2.1 CONTROL ROUTINES......
..
4.2.2 PARAMETER PROCESSORS..
000000
.*20
0....
6000000
0066000
.000.
6000000
...21
......
000000
4.2.3 COMMON FUNCTIONS......
6000060
.00.0..
5. AVAILABLE COMMANDS ..............
....
5.1 ACTIVE IMAGE FUNCTIONS......
000060
......
.....006666
00....
5.2 DISK MAINTENENCE ROUTINES ...
......
6000600
00000..
.......
5.3 OTHER COMMANDS ........... . ..
600660
660006
*.....
.0...00
5.4 JUSTIFICATION FOR THE ACTIVE IMAGE.
*......
*.
.*24
.6.28
... 28
06030
06.31
... 31
6606000
6. SYSTEM STRUCTURE.
................
0000000
.0..66.
.600....
......
.. 34
0066066
6. 1 IPROCS0
..................
6.2 IMPLEMENTATION OF BREAK.....
.00.000
6.3 CONTROL ROUTINE ..............
60006.00
4
..
35
... 38
2 1LC
6.4 OTHER ROUTINES..............
6.5 EXAMPLE..
...................
.....
..............
6006o0060
...
·
·
.........
40
41
·...
7. PERFORMANCE AND IMPROVEMENTS....
APPENDICES. .... ................
A. OPERATING SYSTEM MODIFICATIONS..
A.1
..............
0006000
50
... .000.0.. 51
UNIT CONTROL BLOCK..........
A.2 ATTENTION INTERRUPT HANDLER.
A.3 PL/1 MULTITASKING...........
B. DISPLAY CAPABILITIES............
5
*
..............
0066006000.6.55
59
LIST
1.
FLOWCHART OF DISTORTION
OF FIGURES
CALIBRATIONS
...................
11
2. RELATIONSHIPS BEWTEEN COMMAND PROCESSOR ROUTINES.......22
3. RELATIONSHIPS BETWEEN ACTIVE IMAGE, PERMANENT FILE,
........
AND ACTIVE IAGE COMMANDS... ...................
4. CONTROL STRUCTURE
.....................
......
6
29
37
CHAPTER
1
INTRODUCTION
A
two
dimensional
photometer(*)
Astronomy
telescope
has been
silicon
developed
Labratory ({ITPAL).
since
electron
through
beam
the back-biased diodes.
video signal which
tape in digital
The signal
intensity
the
diodes
biasing circuit.
the target
the
use at
for
direct
The vidicon tube, the
converted to
Photons are
recharges
Planetary
of an array of photosensitive
heart of the system, consists
that discharge
been in
primarily
photometric imaging through filters.
silicon diodes.
astronomical
the M.I.T
at
It has
1971,
August,
vidicon
charge carriers
After
exposure, an
a
creating
This
current
current is
is amplified and recorded
the
onto magnetic
form.
versus X-Y
form of
digital image in the
on tape is a
coordinates. The
image
must now
be
subjected to distortion corrections, calibrations, and other
reductions, and
then displayed
in a
video format.
These
corrections require an image processing system of some sort.
An image processing
system has been written that
runs as a
Westphal,
James A.
McCord
and
(*)
Thomas B.
"Two-Dimensional Silicon Vidicon Astronomical Photometer,"
APPLIED OPTICS,
Vol. 11,
arch 1972, pages 522-526.
Thomas B. McCord and Jeff Bosel, "Silicon Vidicon
symposium
of
the
MIT",
proceedings
at
Astronomy
"Astronomical Observations with Television-Type Sensors", U.
of B.C.,
Vancouver,
May 15-17, 1973.
7
batch job at
mode
of
the LNS computer facility.
operation is
processing
done.
not
suited
an
Therefore,
to
However
the batch
the
some of
interactive
image
system
was
developed.
This thesis
is the result
of
the work the
author has
put into developing the interactive
system. The system will
be described and its peculiarities
and shortcomings will be
like
presented.
This thesis,
structure.
Separate chapters
logically
existing
foundation
independent
batch
system
for much
will
of the
be
this
terminal will be described.
system.
work.
Next,
are
presented
in
major but
First,
it
as
presented
the
it
the
is
Princeton
The command language processor,
which must operate in real time, is described.
themselves
modular
are devoted to the
parts
of
system, is
the
next.
components are merged into the
The commands
Finally,
total system.
the
system
There are two
chapters in the appendix. The modifications to the LNS
system
Also,
to support
the display
features not
the
interactive
capabilities
discribed.
of the Princeton terminal and
yet implemented
that this thesis
system are
are presented.
will be helpful to those
and those whocontinue its developement.
8
It is
hoped
using the system
CHAPTER
2
BACKGROUND
This
chapter is
intended as
introduction to
an
the
image processing done at MITPAL and the work preceeding that
of
computer
facility at
computer with
360 through
system.
HASP
Sciences
for Nuclear
core storage. Attached
to the
was
2311
are four
mountable
disk drives
2314
(system
and a
two 1403 printers,
A Princeton
3)
the
360/65
2400 tape drives,
card read/punch.
run on
an IBM
dual density
(described in Chapter
systems
facility includes
two selector channels
resident), six
2540
Labratory
512K bytes of
drives, four
disk
the
The LS
at M.I.T.
(LNS)
image processing
The
the author.
801 graphics
added for
the
terminal
interactive
The operating system currently running is MFT using
input and
for spooling
output.
There
are two
user
partitions, presently defined at 158K bytes and 220K bytes.
2. 1
IMAGE PROCESSING
Images are recorded
of 12 bit integers.
4095.
integers and
format
32 bit
has to
format
the 360.
while
be
converted to
Two formats are
floating point
conserves space,
as a series
intensity ranges from 0 to
This allows
Initially, this
format suitable for
by the Vidicon system
the
numbers.
a
used, 16 bit
The
floating point
integer
format
preserves precision during operations.
The
images
are
stored
9
on
2311
disk
packs
during
processing.
Several disk packs are maintained allowing each
his own library of images.
user to keep and operate on
disk packs contain
a directory with pointers
rows, depending
one or two
data containg
and the
stored by rows, with each
images themselves. The images are
block of
to images and
each image,
segment on
a descriptor
free space,
The
on the
format. The standard image consists of 250 - 256 point rows,
Typically, a disk pack can
though this format is variable.
in floating point format, and
store 40 standard size images
The formats can be freely
twice as many in integer format.
intermixed
on a disk pack.
The first operation
in the image processing
The image is real from
the image from the tape to the disk.
the tape, assigned
user can supply
for
a name, and written onto
up to 256
the descriptor
the disk.
bytes of information
segment.
The
is moving
image is
The
on the image
now ready
for
subtraction of
the
corrections and calibrations.
The first
subtracted to
compensate for
circuit and for filament back
correction is
done.
uniformly illuminated
the response
of
frame.
A flat
dc bias
field is
an image taken
field to determine
field, the
After the dark field
flat field
in the
video
Next, a flat field
lighting.
of a
irregularities in
the target and transmission
across the field.
the flat
is the
This is an image taken with the shutter closed.
dark field.
It is
correction done
of the filters
is subtracted from
is divided
into the
data
At this point, the data is converted from integer to
10
floating point format.
Typically, several images are taken
through
different filters,
colors.
The images
features.
magnetic
producing
of the same object
images of
can then be ratioed to
different
bring out color
The images can then be formatted and written onto
tape
for
photographic hard
the
scan
converter
copy. Further
which
produces
processing depends
on the
particular data at hand.
I
J..
I
DATA
I
I
DARK
FRA
1
I
FIELD__
*
*
FLAT
I
__F______
*
*
*SUBTRACT*
*
*SUBTRACT*
*
*~
I
I
DARA
-
I
I*
FLAT
I
FIELD
-
I
I
_DARK FIELD
FIELD
__
$
* DIVIDE*
*
*
*
I
1
DATA____
FIGURE
FLOWCHART
I
CORRECTED
OF DISTORTIO
11
1
CALIBRATION S
I
2.2
EXISTING SOFTWARE
Kinnucan at
"black
box", usable
card
some areas.
One example
object,
therefore, will
relative
position
is
done
lacking is
image ratios.
The
times.
The
taken at different
not
on the
the
however, is
is computing
must be
images to be divided
performs
maintenence
batch system,
The
automaticallly.
and
input
Disk
functions.
indicated
appear
A
images.
control
It reads
by nonprogrammers.
punched
from
statements
is a
The system
at LNS.
a batch job
runs as
It
Paul
processing described
MITPAL which performs the
above.
written by
has been
processing system
An image
exactly in
the
of one
shift
partial
same
image relative to the other must be done in order to perform
the
Finding
ratio correctly.
consist
of
running
converter, and
batch system, one trial would
On the
takes several trials.
a
job, producing
producing a photograph
This is typically
a 1/2 day to
greatly increased.
a tape
for the
to see
1 day delay.
film
the results.
If the results
the user's efficiency would
could be seen immediately, then
be
often
correct overlay
the
This long
turn around
time is
the
primary motivation for the interactive system.
The interactive
extension
of the
similar to
system is logically and
batch system.
that of the
can be displayed
The data
batch system. In
on the graphics
of the two systems are identical
the same data under both systems.
12
terminal.
physically an
reduction
done is
addition, results
The data formats
to allow the processing of
The initial work done on
the batch
system was carried
over into the
includes the disk maintenence
the interactive system.
This
routines and
of the
the logic
development of
routines.
image processing
Several interesting new problems arise in the implementation
of the interactive
terminal,
graphics
between the
control of
These
be
controlled.
the system
The
Communication
is now done in
times, must
at all
been dealt
real time.
interactive
system
The remainder
of this
user full
be implemented.
successfully by
with
although continual modifications and
done.
I/O device, the
environment itself, allowing the
problems have
author.
must
user and the system
The interactive
A new
system, however.
is
presently
use,
improvements are being
thesis
describes the
parts of the interactive system and their operation.
13
in
the
major
CHAPTER 3
PRINCETON 801 TERMINAL
3.1
HARDWARE FEATURES
The Princeton
801 terminal(*)
is a
state
of
the art
gray scale terminal featuring a Lithicon storage tube.
is written directly onto the storage
being
refreshed.
A
separate set
maintains the cursor position.
is
generated directly
generates characters
vectors, and
onto
tube as the display is
of
hardware
registers
The cursor is not stored but
the
display.
Internal
in three sizes, absolute
gray scale.
Data
The
logic
and relative
selective erase
mode allows
erasing of any portion of the screen without affecting other
areas.
The
ASCII.
internal
In
text mode,
displayed.
modes
The
depends
characters
character
are
interpretation of
on
the
levels.
If
The
mode.
interpreted
In gray scale,
character,
the
all printable
offsets.
a
set of
In
as
Princeton
801
ASCII characters
the characters
the
vector
coordinate
is
are
in other
modes,
the
positions
or
characters correspond to intensity
character
it is interpreted
Princeton terminal
is
prefixed
with
the
as a mode switching
is connected
control
command.
to the
selector
channel via an IBM 2701 Data Adapter. The parallel interface
(*)
Princeton Electronics
Brunswick, New Jersey.
Products,
Inc.,
North
only by the rate the
allows data transmission rates limited
terminal
can
accept
the
This
data.
ranges
3000
from
bytes/second for gray scale
bytes/second for text to 50,000
data.
.2
SOFTWARE
SUPPORT
A set of basic level I/O routines had to be written for
IBM support for it.
the terminal because there is no
These
routines provide read and write capabilities, translation of
Control blocks for the
character codes, and error recovery.
I/O
are
Supervisor
The
constructed.
and
created
routines
channel
are written
programs
in
are
assembly
the
language but are callable by both FORTRAN and PL/1.
The write
data to the terminal.
data to
allows
No checking is done on the data.
called with two
routine is
the
use
parameters, the address
and the length.
be written
length block
a variable
routine writes
of
varying
length
The PL/1
of
The
of the
entry point
character
strings.
Actually, the Dope Vector for the character string is passed
The length of the string
as the argument.
one parameter need be passed.
the Dope Vector and thus only
The
is contained in
/O Supervisor is called to initiate the write operation
Control is then returned to
and its completion is awaited.
the calling program.
The
read
routine
terminal keyboard.
to the
reads
a line
The length of
calling program
and the
15
of
input
from
the
the line read is returned
data is
moved to
an area
specified by the calling program.
uses varying length
The PL/1 entry point also
character strings. The input
characters. The erase character
monitored for three special
the last character and
key erases
position. It sends
string is
backs up the
cursor one
to the computer.
a back space character
The back space is checked for and the read buffer pointer is
backed up one position to effectively erase the character in
The delete key
the buffer.
the control
the buffer is
When it is read,
the computer.
code for the line
erase
function
emptied
and
is sent to the
line on the terminal.
This erases the whole
terminal.
character to
sends the delete
The
carriage return is interpreted as the end of line delimiter.
When
it
is
is
the
routine
read
are read one at a time
characters
between.
read,
This
channel on
that will collect
and send a whole line at a
is completed,
Presently,
delay in
with a .1 second
because there
software multiplexing is used
no multiplexor
being built
exits.
the computer.
A buffer
is
the input from
the terminal
time to the computer.
When this
will simply read
the whole
the read routine
line before it checks for the special characters.
A third routine reads the
the terminal.
code
to the
The routine
terminal,
encoded cursor position
current cursor position from
sends the
causing the
read cursor
terminal
to the computer.
The
control
to send
the
routine then
converts the encoded position to X-Y coordinates and returns
them to the calling program.
The
translate routine
will translate
16
from EBCDIC
to
ASCII, and
ASCII
vice versa,
to EBCDIC
with an optional
direction.
It
program three parameters, the
length of the data to be
in the
from the
calling
direction of translation, the
translated, and the address of the
be translated.
data to
accepts
CAPS only
data replaces
The translated
the
input data. Like the read and write routines, the PL/1 entry
point allows the use of varying length character strings.
In addition to
an OPEN and CLOSE
that performs
This
is
a
Supervisor
preliminary
on the terminal
required
operation
control
to construct
device. Also, there
is a routine
the above routines, there
blocks
is a supervisor call
by
data set.
the
I/O
and allocate
the
which initializes
the interrupt interface described later.
The I/O Supervisor requires that
an
associated
routine
error
is loaded
termination
occurred.
routine in
into
of an
the
I/O event
Error recovery
every I/O device have
the
SVC
library.
This
transient area
whenever
the
indicates
an error
has
that
for the Princeton 801
is limited
to the detection of the
timeout condition during read.
All
other
caught by
user
and
no way
to
errors
corrected
must
manually.
validate data
be
This
read from
the
is because
or written
terminal
there is
to the
terminal.
Any
gross errors will be detected immediately and subtle errors,
though
they
go
unnoticed,
are
probably
Experience has been that errors are infrequent.
17
unimportant.
CHAPTER _4
COMMAND LANGUAGE
The command language used for the interactive system is
rather
simple.
The
<parameter_list> where
<parameter_list>
blanks.
command
or more
of the
command
syntax
is:
<command>
command> is a legal command name and
is zero
The syntak
to
basic
and
parameters separated
parameter
list
varies
from
assume
almost
any
form.
can
Generally, a
parameter is either
constant, or
a keyword parameter.
an image name,
characters
long,
necessary.
The first character must
padded
on
by
the
a decimal
An image name
right
with
is eight
blanks
if
be alphabetic (A-Z) and
the other seven characters can be almost any other printable
character.
Some characters are
cannot be used.
= "value".
that
must
constant.
by their
a
"keyword" is
be
entered
parameter has the form "keyword"
a predetermined
exactly.
positions
Many
and
parameters may
it
in the parameter
commands
must
be matrix
first
is
a
decimal
in two ways, either
list
require an
be
character string
"value"
Parameters may be recognized
keyword.
parameter
A keyword
reserved for delimiters and
(positional)
image
in
coordinates and
the
or by
name a
list.
one
Other
scaling factors,
though each command has its own particular requirements.
L.1
COMMAND LANGUAGE PROCESSOR
The command
language processor converts a
18
command and
its parameter
rest of the system.
A command
the command
table, a
varies from
command to command
used by the
format to be
list to an internal
to its index in
is converted
binary integer.
list
The parameter
general format.
and has no
Each command has a separate routine to process its parameter
list.
called from
language processor is
The
main control routine each time it
processes it,
terminal,
routine the
is ready to receive a new
reads a
language processor
command. The
and returns
command index and
the system's
to
command from
control
the main
the
a pointer to
the
parameter
Actually, the main control routine passes
list constructed.
to the language processor the address
of an area in storage
where the parameter list is to be constructed.
processor operates
The command
string.
The only
preprocessing done
nonessential blanks.
area
available
is
the deletion
in a common
input string is kept
all routines
comprising
of
the
language
processed, it
is deleted
the string and the string is recompressed.
Additional
processor.
from
to
The
the input
directly on
input from
As
each parameter is
prompting is
inserted at
the beginning
of the
string.
4.2
PROCESSOR ROUTI ES
There
are
three
processor routines.
routines.
logical
The first
groupings
of
group contains
the
command
the control
These routines check for a legal command and call
the appropriate
parameter processing routines.
19
The second
They are responsible for
group is the parameter processors.
creating
a
particular command.
in the
list
parameter
there is a group
Finally,
common functions.
that perform
for the
suitable
format
They include
of routines
I/O routines
and string handling functions.
The command processing routines, as
do the rest of the
system routines, follow naming conventions.
the
processor
command
control routines
routines have
command
and the
they process
"Z".
rest of
as the
the
letter
common function
the
following
mnemonic
begin with
All routines in
routines have
parameter
The
their name
or an abbreviation
"Z.t,
The
a
processing
of the
-the name
of that name.
CONTROL ROUTINES
4.2.1
The control routine for the command processor (Z7MDPRC)
receives initial control. It
(ZSTRING) by calling
command from the
by a
initializes the command string
the I/O read routine (ZGET)
terminal.
call to ZAP, the
Next, the string
compress routine.
to read a
is compressed
If the
length of
the string is now zero, there is no input from the terminal.
Control
is
returned
to
the main control
task with
a zero
command index, indicating that there is no command.
ZSTRING
is now
checked
of eight characters or less
of the string.
table until a
command.
A "word"
is extracted from the beginning
The first blank
end of the word. The word is
the command
for a valid
in the string
now compared
match is
20
indicates
the
to the entries in
found or the
table is
exhausted.
to the
If no
match is found, an error
terminal and
the command
message is sent
processor returns
with a
zero command index.
If control reaches this point, a valid command has been
found.
and
The word is deleted from the beginning of the string
the
string
is
recompressed.
(ZXCTL)is now called
selected.
routine
ZXCTL
has a table of entry points,
one for each parameter processor.
command index
director
with the commandindex and the pointer
to the parameter area.
the
The
and the
This table is indexed by
proper
Control is passed to
parameter processor
is
the parameter processor and
initial processing is completed.
4 2.2
PARAMETER PROCESSORS
The parameter processors (hereafter called Zprocs) are
as varied as the parameter lists they generate. However,
there are several general formats which represent 90%of the
presently
implemented commands.
discussed
here,
categories.
as
Four
formats
most commands fall into one
The commands not represented,
will
be
of the four
though they
generate different parameter
lists,
operate similarly to the
ones
discussed.
Thus,
most
of
the
logic
of
parameter
processing will be presented.
The first
take no
and
parameters.
PEND.
routines
group of
The
commands is
trivial in
These commands include
commands require
no
simply make an immediate return.
21
that they
LOGOFF, LISTD,
processing
and
the
They are included
only
to
make
the
necessarily
know
processing.
Also,
they
processing
which
commands
if these
need parameters,
uniform.
do
command
there are
ZXCTL
not
re
does
need
not
parameter
extended so
provisions for
that
including
processing.
I
I
I
I
I(****
I
ZCMDPRC
*
I
*
…
ZGErNM
I
I
…-
I
*
*
*
I
*
_ __ _
I
I
ZXCTL
1__
_
!
L
I
I
*
L
<*******
ZAP
I
ZSTRING
I
ZGETKEY I
.1
I
*
<****
ZPROC
I
I
I <****I
i
I
*
*
I
1
_
*******************************>
I
1
__1
FIGURE
I
I
ZGET
I
ZSEND
I
I…----- I
2
RELATTONSHIPS BETWEEN COMMAND PROCESSOR ROUTINES
The next level of parameter
that require a
processing is the commands
single parameter, an image
includes PROCESS and SAVE.
This
22
name. This group
name may describe an image
or may be
permanent file
on the
a special
"phantom" name
The
image
the
active image.
described in Chapter
5. There is a
indicates
that
name.
image
It
to get the
to
returns control
and
now finished
is
ZGETNM
necessary to
The Zproc calls ZGETNM
image name.
get a valid
name.
error checking and prompting
performs all the
is
common routine (ZGETNM)
for an image
the input string
that searches
active
ZCMDPRC.
include those that require
The third level of commands
with several
an image
name along
commands
include DISPLAY,
TTOD,
ADDC, SUBC,
ZGETNN
to
These
DIVIDE, SCALE,
FLAT,
SUBTRACT,
MULTC, DIVC,
and STAT.
as above.
get the image name
must get the other parameters
In
they
addition,
and supply default values for
To avoid ambiguity,
keyword.
use
The Zprocs
As mentioned above, parameters
omitted parameters.
positional or
other parameters.
may be
all positional
When
the keyword parameters.
parameters must appear before
the first keyword parameter is encountered, a flag is set to
indicate
any
that
encountered are out of place.
a keyword
parameter
A positional
parameter.
first
being
character
converted
to replace
to the
each out of place positional
numeric
is
(0-9
type and
recognized
and
+-.).
(first, second,
third,
etc).
Keyword
the first character being
23
the
by
It
is
the
inserted into
being constructed according to
parameter list
recognized by
The user is prompted to enter
parameter
proper data
parameters
positional
additional
its position
parameters
alphabetic.
are
There
is
common
another
keyword form the
routine, ZGETKEY,
match is
is converted
the keyword
value associated with
found, the
If a
for that command.
valid keywords
table of
the
checked against a
The keyword is
string.
separates
that
and placed into the parameter list according to the keyword.
is in error and the user is
If the keyword is not found, it
prompted to correct it.
After
all specified parameters are
default values.
are given
that are omitted
processed, any
The Zprocs now return to the control routine.
category of Zprocs construct
The last
lists of image names.
DELETE
are
The list contains the number of names
element.
as the first
The commands that
AVERAGE. The
and
variable length
input
fit this category
string
is
processed
identically for each name until the string is empty.
are processed, control is returned
is used. After all names
to
ZCMDPRC.
This
extended to
varying
include lists
length
are more
can
be
than a
length list of parameter
The restriction here is that each member of the list
be identical.
4. 2 3
parameter list
whose elements
single parameter, i.e., a variable
lists.
ZGETNM
This in fact is done for CONTOUR.
COMON FUNCTIONS
ZAP,
compresses
the
most
commonly
ZSTRING and,
optionally,
characters from the string, where
ZAP first
converts the
then proceeds
to delete
used
first N
function
deletes
N
the first
N is a calling parameter.
characters to
all nonessential
24
routine,
blanks.
blanks from
It
the
string.
A blank
in the
is considered
string,
parentheses,
next
to a
or left
blank,
of
from
left to
character
Each
right and
flags
are set
it
of a
left
The
only
blanks inside of double "quotes".
kept.
found.
it is first
the right
are always
is
nonessential,
to
if
right parentheses.
a
exception to this rule is
These blanks
nonessential
when
is deleted
a
character is
blank
by moving
checked
according to
is
found
the remains
to
what
be
of the
string left one position.
The command
I/O to the
terminal.
level I/O
input from
In
addition, they
the command
the terminal.
terminal.
The
two routines
They are interface
routines.
particular to
the
processor has
routines to lower
perform processing
processor. ZGET
It calls
input is
Presently, it is called with a
is used
PGET to get
inserted
beginning of ZSTRING. ZPUT sends
which perform
to get
input from
directly
into
the
a message to the terminal.
message to be sent and links
directly to PSEND, a routine which controls the text area of
the terminal.
The use of ZGETNM has
element of
ZGETNM
the
If the
is prompted
to enter it.
If the
A
whether or
parameter
not the
name is required and not
found, the "phantom"
follows.
string.
which indicates
required.
find an image name as the
it expects to
When it is entered,
first
been described under the Zprocs.
If
is passed
to
image name
is
found, the user
the name is optional
name is returned.
first character in the
25
ZGETNM
and not
proceeds as
string is numeric,
there is no image name present and the proper action (above)
is taken.
a
Next, the position of the first blank is found and
"word"
is
extracted
from the
string.
If
this
contains an equals sign, it is a keyword parameter.
word
In this
case also, there is no image name and the appropriate action
is taken
(above).
an image
with
the word is
name and is checked
an
alphabetic
characters.
an
Otherwise,
image
for validity.
character
is
to
contain
characters, it must be enclosed
"quotes"
and
are present,
they
It
contain
If not, the user is prompted
name
considered
blanks
to be
must begin
only
legal
to correct
it.
or
illegal
other
in double "quotes".
are removed
and
If
If the
the name
is
considered legal.
ZGETKEY is
ZSTRING.
used to
extract a
keyword parameter
from
When it is entered, the string should consist only
of positional and keyword parameters. If the first character
in ZSTRING
is numeric,
parameter.
In this case, ZGETKEY returns the null string as
the first
element is
a positional
the keyword and the calling Zproc must handle the positional
parameter.
Otherwise, the parameter is considered a keyword
parameter.
The
keyword is
extracted form
returned to the calling Zproc.
associated
position.
string
and the
and
Also, it is deleted from its
value
The Zproc may now
the string
is
moved to
the
first
convert the value according to
the keyword returned.
In addition to the above common functions, there is an
implicit function
present in
26
the form of
a PL/1
ON UNIT.
This
ON UNIT
raised during
of a
error
is
conversion from the
decimal to the internal
message
a
entered whenever
to the
conversion error
character representation
format. The ON UNIT
terminal
is
and
prompts the
sends an
user
to
correct the illegal number. The input from the user replaces
the illegal number and the conversion is retried.
27
CHAPTER
5
AVAILABLE COMMANDS
ommands available
There are four general categories of
on
commands that
informatory
are
and
DISPLAY,
LISTD,
disk files.
of
commands
These are PROCESS,
Finally, the LOGOFF and HELP
PEND, SAVE, DELETE, and TTOD.
commands are used
supply
Included are
group
third
STAT. The
control the contents of the
commands
permanent file.
information on images and the
the
SUBC, MULTC, and DIVC.
These
commands.
is
These include
on images.
perform functions
SCALE, DIVIDE, SUBTRACT, FLAT, ADDC,
Next
category
first
The
system.
interactive
the
to control the terminal
detail.
commands will be described in
session. Not all
However, the general
operation of each command will be presented in some form.
IMAGE FUNCTIONS
±.1_ ACTIVE
The
commands
operate on the
perform functions
that
"active" image.
The active
on
images
all
image is stored
on a separate temporary file capable of storing one standard
sized image.
command specifying the
the given
file and
Block
image from
sets the
(CAIB).
active by entering a PROCESS
An image is made
image by name.
the temporary
the Active
Image Control
is made active,
After an image
must use it as principle input.
images for input read the
command copies
file to
the permanent
active bit in
This
the functions
The functions that need two
secondary input directly from the
28
active image.
from a
The
accumulator must first
be loaded
with the SAVE command.
1I
I
I
I
ACTIVE
I
I PERMANENT
PROCESS
I <**************
I
I
IMAGE
I
I
FILE
I
I
SAVE
*
I
IMAGE
I
1
FILE
I
*
1
i
I ACTIVE IMAGE COMMANDS 1
FIGURE 3
RELATIONSHIPS BETWEEN ACTIVE IMAGE
PERMANENT FILE
_
_
_
_
_
_
_
AND ACTIVE IMAGE COMMANDS
_
_
_
29
_
may be
The active image may also
stored into any memory location.
be stored
the
accumulator
the
of
of the accumulator
the contents
Finally,
(SUBTRACT).
with
accumulator
contents
the
replacing
another storage
Next,
from the
be subtracted
may
results
permanent
(PROCESS).
storage location
location
and the
a computer
register on
its memory.
file is
into the
image corresponds to
a sense, the active
In
the accumulator
plased back
results are
but the
permanent file,
_
_
_
_
_
_
_
_
_
5.2
DISK MAINTENENCE ROUTINES
There are three
of the
commands
used to control the contents
active image.
The PROCESS command
These are
PROCESS, SAVE,
was described above.
The
and PEND.
SAVE command
may be used to copy the active image back onto the permanent
file.
The
SAVE command may be
argument.
is
If entered without an
stored
under
original image.
with a
its original
new name to
name,
thus
replacing
the
If
the new
contents of that
active image. Otherwise, the name
new image is created.
return the
active image
prompt the
user to save the
Otherwise, it sets
the image.
in the directory, the
into the directory,
In addition,
argument, the active image
be assigned to
image are replaced by the
is entered
without an
Optionally, the SAVE command can be entered
name already exists
and the
entered with or
space is allocated
for it,
The PEND command is
used to
inactive status.
It will
to the
image if it has
the inactive bit in the
the DELETE command may
image from the image file and
been altered.
CAIB and exits.
be used to
delete any
the TTOD command will restore
an image from a library tape to the permanent file.
The
LISTD command
listing of the
on the
provides the
user
contents of the permanent
file is listed by
information about
with an
file.
name along with several
the image.
the disk is listed at the end.
30
The
amount of free
edited
Each image
items of
space on
1.3
OTHER COMMAANDS
The DISPLAY and STAT commands may operate either on the
active image or
functions are
image.
on any image on the
"read only"
permanent file.
in that they
do not
These
modify the
The phantom
image name (mentioned in
Chapter 4) is
used to distinguish
between the active image
and all other
images.
If the phantom image
name is passed to the routine,
it will use
the active image for its
will attempt
to
input.
Otherwise, it
use an image on the permanent
file for its
The DISPLAY
the terminal
more in
input.
command is used to display
in gray
scale.
the appendix.
The
Display
an image on
modes are
discussed
STAT command provides
the user
with pertanent statistics on any submatrix of any image.
To
commands
control the
available.
The
terminal session.
with
terminal
session,
on
has
LOGOFF command is used
The HELP command
information
the user
how
to
use
to end the
will provide
the
system
two
the user
and
enter
commands.
5.9 JUSTIFICATION FOR THE ACTIVE IMAGE
The active
image mode
several considerations.
reduction of
distant on
have to jump from imagel
image. However,
drives,
The major
I/O wait time.
are physically
the
of operation
the heads
if
If
two images to
to image2
the images
31
by
consideration was in the
the disk,
can remain
was motivated
be combined
the read/write
heads
and bazk for each row of
are
on distinct
relatively stationary.
disk
The
cost
of copying the image to
the active image file and back
must be considered, though.
An average disk
processing
being
file will be 60% to 80%
session.
added and
However, if
deleted, any
images
are
particular
Average
drive is 75 as and the
To combine
average
two images on the
12.5 as rotational
seek time to
rotational
delay to access
a total of
187.5
row1
s delay
delay to access
for each row.
If the
times can be divided into
SAVE time.
image
the
file to
and e)
with the combined
PROCESS time, combination time, and
permanent
a)
b) 75 ms
time back to imagel,
images are on separate packs, the
from the
require:
row1 of imagel,
delay to replace
isk
delay is 12.5 as.
same pack would
d) 75 ms seek
12.5 as rotational
will be spaced
time for an IBM 2311
image2, c) 12.5 ms rotational
rowl of image2,
rows, for
seek
equal
Therefore, we can
the average, any two images
1/2 disk pack away.
a
continuously
image has
chance of occupying any slot on the disk.
assume that, on
full during
To copy the
active image
file
requires 12.5 ms rotational delay on each drive for each row
copied,
or 25 ms per row.
The SAVE time is identical.
The
combining requires 37.5
ms delay time per
row because each
row has to
be read
s)
must
(12.5
This gives
s).
savings
of 57%.
(25
This
and the result
a total of 87.5
is a
minimum
s delay
savings.
be written
time, or a
The
usual
practice is to perform several functions on the active image
before saving it.
row
for each
This is an
function
additional 150 ms savings per
performed.
32
The actual
real
time
savings
complicated to
is more
However,
analysis.
savings
per row
savings
of
of rows
the number
by
In
seconds.
25
estimate is
a simple
To
above
the
to multiply
to give
(250)
it
a
takes
SAVE an image and 30
combine
two images
approximately 90 seconds,
system takes
in the
on the interactive system for
seconds to combine two images
of 60 seconds.
time,
practice,
actual
approximately 15 seconds to PROCESS or
a total
The read
were ignored
and overhead
computation time,
compute.
the batch
on
estimate is
so the
reasonable.
The second consideration in the active image philosophy
is maintaining
consistency
to have
undesirable
in
the permanent
image in
an inconsistent
image is
considered inconsistent when
performed
on
system at
interrupt the
confined to
it.
restoration of
SAVE
function,
inconsistent
will
of the
the file.
An
a function
has been
Since the
user may
However, by
create many
making all
image from
if interrupted,
possibility
in
only the
the permanent
can
still
but at least
file.
leave
an
the user
this instance.
system cannot be completely "idiot proof".
33
can be
most inconsistentcies
image on the image file,
be aware
is
simple and involves
Recovery is
the active
It
this could
any time,
the active image,
changes to
it.
inconsistent images.
instances of
The
1) of
(<
a fraction
file.
The
6
CHAPTER
SYSTEM STRUCTURE
The
interactive
collection
of
processes
synchronizes their
associated with
may
and
be
a
operation.
thought
control
There
each command
language processor.
be active
system
as
routine
is a
a
which
logical process
implemented and
one for
Although only one logical
at any time, several
of
the
process may
tasks may be active
in the
implementation of that process.
There is one routine per command that actually performs
the function of that command.
level routines in
convention
These routines are the lowest
this discussion.
"A" followed
implement, and will
by the
name of
be called "Aprocs".
for the individual Aprocs was
and will not
be discussed
quite
interactive
important in
At
the
blocks
describing
their
begin with "C", end with
the middle.
developed from
The logic
of the
the ground
higher
implementation
the highest
The control routines
a mnemonic
of the logic
than the
They will be presented as
control routines and control blocks
with
Most
they
serve as interfaces between the
environment.
system status.
the command
One level
Aprocs and the control structure.
are
the naming
developed on the batch system
here.
Aprocs are the Iprocs. They
they
They follow
"B,
the
are
the
used in maintaining the
begin with '"C"and end
function.
The
control
and have a mnemonic
interactive
up, beginning
34
level
of
in
system
will be
with the
procs.
The
implementation
of
the
"break"
discribed. The control routine will
the user/system interface.
session will
function
be
be presented along with
Finally, a
be stepped through
will
portion of a typical
showing where
the various
routines interact.
6.1
IPROCS
The
Aprocs
function
are
without
environment.
designed
any
to
perform
knowledge
The environment is
of
a
particular
the
interactive
transparent to the Aprocs.
Under normal circumstances, an Aproc would be entered with a
parameter
exit.
list, it
However,
would perform
operation under an
is not quite so simple.
First,
known,
of a point in an
the user may
alternative is to
then
interactive environment
One
image.
enter
function, and
there is the possibility of
obtaining parameters dynamically.
coordinates
its
them
example is inputting
If the coordinates
with the
position the cursor to
command.
are
The
the desired point
on an image on the terminal display and have the system read
the coordinates from
coordinates
executed.
are
The
procedures is
user wishes
the terminal. In the
not
second
known
until
deviation
the "break"
function.
to terminate the
the
latter case, the
command
from
normal
A
break is
currently active
regain control of the system.
is
being
operation
when the
command and
Some means of terminating an
active Aproc is necessary.
The Iprocs were developed to aid
in
the
the implementation
of
35
break.
In
addition,
some
checking is done on the legality of the parameters passed to
the Aproc and on the status of the system.
Although
ynamic
parameter processing is not implemented to a great extent at
the
present,
this
function
Iprocs because of
is
a natural
addition
their structure and logical
to
the
placement in
the control structure.
To
implement
a
breakable function is
routine.
break,
subtasking
is
attached as a subtask
used.
Each
of the control
When a break is indicated by the user, the subtask
is detached.
terminate
This causes the operating system to abnormally
the
subtask
allocated to it.
apparent later.
an active
and
then
release
all
The necessity for subtasking
In PL/1 there is
subtask. However,
resources
will besome
no explicit way to detach
there is
an implicit
way.
A
return from a PL/1 proceedure, unlike most languages, is not
really a return but a call
to a PL/1 library routine.
routine frees all resources allocated
addition, it detaches all tasks
The Iprocs
This
to the proceedure. In
attached in the proceedure.
are such proceedures.
The main function
of an
Iproc is to attach its corresponding Aproc and then wait for
either its normal
When
either one
returns.
If the
is much like
of these
The process
released. If the break
it is
detached
of a break.
satisfied, the
Aproc has terminated normally,
has completed,
terminated.
events is
a normal return.
its resources are
Aproc
completion or the occurrance
Iproc
the return
is complete and
occurs before the
and thus
abnormally
In either case, control returns to the terminal
36
and the
user may enter a
can be initiated
Iproc
and one
Aproc for
it
does
functions that
breakable.
something
There is one
In addition,
It has
control routine
"know"
environment, the
I
each command.
processor is
attached by the
since
All
by a command are breakable.
command language
but is
new command.
the
no Iproc
directly. However,
about
the
interactive
need for an Iproc is not as great.
I
{ ************************
CONTROL
1*
I
I
I
I
I
*
I
I
1****>l
PGET IIC****lI IN II
I
I
IPROC
I
_
1
I
_________
!I *
I
I****>1
$* I
I
__
1
APROC
1
******>
*
_
_
I
I
_
~
_
DISK
I-
I
ROUTINES
AND
I
I
MAINTENENCE
-__
******
I
I
I
I
FIGURE
4
CONTROL STRUCTURE
37
I
I
BLOCKS
i
A
1
l
I
1
i
CONTROL I
11__I
I
I
__,
I
UTILITY
I
I
_
I
****>1
~~~~~~~~~~~~~~~~~~
_
I
I
************
I
_
PSEND t****>1
I
I
I
1
I
I
...
6.2
IMPLEMENTATION
OF BREAK
a break
When
is
detach their
Iprocs
intended by
respective
Aprocs
terimnal user,
to terminate
the
them
However, the reception of a break by the system is
(above).
a different story.
interrupt facility of the
The attention
terminal is used to initiate
communication between the user
However, this communication may
and the system.
purpose of
for the
the
entering
a command
or for
be either
break.
Its
interpretation depends on the current state of the system.
The path
through the
interrupt from
of the attention
operation system to
the terminal
the interactive
system is
For our purposes here, we
discussed fully in the appendix.
can assume that the operating system signals the interactive
system
when the
interrupt
an event
the completion
of
interrupt.
occurs.
associated
must be awaiting the
A task
eventin orderfor it to
be meaningful.
a command,
an interrupt from
done by posting
terminal
with the
completion of this
Thus, the
use of
While the interactive system is
subtasks becomes necessary.
processing
This is
for
there must still be a task waiting
Otherwise, the
user would
has a rouinte (CPIC)
whose sole
the terminal.
not be able to issue a break.
The interactive system
purpose is to monitor the
terminal for an interrupt.
initially attached, it sets up
to be used by the operating
the interrupt.
When the
completion
an event control block (ECB)
system
It then waits
of the ECB
38
When
to post the occurrence
for the interrupt
is posted, CPIC
of
to occur.
"wakes up"
and handles it
as described below.
It then
goes back into
wait until the next interrupt occurs.
As the
only
be
interactive
entered
when
processing a command.
is active
block,
the
CPICB, used
the system.
is
now set up,
system
An interrupt
is interpreted
(active or idle).
of
system
as a
completion of the
the system
(*) There
the status
When CPIC wakes
If
idle,
is
idle,
WAKE_UP ECB in CPICB.
the
processor) that
the
then detaches
The
routine expecting
is
returned to
"active".
Thus,
system
user
the
is to signal
input (usually
is ready
and
to
If the system is active, the BREAK ECB
an Iproc is waiting for
its Aproc to
active/idle
of the
rhis
for terminal
is posted. Usually,
is a control
CPIC posts
that is waiting
continue processing.
not
up, it checks the status
whatever task
language
i.e.,
may
issued while the system
break.
to maintain
is
commands
flag
in
terminate the
CPICB
is
set
the
waiting task,
status
of
CPIC
the
It
current command.
to
input from the terminal.
the
the break.
"idle"
by
any
Before control
set
the flag
system
is
to
always
available.
(*) It might
be noted
here that this
is an unnecessary
restriction. The system was initially developed this way
because it is less complex.
However, an extension to
overlapping processing
with command
entering may
be
accomplished by creating another task for the language
processor so that commands may be entered while the system
is active. However, this raises questions of contention for
the terminal
complex.
and makes the
interpretation
39
of a
break more
6.3
CONTROL ROUTINE
The control routine (CONTROL) for the interactive system
is
Basically, CONTROL
very simple.
a
accepting
command
from
the
as a task
address
of the
director
routine
the
control
the
for
list are
either normally
or abnormally,
the
index and the
to CXCTL,
XCTL
to
initiate
command to
the
to return
task.
Iproc
for
CONTROL waits
execution.
passed
the control
appropriate
calling
waits for it
Next, the command
parameter
loop,
The language processor
and CONTROL
command.
with a processed
and
user
appropriate processor to execute it.
is attached
in a
executes
the
transfers
command
terminate,
prepares for
and then
the
next command.
6.4 OTHER ROUTINES
are two
There
control the
they are
their
other
terminal.
routines used
These are
I/O routines, they
interface
particular is
with
the
related to
function is to read one of
However, it
first waits
Upon entry,
PGET sets
PSEND and
the system
control
the above
to
PGET. Although
are presented here
structure.
discussion.
because of
PGET
Its
in
main
line of input from the terminal.
for the
the "idle"
interrupt from
flag in
waits for the WAKE_UP ECB to be posted.
the user is
by
ready to input data and the
the user.
CPICB and
When PGET wakes
then
up,
read is initiated.
PGET may be called from any task, and that task is suspended
until the user is ready.
In this way, the other routines in
40
the system
set
needing input from the
up the interrupt protocal.
above interrupt
terminal do not
PSEND does not fall into the
processing discussion, but
control function.
The bottom third
used
This is
conservatively. The
bottom as each
always
that contains
is
new line is entered.
visible. PSEND
maintains a
information
have a
between the user and the
a limited
cursor
it does
of the terminal display
is reserved for text communication
interactive system.
have to
on the size
space and
rotated from
The last
must be
top
12 lines
control block,
are
CTEXTB,
of the text area, the
current line position, and the coordinates of the lines.
any
point, PSEND
terminal.
may be
The cursor
the line is sent.
called to
output a
is positioned to the
The next
the user can see which is
to
line to
At
the
proper line and
line position is erased s
the current line.
that
This frees the
other routines from worrying about where on the terminal the
line is to be written.
6.5 EXAMPLE
At this point,
typical terminal
with the initial
an example is in order.
session will be
job set up
interactings of the
shown.
This
each major
portion of a
e
will start
and then process an image.
portion of
works.
41
The
system will be
a complete description
total capabilities of the system.
demonstrate
presented.
various portions of the
is by no means
A
of the
Rather, it is intended to
the system
and how
it
The first
interactive
disk
thing that
system is
pack must
powered on.
PAL3.
a
be
must be
the computer
mounted on
In this
done before
a
mounting.
off)
to
the
The
through
the
job for
describing the
module for
operating
card
operator's setup.
The
example, we will
terminal
and the
the
drive
The operator mounts the disk
command
running
the
use the
to
The
program and
job
the data
the interactive
system
disk named
recongnize
powered on (it
interactive
reader.
terminal
on the drive and enters
system
is now
and the
system
contains
is normally
is read
in
mostly
JCL
sets used.
is on
the
The load
a library
on the
permanent storage for the computer system.
When the
It
must
job starts running, CONTROL
first
perform
interactive system.
file.
The
First, it
active image
created
each time the
of the
job.
The
directory
the
monitor
for
the
initializes the active image
temporary file
job is run and is deleted
Next, the image
for
initialization
file is a
file on PAL3 must
file is
resides during processing.
task to
some
receives control.
read
into
core
that is
at the end
be opened.
where
Finally, CPIC is attached
the terminal.
The
system
is now
it
is a
ready to
receive commands from the user.
CONTROL now attaches the command language processor as a
task.
to the
"OK".
ZCMDPRC sends
a message to the
user that it is
now ready.
terminal to indicate
The mssage
usually is
ZCNDPRC calls ZGET which calls PGET to read a line of
input from the terminal.
PGET sets the "idle" flag in
42
PICB
and waits for WAKE_UP to be posted.
wait state.
When
presses the BREAK
by
CPIC.
taken.
CPIC
It
a command,
key on the terminal.
key sends the
system
checks
that the
ECB
then
and
interrupt.
to the
determine
the
system
receives control
what action
flag
is "idle".
to the
When WAKE_UP
ZGET which places
CPIt
active/idle
returns
PGET which reads
system.
his
he
by means of posting the ECB set up
must now
discovers
is now in a
the user is ready to enter
attention interrupt
from the operating
The system
It
wait
CPICB
in
be
and
posts the WAKE_UP
state
for
is posted, control is
input from the terminal.
the input into the
is to
the
next
returned to
PGEr returns to
beginning of ZSrRING.
Since ZSTRING is initially empty, the input is the only data
in the
string. ZCMDPRC
command.
"LISTD".
It
now checks the
finds that
The command
the user
index
is set
has entered
to 4 because
fourth command in the command table.
called (ZLISTD) to process the
no
parameters so
string for
the command
LISTD is the
The Zproc for LISTD is
parameter list.
ZLISTD returns
a legal
to
LISTD takes
ZCMDPRC. The
command
processor is now complete and returns to CONTROL.
CONTROL has been waiting patiently for the completion of
either ZCMDPRC
interrupt
command.
or the
the system,
CONTROL
break ECB.
ZCNDPRC returns
checks the
turn calls
ILISTD,
the user
with the
command index
that a legal command has been
in
Since
found.
the Iproc
did not
processed
(4) and
CXCTL is called which
for
the LISTD
ILISTD attaches ALISTD and waits for it to complete.
43
finds
command.
ALISTD
receives control and says, "Aha, the
images are in the directory."
contents of the directory on
has
finished, it
returns to
It
then proceeds to list the
the terminal display.
returns to
CONTROL.
user wants to see what
ILISTD, which
The system is
When it
cleans up
now ready for
and
the next
command.
The user sees that he has four images on the disk, named
DARK, FLAT,
MOONRED, and MOONBLUE.
These
images represent
the dark field, the flat field, and two data frames taken of
the moon
user
in the
wants to
their ratio.
dark
frame
red and
blue regions,
calibrate the
The first
from the
respectively.
two data
frames and
thing he does
flat
field.
is to
He
The
compute
subtract the
does this
by
the
following sequence of commands.
PROCESS FLAT
SUBTRACT DARK
SAVE FLATD
PEND
Thus, a
new image
result of
is created, called
subtracting the dark
Each of the
FLATD, which
field from the
commands entered above is
is the
flat field.
handled similarly to
the LISTD command above.
Next, the user must subtract the dark field from each of
the data
frames and
example,
we will
then remove
assume
that
the flat
he first
field. In
attacks
this
MOONRED.
First, he enters a PROCESS MOONRED command to make the image
active.
create an
Next, he
will
image with the
enter
SUBTRACT DARK.
dark field correction.
44
This
will
Now, for
pedigogical reasons,
that he
let's assume
Now, while the
the image with a new name.
to save
later
He might enter SAVE
look at the dark field corrected image.
REDDARK
wants to
dark field corrected image is still active, he would want to
field.
remove the flat
FLAT, which is
He might enter FLAT
However,
the command to flat field correct with image FLAT.
discovers that he wanted to
after he enters the command, he
FLATD instead
use image
of FLAT.
now enters
He
break to
interrupt the system.
In general,
the language
processor
runs too fast for the
We can
user to interrupt it before it completes processing.
therefore assume
that the
FLAT FLAT
When
realizes his mistake.
started executing when the user
the interrupt is
actually
command has
issued by the user, AFLAT
is removing the
flat field FLAT from the active image while IFLAT is waiting
for
it
to
complete.
interrupt is issued.
system is
CPIC
receives
when
control
the
CPICB and realizes that the
It checks
"active". Therefore, it
posts BREAK, the
ECB to
indicate that the user wants to interrupt processing.
IFLAT
to complete.
When
is
waiting for
either BREAK
or AFLAT
BREAK is posted,
IFLAT receives control and
causes
be abnormally
AFLAT to
returned to CONTROL.
command
been
from the
changed by
recreated.
ZCMDPRC is
user.
the
terminated
and control
This
is
called to prepare the next
Since part of the
erroneous
returns.
FLAT
image
has
it must
be
active
command,
The user enters the
PEND command to release the
active image without saving it.
Since he has saved the dark
45
now enters PROCESS
When the
commands.
REDDARK and then the
correct
it.
have to recreate
image, he does not
field corrected
He
correct FLAT FLATD
field has been removed, he
flat
saves the active image with the SAVE REDDF command to
reate
With the
a new image with the dark and flat fields removed.
can correct the MOONBLUE
following sequence of commands, he
image for distortions.
PROCESS OONBLUE
SUBTRACT DARK
SAVE BLUEDARK
FLAT FLATD
SAVE BLUEDF
point, the
At this
corrected his
user has
images for
distortions and saved them under new names. If these are the
only two images
DARK and
he wishes to work on, he
FLAT images.
He can
might discard
enter DELETE (DARK
the
FLAT) to
delete the two images from the file and release their space.
Now, he may look at
what to do
specifying
the images he has created
with them next.
the names
The DISPLAY command is entered
of the images to be
images are drawn on the terminal display.
the
images
approximately
the Y
the
and decides
that
14 points in the X
the
two images,
not have to enter a PROCESS
must
shifted
in
To compute
enter the
DIVIDE
Since the BLUEDF image
was not entered), he does
command for it.
DIVIDE REDDF 14 37 to ratio the two images.
46
is
and 37 points
the red image.
he
and the
The user looks at
direction
command with the overlay parameters.
is still active (the PEND command
displayed
blue image
the
direction with respect to
ratio of
and decide
He might enter
Next, a DISPLAY
command
is entered
ratio.
The
to display
command
"phantom" image
active
image and
When the ratio
processor
image is displayed,
RED/BLUE command
new
will
the
saves the
the user
to create
active
an image
was entered
the image file.
finds,
he has correctly guessed
He
pass
must display the
not look for the image on
first try.
image, the
because no name
ADISP realizes that it
his surprise, that
the
language
name to ADISP
with the command.
the active
much to
the overlay on
image
with a
named "RED/BLUE".
SAVE
He
enters a PEND command to delete the active image and decides
that such success
MITPAL.
must be shared with the
The LOGOFF
terminal session.
command is
The terminal is
entered
other members of
to terminate
powered off, the disk is
dismounted, and the example session is complete.
47
the
CHAPTER
7
PERFORMANCE AND IMPROVEMENTS
The interactive
system as
operation since September,
reduction
current
with
described here
1974.
has been
It is being
used for the
of images taken of Mars and the Moon.
work is
the
in the area of color
batch
implement.
system
Future
has
this
developments
capabilities of the system to
Most of the
ratios,
made
in
as experience
the
easiest
should
to
extend
the
include Fourier filtering and
creation of mosaics.
There are several needed improvements to the interactive
system.
First,
problem.
The
the LNS
scheduling
of
its
interactive system uses
computer.
begin with,
the
Since there
this is a
operation
a full
are only two
heavy drain on
is
a
partition at
partitions to
available resources.
However, if the system could be made smaller with respect to
core usage, only
a small partition would
there would
be enough
partitions
in addition
would
mean
less
core left
to
impact
the
on
over to
be necessary, and
run two
regular
interactive system.
normal
operations
and
This
more
available time to run interactively.
Another needed
time.
improvement for
Processing times are on the
to perform image functions.
by the
speed of
the disk
the system
order of 15 - 40 seconds
Although
drives for
several areas where processing can
48
is response
the system is limited
I/O time,
there are
be overlapped to improve
response.
could
is
For example, with
be performed
being
read
double buffering, an operation
on one row of an image
in.
Also,
several
performed simultaneously, such as dark
corrections.
One row of an image
while the next row
functions
could
be
field and flat field
could be read in, the dark
field subtracted, and then the flat field divided before the
results are written
is read
out.
This means that
and written only once
the two corrections,
the active image
instead of twice
or a savings
to perform
of 1/3 in I/O time.
The most needed improvement to the system is the display
capabilities.
been explored
The possible terminal
as
yet.
Appendix
displays have not even
B discusses
several
of the
improvements planned.
Other than
system
command
the improvements mentioned,
is working
quite well.
language are
The basic
fairly well
structure.
The improvements can be
structure.
The
author hopes the
MITPAL's image processing future.
49
developed
the interactive
frame work
and fixed
and
in
made within the present
system will be
useful in
APPENDICES
50
APPENDIX
A
OPERATING SYSTEM MODIFICATIONS
Several modifications to the
LNS operating system were
necessary to allow the use of the Princeton terminal and the
implementation of the interactive system.
Unit Control Block (UCB) for
the I/O Supervisor.
to
direct
the
the terminal was necessary for
An interrupt handling routine was added
processing of
attention
ATTACH service routine and the
modified to allow the use
The
of the multitasking facilities of
done during system
relatively uninteresting.
interrupts.
GETMAIN service routine were
the PL/1 language on an MFT system.
is normally
The addition of a
The addition of the UCB
generation (SYSGEN)
The interrupt handler
and is
would not
be necessary except in the absense of a multiplexor channel.
The PL/1 fix could be helpful
to users of other
FT systems
who want to do multitasking.
1.1
UNIT CONTROL BLOCK
The UCB is an area
of supervisor storage that contains
information on a particular I/O device. There is one UB
every device
on the
UCB's to schedule
and
errors, and
information
on
system.
The
I/O Supervisor
I/O operations, to handle
to
the
allocate
devices.
present status
logical
(online/offline,
(ready,
intervention
allocated,
required, not
51
of
uses the
I/O interrupts
The
UCB
the
device,
... )
for
and
contains
both
physical
operational,...).
It
also
has pointers
to
routines to
interruption processing.
of supervisor
storage,
UCB Lookup Table
the unit
error handling
and
The UCB Lookup Table, another area
contains
is searched
address.
do
pointers
in a tree
The UCB's and
normally generated during
to the UCB's.
fashion,
The
indexed by
the UCB Lookup
Table are
SYSGEN. However, the one
for the
Princeton terminal was done in a novel way.
When the current
added
that was
system
not being
an extra UCB was
was generated,
used.
Since it
was free,
the
author decided to steal it for the Princeton terminal rather
than do another SYSGEN.
used to change
The
the unit type
IBM service aid, IMASPZAP, was
and unit address
UCB to reflect the Princeton terminal.
Table was rearranged to swap
several things to be said
doing a
SYSGEN.
What
to
There are
about changing the system without
to be
a small
change
system least expected. The author
was not sure the above fix would
found
Also, the UCB Lookup
the unit addresses.
would appear
might affect parts of the
fields in the
be successful.
work, but is was triad and
Later
investigation
discovered
under what circumstances such a fix would work.
There are two major areas of the operating system where
UCB's
are used.
handling.
specified
They
The job
on
a data
the system.
The
basic
addresses.
This
device allocation
schedular must translate the
device on
most
are
definition
statement
This is
method
allows
is
to
done in one of
specify
only the
52
to a
and
unit field
particular
three ways.
absolute
specified
device
unit
device
to
be
allocated.
The second way is to specify an IBM device type,
such as 2314
disk or 1403 printer, etc.
any unit of this type to allocated.
is to
specify a
Each method
generic name,
This method
The most general method
such as
has its advantages
SYSDA, TAPE,
and disadvantages,
handled differently.
When absolute
the allocation scheme
is: does the address
it
other two
available?.
The
for the specified name.
address is
methods
proceed as follows. The Device
llows
etc.
and are
specified,
exist?, and, is
are
similar
and
Name Table (DNT) is searched
If the
name is found, it will have
an associated mask which, indirectly, specifies what devices
may be
allocated to
against the
found that
SYSGEN.
unit type field
can be
existance
to
the
Once
a
completely through
handling,
Lookup
that name.
a
The
DNT.
table
For
Therefore,
the following
handled
already
exists,
can be allocated
is
it
be pointed
the
is
For
to by
unit
the
uring
handled
device
the UCB
must
be
corresponding name must exist in
the above mentioned
First,
Secondly,
a name will exist
53
Lookup Tble
allocated by address
if
a
similar
device
in the DNT and the device
Thirdly,
to include the new device name.
fix will work under
the UCB
The device can now be
by name.
generated
address.
allocation, either
correctly.
match is
method presupposes
allocated,
exist and
then checked
UCB until a
and unit
circumstances.
must be valid.
and
is
the UCB
specified by address, or a
the DNT.
This
device
mask is
in each
allocated.
UCB must
Table.
The
the DNT can be expanded
All three of these methods
assume that
Supervisor
but to
there
is
an existing
to insert
do a
one.
UCB or
room in
If not, there
SYSGEN. The
author used
the I/O
is no alternative
an existing
UCB and
absolute address allocation.
A.2
ATTENTION INTERRUPT HANDLER
The operator's
Input and
output go through
responsible
for
The
unsolicited interrupt.
UCB
which
ready to the
When
the
with the
interrupt
is
an
This means that it is not associated
a
routine
There is a
to handle
attention interrupt when
ready state.
action is to set the ready
attention
Most devices
they go from
The standard
flag
field in the
the
interrupt on devices capable of initiating it.
generate an
which is
the system
attention
initiated action.
points to
way.
presses the REQUEST
which interrupts
condition.
with any system
a special
the Master Schedular
enter a command, he
the console,
attention
handled in
operator/system communication.
operator wishes to
key on
console is
the not
procedure for this
in the UCB and initiate
any
I/O operation awaiting this device. The console is different
in
the interpretation
of
the
interrupt
is not to signal that
initiate
communication
requires
a
handler and
pointer
to
with
a
attention interrupt.
the device
the
Master
different
the required routine
This
is ready, but to
Schedular.
attention
to handle
This
interrupt
the interrupt.
The routine for the console signals the Master Schedular, by
means of the
POST service routine, that
54
the operator wants
to communicate.
WAIT state,
The Master Schedular, which has been in the
now "wakes up" and
from the console.
the same
way.
sends
It waits until
must
to communicate.
interrupt
then
attention interrupt
the user signals
pass
to
the
control
handler.
that
he is
This
to
the
function,
to signal
wants to
communicate.
interactive
It does this
The
written by
It has one main
system that
in the same
it posts the waiting
I/O
appropriate
routine was
and added to the I/O Supervisor.
to the
The terminal
computer.
the author
the console routine;
in much
The user presses the BREAK key on
when he wishes
the attention
Supervisor
the input
The interactive system operates
ready to enter a command.
the terminal
prepares to read
user
manner as
task to continue
processing.
A Supervisor Call routine was also added to the
SYC library
to aid in this
the interactive
an Event
Control Block (ECB) to
In
have to
and is
system when it begins operation.
communication.
not
communication
be used for
fact, this is
not possible because there
by
It sets up
the WAIt/POST
this manner, the interactive
continually monitor the terminal
called
system does
for input. In
is no multiplexor
channel.
A.3 _PL/1
ULTITASKING
The third
the multitasking
system.
system modification
facilities
In this
than one active
involves the
of the PL/1 language
context, multitasking
means having
task under the same job step
55
on
use of
n MFT
more
as opposed
to
having concurrent job
job
within a
tasks.
Some means of
is necessary.
ATTACH service
routine
standard
feature
system.
The PL/1
This is
of the
of MVT systems
tasks
of
done by means
operating system. This
and
is optional with
language allows the creation
within the rules of the language.
in a PL/1
creating
the
is a
n MFT
of subtasks
When tasking is specified
procedure, a different version of the PL/1
storage
supervision library routine is linked with the program. This
routine handles all "automatic" storage and also the tasking
features such as
ATTACH, WAIT, and POST.
routine (IHETSAP) was written for
The multitasking
an MVT environment, using
features of the storage supervision not available under MFT.
Since
it
was necessary
system it
to
use subtasks
was highly desirable to
higher level language in doing so.
operating system, or
in
the interactive
use the facilities
of a
The PL/1 library, or the
both, had to be modified
to allow the
use of this option.
IHETSAP assumes the MVT environment, and in particular,
the use
of subpools in
storage management.
Subpools allow
the logical grouping of storage under a subpool number, both
within a single task, and
the scheme
freed
core
are that storage gotten
all at once, and that
on a task
basis.
when
routines
a
keep
procedure,
between tasks.
track
they expect
in small pieces
second feature, freeing
terminates.
of
can be
storage can be gotten and freed
IHETSAP uses the
subtask
Two advantages of
most
of
Although
the
the operating
56
the
storage
system
library
for
to free
each
the
initial core gotten by first procedure within a task.
The MFT system with the subtasking option already has a
facility for freeing core on a
limited extent.
by the
task basis, though only to a
This facility is
limited to storage gotten
create the
supervisor to
subtask.
A
Gotten Queue
Element (GQE) is created to describe this storage.
terminated, storage described
subtask is
task
by the
is released
extended
to
cover
supervisor.
PL/1
subtasks
by GQE's
When the
for the
also.
The
storage
supervision routine (GETMAIN) makes several checks to
whether to create
subtask?,
a GQE or not.
and b) is the
These include:
supervisor
was
This processing
calling?.
ecide
a) is this a
By adding
one
more test, is PL/1 calling?, we will have simulated subpools
for
PL/1
the
determining
through
environment.
if PL/1
the ATTACH
parameter.
is calling
routine by
Block
is available
to all supervisor
problem
This was
specifying another
flags a field
(TCB) for the task it
routines,
need only test this
lies
in
solved
calling
specify that PL/1 is doing
The ATTACH routine then
Task Control
It
only
or not.
This parameter is to
the attach.
GETMAIN.
The
creates.
in the
The TCB
and in particular,
TCB flag to
determine if
PL/1 is calling.
Thus we reluire three modifications to allow the use of
PL/1 multitasking.
First, the
library routine IHETSAP must
specify to the ATTACH routine that PL/1 is calling.
the ATTACH routine
must set the flag in
GETMAIN must check this flag and
57
the TCB.
Second,
Finally,
create GQE's for the task.
The first
modification requires only
second and third
and four
the
a IMASPZAP
modifications require the addition
instructions, respectively, and the
ATTACH and
fix.
GETMAIN
routines.
of one
reassembly of
Anyone desiring
to
similar modifications may contact the author for details.
58
The
do
APPENDIX
B
DISPLAY CAPABILITIES
be the most powerful
The Princeton terminal display can
interactive system. However, it
device on the
the
developing
and
processor
display
the
interactive
little
format.
spent most
The author
least developed.
This
spent
appendix will
currently implemented and will
on
of his
and
environment
time was
is presently
time
language
developing
outline
the
the
display
present several alternatives
for development.
The current display is fixed in format.
of
the screen
is
portion is divided
reserved
for
specify, as a
messages.
text
into six equal sectors,
displaying one standard size image
The lower third
parameter to the DISPLAY
each capable of
command, the sector
If the sector
specified, the one least recently used is re-used.
an image in the
upper
(256x250). The user may
in which the image is to be displayed.
already is
The
specified sector, it
is not
If there
is erased
before the new image is displayed. Whendoing ratios, it is
convenient to have several images displayed simultaneously
to compare
the results.
However,
the fixed format
is not
readily extendable to other display functions.
There are
several other displays
with the interactive
The resolution
features
system.
that would
be useful
One would be enlarged images.
of the display is limited and not all
of an image
can be seen in the small
59
size.
It is
desirable
to
could expand
expand an
image to a
a sub-matrix
512x510 size.
Or, one
of an image to any desired
size to
locate a feature more exactly.
Another desired capability would be partial rotation and
shifting of
could
image segments on
be combined
to form
mosaic by hand is a long
be produced
the display.
a mosaic.
Piecing together
involved process.
on photographic paper
ranges, cut, and pasted onto
system, each part
Several images
The images must
with the
a backing.
same intensity
On the interactive
of the mosaic could be scaled
to fit the
remaining part and fitted into place in real time.
product is complete,
a
it could be saved in
When the
digital form for
future use.
Finally,
there are
several
displays
in the
form
of
graphs instead of images that are
useful to have. A contour
plot,
intensity,
having
alternative
intensity
contours
to
an
of equal
image.
distributions
Also,
across
an
a
is
a
histogram
image
is
useful
showing
useful
for
not hard
to
statistical analysis.
Although
implement in
contents of
require a
each of
theory, some scheme
flexible format
on the
control over
modes is
is needed to
the terminal display.
retain ultimate
able to
these display
Variable
maintain any combination of
sized displays
terminal. The
the terminal
control the
user must
contents, being
displays concurrently.
The display routines must not overwrite displays that are to
be kept,
and in
particular,
must
60
not destroy
portions
of
several displays.
One possible solution to
is
the development
of a
terminal contents.
the display contention problem
separate
be as variable as possible.
of terminal areas could be
area to
write its
default freeing
the user
the
display.
portion of the screen should
Some form of allocation/release
implemented.
call to the
Each routine could
control routine
There
of areas that
would have
contents that are
to control
Although it still seem desirable to keep
the text area fixed, the upper
make an allocation
routine
to assume
could be
are to be
to obtain an
some form
re-used. However,
responsibility for
to be retained. In this
freeing
manner, there is
no limit on the types of display combinations possible.
61
of
Download