top - download
⟦90892407a⟧ Wang Wps File
Length: 44035 (0xac03)
Types: Wang Wps File
Notes: PC/PDS/001 - ISSUE 2
Names: »6214A «
Derivation
└─⟦1ebdd46fc⟧ Bits:30006237 8" Wang WCS floppy, CR 0625A
└─ ⟦this⟧ »6214A «
WangText
…0e……0b……0e……02……0d……09……0d……0a……0d……0f……0d…
…0c……09……0c……02……0c……06……0b……0c……0b……00……0b…
…0b……86…1
…02…
…02…
…02…
…02…PC/PDS/001
…02…851001…02……02…
PROTOCOL
CONVERTER
PACKAGE
DESIGN
SPECIFICATION…02…ISSUE
1.2…02…
PC
4.2.7 M̲a̲i̲n̲t̲e̲n̲a̲n̲c̲e̲ ̲C̲o̲n̲t̲r̲o̲l̲l̲e̲r̲ ̲(̲M̲A̲C̲)̲
4.2.7.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲
MAC performs the following tasks:
a) Read a command line from the VDU and echo characters.
Check for 'attention/break' entered on the VDU.
b) Compare the command keyword to the known PC command
keywords. If the keyword is not recognized, classify
the command as 'unknown'. Check whether the keyword
is legal in the maintenance mode. If not, classify
the command as
'unacceptable'. Command keywords accepted by MAC
are: CHECK, DUMP, and INIT. Cf. Reference 17, p
64 for the complete command syntax.
c) Read the parameters of the command entered and store
them in a common parameter stack.
d) Perform the function requested including 'break',
syntax errors, or a legal command. 'Break' provokes
a mode prompt on the VDU. Errors in the command
line are indicated by typing:
'UNKNOWN COMMAND' or
'UNACCEPTABLE COMMAND' or
'PARAMETER ERROR'
Immediately following the error message, the system
will prompt for a new command.
Commands accepted by MAC are executed using procedure
calls, except for the INIT command. This command
copies all other PC programs from the EPROM into
RAM. MAC then loads the INIT program, which eventually
transfers the VDU control to the CI process.
HW tests and dump facilities performed by MAC are
described in sections 4.2.7.1.1 through 4.2.7.1.5.
Upon completion of commands CHECK and DUMP MAC presents
a result line to the operator:
(command keyword) EXECUTED, RESULT= (hex number)
If an error has occured, MAC sets the leftmost of
the four digits in the result code to 'D', which
is reserved for MAC error codes. The error is further
described in the two rightmost digits.
The possible errors are listed in section 4.2.7.3 declared
as enumerated constants of type
'mac ̲results'. A successfully completed command is
indicated by the result code #0000. A CHECK EPROM
or CHECK CPU command will furthermore cause the following
line to be printed on the VDU following the result
line:
'EPROM/SCM PROM CHECKSUM =' (checksum ̲acc)
The results are followed by a mode prompt for a new
command. When output by MAC, the prompt contains the
letter M.
4.2.7.1.1 C̲P̲U̲-̲S̲C̲M̲ ̲T̲e̲s̲t̲
The CPU-SCM test computes a checksum of the SCM prom
and displays the result.
If the result of the checksumming is OK, a selected
set of CPU instructions are executed from each of the
following instruction groups:
move instructions,
jump instructions,
arithmetic instructions,
shift instructions,
single bit instructions, or
input/output instructions
4.2.7.1.2 E̲P̲R̲O̲M̲ ̲T̲e̲s̲t̲
An EPROM checksum is generated assuring that the EPROM
is accessible, and that the contents of the EPROM is
unaltered. The EPROM checksum is compared to a prestored
value and displayed.
4.2.7.1.3 R̲A̲M̲ ̲T̲e̲s̲t̲
The RAM accessibility and addressing logic is tested
by reading and writing the address of all memory locations
into the locations themselves. The result is verified
by reading the address for each memory location. The
original RAM contents is restored. The RAM configuration
to be tested is described in an array of 64 entries.
Each entry specifies the address space of a 4k RAM
segment. Only memory segments specified in the array
will be tested.
This way, the SCM prom, the MAC program/process areas,
as well as unavailable memory are excluded from the
read/write test
4.2.7.1.4 L̲T̲U̲ ̲T̲e̲s̲t̲
The specified LTU is checked for accessibility by excercising
the LTU/CR80 shared RAM area. The test is performed
using CR80 I/O instructions activating the prommed
part of the LTU firmware.The LTU RAM PARITY flage is
checked. If set the code for parity error is returned.
4.2.7.1.5 D̲u̲m̲p̲
The DUMP command will dump the requested amount of
RAM or PROM within page boundaries. Message buffer
areas may be dumped as well. However, SGI clears these
buffers before loading MAC. The dump consist of lines
such as:
FE08: ABCD ABCD ABCD ABCD ABCD ABCD ABCD ABCD
where FE08 is the absolute address of the first word
dumped within the specified address, and ABCD is an
example of the contents of the following 8 memory locations.
Whenever a byte has an ASCII character counterpart
this character is written else a dot is output.
4.2.7.2 S̲o̲f̲t̲w̲a̲r̲e̲ ̲S̲t̲r̲u̲c̲t̲u̲r̲e̲
MAC is implemented as s CR80 process consisting of
a mainprogram calling the two procedures read ̲command
and perform ̲function until an INIT command is entered
or the power is switched off.
MAC software structure reflects the functional description
given in section 4.2.7.1.
Procedure analyze ̲command compares keywords entered.
Procedure read ̲parameters fetches parameters from the
input line.
Check and dump procedures are described in sections
4.2.7.1.1 through 4.2.7.1.5.
FIGURE 4.2.7.2-1
MAC SOFTWARE
4.2.7.3 P̲a̲c̲k̲a̲g̲e̲ ̲D̲a̲t̲a̲
CONST
local ̲mode = 76; "ASCII L
maintenance ̲mode = 77; "ASCII M
operational ̲mode = 79; "ASCII O
test ̲mode = 84; "ASCII T
left ̲par = 91; "for prompt
right ̲par = 93;
name ̲size = 18; "keyword size
max ̲mac ̲events =MAX(mac ̲functions);
mac ̲result ̲base =#D000;
"vdu parameters
null = 0; "ASCII NULL
bel = 7;
bs = 8;
lf = 10;
cr = 13;
esc = 27;
del = 127;
line ̲limit = 80;
"SCM parameters
vdu ̲address = 1;
input ̲ready = 1; "status bit no
output ̲ready = 0; "status bit no
get ̲status = #0101;
get ̲command ̲reg = #0301;
clear ̲break = 4;
break ̲done = 5;
ltua ̲address = 17;
ltub ̲address = 16;
init ̲process ̲abs ̲ptr= #400;
eprom ̲checksum =#0000;
eprom ̲start ̲addr = 0; "copy eprom during INIT
eprom ̲stop ̲addr =#F7FF; "copy until stop address
ram ̲prog ̲start ̲addr = 0; "copy to start addr
TYPE
name ̲block =
RECORD
name: ARRAY(0..name ̲size) OF CHAR;
identifier: mac ̲functions;
legal ̲mode 1,
legal ̲mode 2: integer; "legal modes
END;
mac ̲functions =( "constants for MAC
escape, "attention, break,
legal
unknown, "unknown keyword
unacceptable, "OK, but mode not M
param ̲error, "error in parameters
maintenance, "result line MAC start
logon,
logoff,
show ̲stat,
reset ̲stat,
test,
verify,
check,
dump,
init ̲system);
ascii ̲group = ( "char. classification
back ̲space,
line ̲feed,
delete ̲line,
escape,
carriage ̲return,
normal ̲char)
results = (ok, not ̲ok) "locally used results
module ̲names = ( "used as HW test id
cpu,
eprom,
ram,
ltua,
ltub);
user ̲input =
RECORD
command : mac ̲functions;
hw ̲module : hw ̲modules; "CPU,EPROM,RAM,
"LTUA,LTUB
dump ̲page,
start ̲addr,
stop ̲addr,
bit ̲pattern,
vdu ̲speed : integer;
END;
ram ̲config: ARRAY (0..63) OF boolean; "true if tested
mac ̲results = ( "constants displayed IOR #D000
ok,
illegal ̲name, "wrong param
illegal ̲mac ̲function,
scm ̲error,
cpu ̲error,
eprom ̲not ̲responding,
eprom ̲checksum,
ram ̲not ̲responding,
ram ̲addressing ̲error,
ltu ̲ram ̲compare,
ltu ̲ram ̲timeout,
eprom ̲ram ̲copy);
VAR
user ̲buffer: ARRAY (0..line ̲limit) OF CHAR;
char ̲group: ascii ̲group;
mode ̲line, unknown ̲line ̲unacceptable ̲line,
param ̲error ̲line, bs ̲line, lf ̲line, new ̲line, del
̲line, break ̲line, in ̲buffer, out ̲buffer:
ARRAY(0..line ̲limit) OF CHAR;
out ̲char ̲ptr, out ̲char ̲count, in ̲buffer ̲ptr,
in ̲char ̲ptr, in ̲char ̲count:
integer;
command ̲names: ARRAY(0..max ̲mac ̲events) OF name ̲block;
user ̲input ̲params: user ̲input; "record for input
"parameters
mac ̲result: mac ̲results;
ram ̲config: ARRAY (0..63) OF boolean;
checksum ̲acc: LONG;"eprom checksum accm.
module ̲name: module ̲names; "cpu, prom
INIT
bs ̲line = bs, null;
lf ̲line = lf, null;
new ̲line = lf, cr, null;
del ̲line = bel, lf, cr, null;
break ̲line = …08…*break*…08…, bel, cr, null;
mode ̲line = cr, lf, left ̲par, …08…M…08…, right ̲par, null;
unknown ̲line = cr, lf, UNKNOWN COMMAND, cr, lf, null;
unacceptable ̲line = cr, lf, …08…UNACCEPTABLE COMMAND…08…,
cr, lf, null;
param ̲error ̲line = cr, lf, …08…PARAMETER ERROR…08…, cr, lf,
null;
command ̲names( 0) = …08…MAINTENANCE, (:0:)…08…, null,
maintenance, local ̲mode, local ̲mode;
command ̲names( 1) = …08…M …08…, null,
maintenance, local ̲mode, local ̲mode;
command ̲names( 2) = …08…LOGON, (:0:) …08…, null,
logon, local ̲mode, local ̲mode;
command ̲names( 3) = …08…LOGOFF, (:0:) …08…, null,
logoff, operational ̲mode, test ̲mode;
command ̲names( 4) = …08…SHOW STATISTICS,(:0:), null,
show ̲stat, operational ̲mode, test ̲mode;
command ̲names( 5) = …08…S …08…, null,
show ̲stat, operational ̲mode, test ̲mode;
command ̲names( 6) = …08…RESET STATISTICS,(:0:)…08…,null,
reset ̲stat, operational ̲mode, test ̲mode;
command ̲names( 7) = …08…R …08…, null,
reset ̲stat, operational ̲mode, test ̲mode;
command ̲names( 8) = …08…TEST,(:0:) …08…, null,
test, operational ̲mode, operational ̲mode;
command ̲names( 9) = …08…T …08…, null,
test, operational ̲mode, operational ̲mode;
command ̲names(10) = …08…VERIFY,(:0:) …08…, null,
verify, test ̲mode, test ̲mode;
command ̲names(11) = …08…V …08…, null,
verify, test ̲mode, test ̲mode;
command ̲names(12) = …08…SIMULATE,(:0:) …08…, null,
simulate, local ̲mode, local ̲mode;
command ̲names(13) = …08…S …08…, null,
simulate, local ̲mode, local ̲mode;
command ̲names(14) = …08…CHECK,(:0:) …08…, null,
check, maintenance ̲mode, maintenance ̲mode;
command ̲names(15) = …08…C …08…, null,
check, maintenance ̲mode, maintenance ̲mode;
command ̲names(16) = …08…DUMP,(:0:) …08…, null,
dump, maintenance ̲mode, maintenance ̲mode;
command ̲names(17) = …08…D …08…, null,
dump, maintenance ̲mode, maintenance ̲mode;
command ̲names(18) = …08…INIT,(:0:) …08…, null,
init ̲system, maintenance ̲mode, maintenance
̲mode;
command ̲names(19) = …08…I …08…, null,
init ̲system, maintenance ̲mode, maintenance
̲mode;
4.2.7.4 P̲a̲c̲k̲a̲g̲e̲ ̲D̲e̲s̲i̲g̲n̲
4.2.7.4.1 M̲A̲C̲ ̲M̲a̲i̲n̲p̲r̲o̲g̲r̲a̲m̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
init ̲mac:
disable interrupts
write ̲result ̲vdu(mac ̲function:= maintenance,
mac
̲result:=
ok)(); user
̲input
̲params.hw
̲module:=
eprom;
perform ̲function(mac ̲function:= check)();"Check full
"package
checksum
write ̲line ̲vdu(ADDRESS(mode ̲line))(); "prompt
WHILE A=A DO
BEGIN "endless loop
read ̲command()(mac ̲function);
perform ̲function(mac ̲function)();
END; "while a=a
4.2.7.4.2 R̲e̲a̲d̲ ̲C̲o̲m̲m̲a̲n̲d̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE read ̲command
() "no input
(mac ̲function: mac ̲functions)
input :
none
output :
constants identifying the command entered,
this identifier may indicate an illegal command,
a syntax error, an illegal parameter, or that …08…break…08…
has been entered on the VDU.
function:
read a command from the VDU
procedures called:
analyze ̲command "for recognizing keywords
read ̲char ̲vdu "for fetching characters
write ̲line ̲vdu "echo characters
write ̲char ̲vdu "echo a single character
external data:
user ̲buffer, in ̲char ̲count: integer;
character: char; "character last read
BEGIN "procedure read ̲command
initialize user ̲buffer to null…08…s
in ̲char ̲count:= 0;
char ̲group:= normal ̲char; "start while loop
WHILE char ̲group NE carriage ̲return LOGAND
char ̲group NE escape DO
BEGIN "read charaters into in ̲buffer
IF in ̲char ̲count LT line ̲limit THEN "if too long,
cr
read ̲char ̲vdu()(character)
ELSE
character:= cr; "terminate too long lines
char ̲group:= "classify the character read or set
back ̲space or
line ̲feed or
delete ̲line or
escape or "escape used for indicating break
carriage ̲return or
normal ̲char;
CASE char ̲group OF
back ̲space:
BEGIN
IF in ̲char ̲count GT 0 THEN
BEGI̲N̲
user ̲buffer(in ̲char ̲count):= null;
in ̲char ̲count:= in ̲char ̲count-1;
write ̲line ̲vdu(ADDRESS(bs ̲line))(); "echo bs
END;
END;
line ̲feed:
write ̲line ̲vdu(ADDRESS(lf ̲line))(); "echo lf
delete ̲line:
BEGIN
clear user ̲buffer
in ̲char ̲count:= 0;
user ̲buffer(in ̲char ̲count):= del;
write ̲line ̲vdu(ADDRESS(del ̲line))();
END;
escape:
BEGIN "service break on SCM module
clear break on SCM
clear user ̲buffer;
in ̲char ̲count:= 0;
user ̲buffer(in ̲char ̲count):= esc; "escape character
write ̲line ̲vdu(ADDRESS(break ̲line))();
END;
carriage ̲return:
write ̲line ̲vdu(ADDRESS(new ̲line))();"cr and lf
normal ̲char:
BEGIN "insert character in array in ̲buffer
in ̲char ̲count:= in ̲char ̲count+1;
user ̲buffer(in ̲char ̲count):= character;
write ̲char ̲vdu(character)(); "echo char
END;
OTHERWISE ; "ignore character
END; "while NOT cr and NOT escape(break)
"classify command as escape, unknown, unacceptable,
"parameter ̲error, or a legal command using procedure
"analyze ̲command
analyze ̲command(ADDRESS(user ̲buffer), system ̲mode:=
maintenance ̲mode)(mac ̲function);
END; "procedure read ̲command
4.2.7.4.3 R̲e̲a̲d̲ ̲C̲h̲a̲r̲ ̲V̲D̲U̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE read ̲char ̲vdu
() "no input
(character: char) "character read
input :
none
output :
character read on VDU
function:
check break on SCM - if set, then clear break and
set character to esc else sense status until input
character is ready, and read the character from the
SCM module.
procedures called:
none
external data:
constants for SCM commands,
character: char;
local data:
none
BEGIN "procedure read ̲char ̲vdu
"pseudo code
END; "procedure read ̲char ̲vdu
4.2.7.4.4 W̲r̲i̲t̲e̲ ̲C̲h̲a̲r̲ ̲V̲D̲U̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE write ̲char ̲vdu
(character: char)
() "no output
input:
character to be written
output:
none
function:
clear break on SCM module, sense SCM until ready
for output, then write the character to the VDU.
procedures called:
none
external data:
constants for SCM commands,
character: char;
local data:
none
BEGIN "procedure write ̲char ̲vdu
"pseudo code
END; "procedure write ̲char ̲vdu
4.2.7.4.5 W̲r̲i̲t̲e̲ ̲L̲i̲n̲e̲ ̲V̲D̲U̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE write ̲line ̲vdu
(ptr: integer) "pointer to buffer
"terminated by null
() "no output
input :
address of buffer to be written
output :
none
function:
type the characters in the buffer addressed by the
input parammeter until a null character is met
procedures called:
write ̲char ̲vdu
external data:
buffer containing output data,
out ̲char ̲count: index in array to be output
local data:
none
BEGIN "procedure write ̲line ̲vdu
out ̲char ̲count:= 0;
"assume the output array to be output ̲buffer
character:= output ̲buffer(out ̲char ̲count);
WHILE character NE null LOGAND
out ̲char ̲count LT line ̲limit DO
BEGIN "write characters
write ̲char ̲vdu(character)();
out ̲char ̲count:= out ̲char ̲count+1;
character:= output ̲buffer(out ̲char ̲count);
END; "while legal char and count is ok
END; "procedure write ̲line ̲vdu
4.2.7.4.6 A̲n̲a̲l̲y̲z̲e̲ ̲C̲o̲m̲m̲a̲n̲d̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE analyze ̲command
(ptr, "address of user ̲buffer
system ̲mode) "maintenance ̲mode
(mac ̲function)
input :
address of line read holding a command or an escape
character.
output :
constant of type mac ̲functions
function:
check for escape char in position 0 of array,
compare the keyword(s) with the members of array
command ̲names. If the keyword is wrong, set
mac ̲function to unknown. If mode is wrong, mac ̲function:=
unacceptable. Read the pertinent parameters, if not
ok, mac ̲function:= param ̲error.
procedures called:
read ̲parameters
external data:
array command ̲names, "list of keywords
user ̲input ̲params, "input stack
user ̲buffer "input line from VDU
local data:
index in array commnad ̲names
mode1, mode2, "legal modes of keyword
in ̲char ̲count: integer; "current position in
"user ̲buffer
BEGIN "procedure analyze ̲command
mac ̲function:= unknown;
set user ̲input ̲params to defaults
IF user ̲buffer(0)=esc THEN "escape flags …08…break…08…
mac ̲function:= escape;
ELSE
BEGIN "normal command
compare keywords to elements of array command ̲names,
set index pointing at element in command names
and result
IF result=not ̲ok THEN "keyword not found
mac ̲function:= unknown
ELSE
BEGIN "keyword(s) recognized, index & in ̲char ̲count
"have been updated
mac ̲function:= command ̲names(index).identifier;
mode1:= command ̲names(index).legal ̲mode1;
mode2:= command ̲names(index).legal ̲mode2;
IF mode1 NE maintenance ̲mode LOGAND
mode2 NE maintenance ̲mode THEN
mac ̲function:= unacceptable
ELSE
BEGIN "keyword and mode ok, now fetch parameters
read ̲parameters(mac ̲function,
in ̲char ̲count)(result);
IF result NE ok THEN
MAC ̲function:= param ̲error;
END; "fetch parameters
END; "legal keywords
END; "in ̲buffer was not escape
END; "procedure analyze command
4.2.7.4.7 R̲e̲a̲d̲ ̲P̲a̲r̲a̲m̲e̲t̲e̲r̲s̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE read ̲parameters
(mac ̲function: mac ̲functions,
in ̲char ̲count: integer)
(result: results)
input :
mac ̲function "function identifier
index in in ̲buffer pointing at characters following
the keyword(s)
output:
result = ok or not ̲ok
function:
read the parameters pertinent to the mac ̲function
and store them in the record user ̲input ̲params.
procedures called:
TBD
external data:
user ̲input ̲params "input parameter stack
user ̲buffer "input line
in ̲char ̲count "current index in in ̲buffer
local data:
TBD
BEGIN "procedure read ̲parameters
result:= ok;
CASE mac ̲function OF
check: read check parameters; "CPU, RAM, etc
dump: read and normalize dump parameters; "page,
start
"only dumps within the page are allowed
"start ̲addr therefore LT stop ̲addr
init ̲system: ; "no paramters, no action
OTHERWISE result:= not ̲ok;
END; "procedure read parameters
4.2.7.4.8 P̲e̲r̲f̲o̲r̲m̲ ̲F̲u̲n̲c̲t̲i̲o̲n̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE perform ̲function
(mac ̲function: mac ̲functions)
() "no output
input :
mac ̲function containing the value escape, unknown,
unacceptable, param ̲error, check, dump, or init ̲system.
output :
none
function:
perform the function requested. This may be either
an escape (…08…attention/break…08… indicator), an error message
in response to an illegal command, or a CHECK, DUMP,
or INIT command. When a legal command has been executed,
a result line is output. All events are followed
by a prompt for a new command.
external data:
system ̲mode: integer; "fixed value ASCII M
user ̲input ̲params: user ̲input; "record containing
"input
local data:
module ̲name: module ̲names; "HW module id
BEGIN "procedure perform ̲function
IF mac ̲function = unknown LOGOR
mac ̲function = unacceptable LOGOR
mac ̲function = param ̲error THEN
BEGIN "write error line
CASE mac ̲function OF
unknown: write ̲line ̲vdu(ADDRESS(unknown ̲line))();
unacceptable: write ̲line ̲vdu(ADDRESS
(unacceptable ̲line))();
param ̲error: write ̲line ̲vdu(ADDRESS
(param ̲error ̲line))();
END; "write syntax error messages
ELSE
BEGIN "no syntax error
CASE mac ̲function OF
escape: ; "no action
check:
BEGIN
module ̲name: =
user ̲input ̲params.hw ̲module;
CASE module ̲name OF
cpu: check ̲cpu() (mac ̲result);
eprom: check ̲eprom() (mac ̲result);
ram: check ̲ram() (mac ̲result);
ltua,
ltub: check ̲ltu (ADDRESS (user ̲input ̲params))
(mac ̲result);
OTHERWISE mac ̲result: = illegal ̲name;
END;
dump: dump ̲ram (ADDRESS (user ̲input ̲params))
(mac ̲result)
init:
BEGIN "service init
"EPROM Checksumming is performed as main
"program start up
"cf.PC SRS section 3.4.3 and 3.4.6 f)
BEGIN "copy EPROM to RAM and load SGI
copy eprom between eprom ̲start ̲addr and
eprom ̲stop ̲addr to ram starting at ram address
ram ̲prog ̲start ̲addr
IF local time out THEN
mac ̲result:= eprom ̲ram ̲copy
ELSE
LDP(init ̲process ̲abs ̲ptr); "load SGI process
END; "copy eprom and load SGI
END; "init servicing
OTHERWISE mac ̲result: = illegal ̲mac ̲function;
IF mac ̲function NE escape THEN
write ̲result ̲vdu (mac ̲function, mac ̲result) ();
END; "no syntax error
write ̲line ̲vdu (ADDRESS (mode ̲line)) ();
"prompt for new command
END; "procedure perform function
4.2.7.4.9 C̲h̲e̲c̲k̲ ̲C̲P̲U̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE check ̲cpu
() "no input
(mac ̲result: mac ̲results)
input :
none
output :
mac ̲result: hexadecimal integer written on the VDU
as a part of the result line.
function:
enable local interrupts to check SCM prom accessibility,
generate a checksum of the CPU-SCM prom and display
the 32 bit checksum on the VDU. Perform a similar
checksumming on the 2K RAM on the CPU-SCM board to
verify accessibility.
If the result is OK, execute a subset of CR80 instructions
from each of the following main groups:
move instructions
jump instructions
arithmetic instructions
shift instructions
single bit instructions
input/output instructions
Update the output variable
procedures called:
double word memory checksumming procedure
external data:
result codes "mac ̲results
local data:
SCM RAM start address = #F000
BEGIN "procedure check ̲cpu
"pseudo code
END; " procedure check ̲cpu
4.2.7.4.10 C̲h̲e̲c̲k̲ ̲E̲P̲R̲O̲M̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE check ̲eprom
() "
(mac ̲result: mac ̲results)
input :
none
output :
mac ̲result: hexadecimal
integer written on the VDU
as a part of the result line
function:
enable local interrupts to check whether the EPROM
is accessible
calculate a checksum of the EPROM module and
compare the result to the value eprom ̲checksum ̲least
display the 32 bit accumulator on the VDU.
procedures called:
none
external data:
eprom ̲checksum, "reference value
result codes "constants of type mac ̲results
checksum ̲acc: LONG; "checksum accumulator
local data:
none
BEGIN "procedure check eprom
"pseudo code
END; "procedure check eprom
4.2.7.4.11 C̲h̲e̲c̲k̲ ̲R̲A̲M̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE check ̲ram
()
(mac ̲result: mac ̲results)
input :
none
output :
mac ̲results: hexadecimal integer
written on the VDU as a part of
the result line
function:
enable local interrupts to check RAM accessibility.
Check the addressing logic by storing the address
itself in RAM outside MAC program and process areas.Read
and compare. Retest each location using the test
pattern #A5A5. Restore the original contents.
The RAM is tested in blocks of 4k words as indicated
by 64 entries in the array ram ̲config. If an entry
is true, the 4k segment is tested. PROM and non-existing
RAM are masked out.
procedures called:
none
external data:
ram ̲config "array of booleans with 64 entries, one
"for each 4k segment in up to 256k memory
result codes "indicates the type of error, if any
local data:
current ̲page "the memory section under test
current ̲segment "4k segment in page
current ̲address "absolute location
segment ̲count "address counter within a 4k segment
label access ̲error
address ̲error
BEGIN "procedure check ̲ram
interrupt address:= LOCATION (access ̲error)
current ̲segment:= 0;
WHILE current segment LT 64 DO
BEGIN "check presence
IF ram ̲config. (current ̲segment) = true THEN
BEGIN "test segment
segment count:= 0;
REPEAT
compute page and absolute
address of segment start
read contents of current address
store address in current address
read contents of current address
IF contents of address NE current ̲address THEN
BEGIN
store original contents in current address
mac ̲result:= ram ̲addressing ̲error;
GOTO address ̲error
END;
STORE #A5A5 in current address read and compare
IF not ok THEN
BEGIN "test pattern compare error
mac ̲result:= ram ̲access ̲error;
GO TO address ̲error
END; "test pattern compare error
store original contents in current address
segment ̲count: = segment ̲count + 1;
UNTIL segment ̲count = #1000;
END; "test segment
current ̲segment: = current ̲segment + 1;
END; "while current ̲segment LT 64
mac ̲result:= ok;
IF current ̲segment LT 64 THEN
BEGIN "dummy block
access ̲error:
mac ̲result:= ram ̲not ̲responding;
address ̲error: ; "no ̲action
END;
restore program/process context
END; "procedure check ̲ram
4.2.7.4.12 C̲h̲e̲c̲k̲ ̲L̲T̲U̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE check ̲ltu
(ptr: integer) "pointer to user ̲input ̲params
(mac ̲result: mac ̲results)
input :
user ̲input ̲params indicating LTUA or LTUB to be tested.
output :
mac ̲result: hexadecimal integer written on the VDU
as a part of the result line
function:
check for the presence of the specified LTU.
Exercise the LTU/CR80 shared RAM. Start by writing
the following commands to the LTU:
- enable LTU, clear
- load address counter
Write/read/compare all memory locations of the shared
RAM using the current test pattern #A55A and then
address itself as data.
procedures called:
read ̲ltu(data ̲item, address ̲cmd ̲code)
write ̲ltu(data ̲item, address ̲cmd ̲code)
These "procedures" are implemented as CR80 I/O instructions,
WIO, RIO.
external data:
user ̲input ̲params: user ̲input, "record with input
params.
"indicates LTUA or
LTUB
local data:
ltu ̲address: integer; "ltua ̲address or ltub ̲address
enable ̲clear ̲ltu = #A00; "const. for clear command
load ̲byte ̲pointer = #C0; "const. for load pointer
in LTU
write ̲word ̲cmd = #200; "const.: write word & update
ptr
read ̲word ̲cmd = #100; "const.: read word & update
ptr
test ̲item, data ̲item: integer; "address and contents
BEGIN "procedure check ̲ltu
IF user ̲input ̲params.module ̲name = ltua THEN
ltu ̲address:= ltua ̲address "#11 = SCAMPS I/O address
ELSE
ltu ̲address:= ltub ̲address; "#10 = CCIS I/O address
enable local interrupt for trapping time ̲out intrpt's
mac ̲result:= ok; "initiate result code
write ̲ltu(0, enable ̲clear ̲ltu+ltu ̲address); "clear
ltu
write ̲ltu(0,load ̲byte ̲pointer+ltu ̲address);
data ̲item:= 0;
WHILE data ̲item LT #4000 DO
BEGIN
write ̲ltu(#A55A, write ̲word ̲cmd+ltu ̲address);
write ̲ltu(data ̲item,load ̲byte ̲pointer+ltu ̲address);
read ̲ltu(test ̲item,read ̲word ̲cmd+ltu ̲address);
IF test ̲item NE #A55A THEN
BEGIN "set result and terminate test
mac ̲result:= ltu ̲ram ̲compare;
data ̲item:=#4000;
END; "set result and terminate test
write ̲ltu(data ̲item, write ̲word ̲cmd+ltu ̲address);
write ̲ltu(data ̲item, load ̲byte ̲pointer+ltu ̲address);
"adjust ptr. backwards
read ̲ltu(test ̲item, read ̲word ̲cmd+ltu ̲address);
IF test ̲item NE data ̲item THEN
BEGIN "set result and terminate test
mac ̲result:= ltu ̲addressing ̲error;
data ̲item:= #4000;
END "error
ELSE
data ̲item:= data ̲item+1;
END; "while test loop
IF data ̲item NE #4000 THEN
BEGIN "block only entered in case of interrupt
local ̲interrupt:
mac ̲result:= ltu ̲ram ̲time ̲out; "set error code
disable local interrupts
END;
END; "procedure check ̲ltu
4.2.7.4.13 D̲u̲m̲p̲ ̲R̲A̲M̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE dump ̲ram
(ptr: integer) "address of parameter stack
(mac ̲result: mac ̲results) "result
input :
user ̲input ̲params containing current ̲page, start
̲addr, and stop ̲addr computed from the user input
string
output :
mac ̲result which may be used for indicating a bad
result in case of a non-responding RAM
function:
check the presence of the RAM locations by trapping
local interrupts. Write the absolute address of the
first word word to be output in each line. Write
': '.
Write the hexadecimal contents of the following 8
words in memory and their ASCII representation or
'.'. Check for the occurence of 'atttention/break'
and repeat until the desired amount of memory has
been dumped.
procedures called:
write ̲line ̲vdu
write ̲hex ̲vdu "writes a hexadecimal number on the
VDU
external data:
user ̲input"̲params "input parameters
local data:
save ̲psw, "for saving program status word temporarily
dump ̲page, "page 0, 1, 2, or 3
current ̲addr, "absolute address in page
stop ̲addr, "last address to be dumped
line ̲count, "word no in line, 1 through 8
dump ̲word: integer; "current hex word to be dumped
BEGIN "procedure dump ̲ram
enable local interrupt "trap a non responding RAM
"location
current ̲addr:= user ̲input ̲params.start ̲addr;
dump ̲page:= user ̲input ̲params. dump ̲page;
stop ̲addr:= user ̲input ̲params.stop ̲addr;
WHILE current ̲addr LE stop ̲addr DO
BEGIN "at least one word
line ̲count:= 0;
write ̲hex ̲vdu(current ̲addr)(); "write line number
write ̲line ̲vdu(ADDRESS(': ', null))(); "space before
"output
REPEAT
fetch word in memory "addressed by page & cur.
addr
store word in variable dump ̲word
write ̲hex ̲vdu(dump ̲word)();
write ̲char ̲vdu((: :))(); "space
line ̲count:= line ̲count+1;
current ̲address:= current ̲address+1;
UNTIL current ̲addr=stop ̲addr LOGOR
line ̲count=8;
write ̲line ̲vdu(ADDRESS(new ̲line))()
check break on SCM "check break for some time
IF break is set THEN current ̲addr:=stop ̲addr+1;
END; "while current ̲addr LE stop ̲addr
mac ̲result:= ok;
IF 0=1 THEN
BEGIN "only entered when interrupt
time ̲out: mac ̲result:= ram ̲not ̲responding;
END; "interrupt block
disable local interrupts
END; "procedure dump ̲ram
4.2.7.4.14 W̲r̲i̲t̲e̲ ̲R̲e̲s̲u̲l̲t̲ ̲V̲D̲U̲ ̲P̲s̲e̲u̲d̲o̲ ̲C̲o̲d̲e̲
PROCEDURE write ̲result ̲vdu
(mac ̲function: mac ̲functions,
mac ̲result: mac ̲results)
() "no output
input :
mac ̲function: constant identifying a command entered
or an abnormal situation
mac ̲result: hexadecimal integer containing result
output :
none
function:
look up the text string corresponding to the
mac ̲function. The string is a command keyword or
an error message. In both cases the text is fetched
from the array 'command ̲names'.
Type the following on a new line:
(17 char text string) EXECUTED, RESULT= (mac ̲result)
Variables module ̲name and checksum ̲acc are declared
in section 4.2.7.3, MAC Package Data. 'checksum ̲acc'
is of type LONG.
procedures called:
write ̲line ̲vdu
write ̲hex ̲vdu
external data:
array 'command ̲names' containing keywords
local data:
TBD
BEGIN "procedure write ̲result ̲vdu
"pseudo code
END; "procedure write ̲result ̲vdu
4.2.7.5 P̲a̲c̲k̲a̲g̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲s̲
MAC loads the application processes by means of the
CR80 load process instruction. The AMOS INIT process
base must reside as indicated by the MAC constant
'init ̲process ̲abs ̲ptr'.
4.2.8 S̲y̲s̲t̲e̲m̲ ̲G̲e̲n̲e̲r̲a̲t̲o̲r̲ ̲a̲n̲d̲ ̲I̲n̲i̲t̲i̲a̲l̲i̲z̲e̲r̲ ̲(̲S̲G̲I̲)̲
SGI is the basic software for loading the PC Maintenance
and Application Processes.
SCI is invoked upon one of the following events:
- Manual Master Clear or Power Up
- Programmed Master Clear (LOCAL Mode MAINTENANCE
Command)
- Emergency Action
SCI is implemented in the 2K 2716 EPROM on the PC CPU-SCM
Board.
4.2.8.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲
SGI is loaded by H/W as a process with base #FFE0.
The MAIN part of SGI will perform the following tasks:
- The SIO Circuit on the CPU-SCM is set to run at
4800 baud.
- The total 2K S/W in the EPROM is copied from #F800
to RAM address #D800 in page 0.
- The BOOTLOAD part is started as an independent
process with base #D800.
- If loaded via the emergency entry (CPU emergency
action), the text string '**EMERGENCY: AAAA/BBBB'
is output. AAAA is the bae of the process causing
emergency, and BBBB is the emergency cause code.
Cause codes are:
1 = illegal instruction,
2 = parity error,
3 = time out in memory or IO devices access.
The BOOTLOAD Process takes over and performs the following
initialization tasks:
- RAM Parity is set in page 0, address 0 thru #D800
and in page 1, address 0 thru #FFF, Above #8000
in page 1 parity setting is accomplished by clearing
the area #800 to #FFFF.
This will ensure the buffer clearing requirement
to be fulfilled also in case of a manual master
clear or system crash before the MAC DUMP facility
can be used.
- When the RAM has been initialized, MAC software
is copied from EPROM page 2, address #E000 to #F7FF
to RAM page 0, address #E000 to #F7FF.
- If the MAC can be copied without errors SGI will
hand over control to MAC by loading the MAC Process
at base #E000.
- In case of H/W errors one of the following text
strings is written on the VDU:
** ERROR DURING EPROM BOOTLOAD
** PRESETTING RAM PARITY
** UNEXPECTED CAUSE CODE IN PARITY SETTING
ROUTINE
** BUFFER CLEARING ERROR, PAGE = 1
If any of the errros are met, the system buffers
from a fatal H/W error which may even inhibit the
use and MAC diagnostics programs.
4.2.8.2 S̲o̲f̲t̲w̲a̲r̲e̲ ̲S̲t̲r̲u̲c̲t̲u̲r̲e̲
̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲
EMERGENCY ACTION
COPY FROM SCM PROM TO RAM MAIN PROCESS
MAIN PROGRAM
̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲
̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲
WRITE STRING
READ EIGHT
WRITE EIGHT
BOOTLOAD PROCESS
INIT RAM
LOAD MAC
MAIN PROGRAM
̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲ ̲
FIGURE 4.2.8.2-1
SGI SOFTWARE
4.2.8.3 P̲a̲c̲k̲a̲g̲e̲ ̲D̲a̲t̲a̲
CONST
"bit mask for disabling psw
bm ̲disable ̲psw = #E000;
"scm sio register addressing
read ̲receive ̲register = #0001;"9:2 =00, cf
"CSD/005/PSP/0049,
p.110.
write ̲transmit ̲register = #0001;
read ̲status ̲register = "#0101; " 9:2 =01
read ̲mode ̲register = #0201; " 9:2 =10, read
" sequentially MR1, MR2
write ̲mode ̲register = #0201; "write sequentially
MR1, MR2
read ̲command ̲register = #0301; "read command register
write ̲command ̲register = #0301; "write command register
"constants identifying bits in the scm status register
(SR)
bn ̲transmitter ̲empty = 0; "SR. 0:1 = 1 when data
set
bn ̲receiver ̲full = 1; "SR. 1:1 = 1 when data received
…0c……0c… bn ̲break ̲set = 3; "SR. 3:1 when break is indicated
bn ̲overrun ̲error = 4; "overrun in receive sequence
bn ̲framing ̲error = 5; "character framing error
bn ̲terminal ̲ready = 7; "terminal is present
"bit masks to be written into the command register
bm ̲normal ̲operation = #0027;
bm ̲reset ̲error = #0037; "reset all flags including
"SR3, break
bm ̲disable ̲rx ̲tx = #0032; "disable receive/transmit?
bm ̲reset ̲clear ̲to ̲send = #0017; "stop input from
"terminal until ready
"bit masks to be written into the mode register
bm ̲mode ̲register1 = #007B; "MR1. 7:2 = 01 (async)
"MR1. 5:1 = 1 (even parity)
"MR1. 4:1 = 1(enabled
parity
"checks)
"MR1. 3:2 = 10 (7 bit
"characters)
"MR1. 1:2 = 11 (async)
bm ̲mode ̲register2 = #0035; "MR2. 5:6 sets the baudrate:
"#35 (300 baud), #36(600
baud)
"#37 (1200), #38(2400
baud)
"#3A (2400), #3C(4800
baud)
"#3E (9600)
prog ̲base = #FEB0; "absoluate address of progheader
start
prpc ̲offset = #20; "prog+offset=emergency action abs.
program counter
mprog ̲offset = #BC; "prog ̲base relative value of program
counter
"mobile application part of SGI:
mac ̲context ̲load ̲address = #E000; "start mac by loading
this process
eprom ̲page = 2;
boot ̲page = 0; "copy eprom mac area to page
0
mac ̲first = #E000;
mac ̲last = #F7FF; "last address allowed for mac
in page 0
TYPE
process ̲bodies =
record
regs : registers; "located
at
#FFE0
base, "#FFE8
modify,
prog,
prpc,
timer,
psw,
process ̲link,
local ̲action,
local ̲return
Local ̲cause,
device,
timer ̲preset,
monitor ̲link,
timer ̲link : integer;
text : ARRAY(0..15) of char;"contains
**emergency:
emergency ̲prog: ARRAY(0..1) of integer;
"#FFFE, #FFE0
end;
VAR
PROCESS ̲BODY : PROCESS ̲BODIES; "process context
starting at FFE0
INIT
process ̲body.regs(0) = prog ̲base+prpc ̲offset;
process ̲body.base = #FFE0;
process ̲body.modify = #FFE0;
process ̲body.prog = prog ̲base;
process ̲body.prpc = prog ̲base+mprog
̲offset;
process ̲body.psw = #E000;
process ̲body.local ̲action = prpc ̲offset;"emergency
program entry
process ̲body.local ̲return = prpc ̲offset;
process ̲body.local ̲cause = 0;
process ̲body.device = 1;
process ̲body.timer ̲preset = #0FFF;
process ̲body.monitor ̲link = 0;
process ̲body.timer ̲link = 0;
process ̲body.text = …08…(:10)(:13)**EMERGENCY:…08…(:0:)…08…;
process ̲body.emergency ̲prog(0) = prog ̲base+prpc
̲offset;
process ̲body.emergency ̲prog(1) = prog ̲base+prpc
̲offset;
4.2.8.4 P̲a̲c̲k̲a̲g̲e̲ ̲D̲e̲s̲i̲g̲n̲
a) PROCEDURE emergency ̲action
() "input
() "output
input :
none
output :
none
function :
Reinitialize the SIO circuit to the VDU to
4800 baud. Fetch the base of the proces causing
the emergency and the emergency cause code.
Write …08…**EMERGENCY: base/cause…08… with hexadecimal
numbers for …08…base…08… and …08…cause…08…. Activate the copy
procedures by entering MAIN thru the ordinary
entry point, load process #FFE0.
procedures called:
none
external data:
base and cause code of process still running
local data:
SCM SIO command constants for setting the baud
rate
BEGIN
"pseudo code
END;
b) PROCEDURE copy ̲from scm ̲prom ̲to ̲ram
() "input
() "output
input :
none
output :
none
function :
copy page 0, #F800 to #FFFF to page 0, #D800
to #DFFF.
procedures called :
none
external data
2K programs in the CPU-SCM PROM.
local data:
none
BEGIN
"pseudo code
END;
c) PROCEDURE write ̲string
(ptr to text string to be written, null) "input
() "output
input :
character string terminated by the null character
output :
none
function :
write the text string when the VDU is present
and ready
procedures called :
none
external data
none
local data :
none
BEGIN
"pseudo code
END;
d) PROCEDURE read ̲eight
(absolute address of first word: integer,
memory page (0 or 1) "input
() "output switch exit adjust link after
not ̲ok, ok
input :
absolute addres, page
output :
none
function :
read the 8 words specified to see if they contain
a parity error
procedures called :
none
external data
none
local data:
none
BEGIN
"pseudo code
END;
e) PROCEDURE write ̲eight
(absolute addres: integer,
memory page: integer)
() "output
input :
absolute address of first word, and the memory
page
output :
none
function :
clear the word specified and the following
7 words.
procedures called :
none
external data :
none
local data :
none
BEGIN
"pseudo code
END;
f) PROCEDURE init ̲ram
() "input
() "output
input :
none
output :
none
function :
read eight words, if ok read the next eight
words else clear the eight locations just read
procedures called :
read ̲eight
write ̲eight
external data
none
local data :
none
BEGIN
page:= 0;
address:= 0;
REPEAT
read ̲eight (page, address)();
IF NOT ̲OK THEN
write ̲with(page,address)();
address:= address+8;
UNTIL address=#F800;
page:= 0;
address:= 0;
REPEAT
read ̲eight(page,address)();
IF NOT ̲OK LOGOR address GE #8000 THEN
write ̲eight(page,address)();
address:=address+8;
UNTIL address:#0000;
END;
g) PROCEDURE load ̲mac
() "input
() "output
input :
none
output :
none
function:
copy MAC software from eprom ̲page, mac ̲first
to mac ̲last to boot ̲page, mac ̲first to mac
̲last.
procedures called :
none
local data:
eprom ̲page, mac ̲first, mac ̲last
BEGIN
"pseudo code
END;
h) main program
init ̲ram()(); "set the parity in RAM available
load ̲mac ()(); "copy from EPROM to RAM
IF ok THEN
load process (mac ̲context ̲load ̲address); "CR80
instruction for process loading
ELSE
load ̲process(SGI); "retry if not successful
4.2.8.5 P̲a̲c̲k̲a̲g̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲s̲
SGI is loaded by CI by the command …08…MAINTENANCE…08… which
will perform a programmed masterclear. SGI will also
be loaded direct by the CPU after power up or activation
of the masterclear button . Accidently, SGI may also
be invoked by an emergency action, where the process
causing emergency is still alive, but the program counter
has been set to run the emergency ̲action routine.
SGI loads MAC by the load process (LDN) instruction
after copying.
MAC software from EPROM to RAM.