// SharedStatics.Bcpl -- Statics shared between spooler and printer

// Arranged in groups based on the nature of their use.

// The file SharedStatics.Bj assigns locations to these statics, so that they will be in the same place in
// both programs. That file arranges the statics in approximate "checkpoint level".

external [


//
Options

//
Relevant to both systems
DoEtherReport
// Use event-reporting protocol to record activity
DoMeter
// Measure performance
DoFileMeter
// Measure disk performance
Debug
// Do not load RAM or communicate with printer device
Verbose
// Generate error messages in "soft-error" situations
PressServer
// True if server, false if "stand-alone"
DebugSystem
// Enables various debugging aids
Which
// Not transferred across systems, identifies program
xmFonts
// Put fonts in Bank 1 if set

//
Set during installation or by user command line, used by printer only.
UseMicroCode
// If false, use software simulation of microcode
breakPage
// Generate break page to head each printed document


//
Files, Devices, etc.
//
Relevant to both
tridentUsed
// True if
tridentDrive
// Which T80 drive contains Spruce Files
MeterFile
// System Files
SpoolFile
ErrorFile
//LogFile
QueueFile
mapTemp// Used by checkpoint code
CheckPrAttr
// used by checkpoint code
statusOf31s
// denotes single-disk, double-disk, or two single-disk systems
tridentDisk
// TFSDSK structure, if tridentUsed
// sysFont
// Saved for restoration after Junta
printDoc
// Used by checkpoint code
PressFile
// ""
//
Set up by spooler, used only by printer.
BandFile
// System File
FontFile
// Spruce.Fonts, installer must supply

//
Miscellaneous shared information
numFilesSpooled
// Number of files available to print
numMustPrint
// print this many before considering new spooling requests
SpoolVec
// vector which holds spooled files to print (as QueueFile page #s)
printerName
// String used in status reports and on break page
LogoFont
// font information for breakpage logo
LogoText
NumBins
BinCounters

//
Parameters -- set up by spooler, used only by printer.
LandscapeDevice
// Paper moves left to right past beam, which scans bottom to top
PaperDimensionB
PaperDimensionS
printerDevice
printerForward
PaperSpeedInches
ScanLengthInches
ScanMarginAdjust
// Adjust real page with respect to hardware
BitMarginAdjust
// Adjust real page with respect to hardware
Capabilities
// what the printer can do
DutyCycle
// moved here from SprucePrintInit
Facets
// ditto
PolygonRatio
// ditto
XOffset
// Adjust Press page with respect to real page
YOffset
// Adjust Press page with respect to real page
ResolutionB
ResolutionS
nVisibleBands
FA

//
Version Information
Version
// version number is Version.MinorVersion
MinorVersion
// Set externally -- identifies version within major version
SpruceVersion
// used by checkpoint routines for validity checking
SpruceMinorVersion
SprintVersion
SprintMinorVersion
// Common Names and Usages, but maintained separately

drive1Disk
// BFSDSK structure for model 31, drive 2, if used
RunFile
CheckPointFile
CheckFp
// Checkpoint file’s cfa -- for re-opening after Junta
DPzero
// Double Precision zero
Report
// ~~ shared??
SpruceZone
ctxQ
// System context list
PermanentBottom
// Overlay, storage management descriptors
OverlayTable
ovNum
OverlayBottom
OverlayTop
overLayout
numActiveOverlays
cFA
// Run File cfa, valid before junta
CurRMR
// so we can tell what microcode is loaded

inMsg
// Argument to OutLd; message coming in
outMsg
// Argument to InLd; message going out

sprintFPRD
// InLd descriptor for running Sprint Printer
spruceFPRD
// Send to printer for returning

// Checkpoint internal statics
checkTime // time when this checkpoint output operation began
CpZone // permanent zone, for allocating info returned from checkpoint

// Spruce Utils statics
FSTrap

]

static [
//
Options
//
Relevant to both systems
DoEtherReport
// Use event-reporting protocol to record activity
DoMeter
// Measure performance
DoFileMeter
// Measure disk performance
Debug
// Do not load RAM or communicate with printer device
Verbose = true
// Generate error messages in "soft-error" situations
PressServer
// True if server, false if "stand-alone"
DebugSystem
// Enables various debugging aids, based on bits
// 1 -- Sprint: break on return from InLd
// 2 -- Sprint only: don’t really process files
// 4 -- Sprint: swat on error independent of severity
// 10 -- Sprint: don’t poll Ether ~~ not currently implemented
// 20 -- Sprint: don’t swap in spooler on Ether spool request
// 40 -- Spruce: set Debug to true at initialization
//100 -- Sprint: break at Ov0
//200 -- Sprint: break at Ov1
//400 -- Spruce: break on return from InLd
//1000 -- Sprint: no errors are fatal, return and post (unattended system)
//2000 -- Spruce: no errors are fatal, continue (not implemented yet)
//4000 -- Spruce: swat on error independent of severity
//10000 -- Both systems: Turn on allocation checking, perform various other
//forms of validity checking
//20000 -- Sprint: if Dover engine monitoring code is loaded, do measurements
//40000 -- Spruce: skip storage zone overlap check (pre core smash?)
//100000 -- Spruce: record allocation information in Spruce.Alloc
Which// Not transferred across systems, identifies program
xmFonts = 0
// Put fonts in bank 1 if set

//
Set during installation or by user command line, used by printer only.
UseMicroCode
// If false, use software simulation of microcode
breakPage
// Generate break page to head each printed document

//
Files, Devices, etc.
//
Relevant to both
tridentUsed
// True if
tridentDrive
// Which T80 drive contains Spruce Files
MeterFile
// System Files
ErrorFile
//LogFile
SpoolFile
QueueFile
mapTemp// Used by checkpoint code
CheckPrAttr
// used by checkpoint code
statusOf31s
// denotes single-disk, two single-disks, or double-disk system
// 0,1,2 (resp.)
drive1Disk
// BFSDSK structure for model 31, drive 2, if used as separate system
tridentDisk
// TFSDSK structure, if tridentUsed
sysFont
// Saved for restoration after Junta
printDoc
// Used by checkpoint code
PressFile
// ""
//
Set up by spooler, used only by printer.
BandFile
// System File
FontFile
// Spruce.Fonts, installer must supply

//
Miscellaneous shared information
numFilesSpooled
// Number of files available to print
numMustPrint
// print this many before considering new spooling requests
SpoolVec
// vector which holds spooled files to print (as QueueFile page #s)
printerName
// string, used in status reports and on break page
LogoFont
// font information for breakpage logo
LogoText
NumBins
BinCounters

//
Parameters -- set up by spooler, used only by printer.
LandscapeDevice
// Paper moves left to right past beam, which scans bottom to top
PaperDimensionB
PaperDimensionS
printerDevice
printerForward
PaperSpeedInches
ScanLengthInches
ScanMarginAdjust
// Adjust real page with respect to hardware
BitMarginAdjust
// Adjust real page with respect to hardware
Capabilities
// what the printer can do
DutyCycle
// moved here from SprucePrintInit
Facets
// ditto
PolygonRatio
// ditto
XOffset
// Adjust Press page with respect to real page
YOffset
// Adjust Press page with respect to real page
ResolutionB
ResolutionS
nVisibleBands
FA

// ------------------------------------------------------
//
Version Information
// ------------------------------------------------------
//
Six shared statics provide version information and provide the means for checking the validity of
// the checkpoint file. Version numbers are of the form (major version).(minor version), where major
// versions indicate substantive changes, and minor versions represent small additions and repairs. The
// six statics, all restricted to fixed locations, and further restricted to remain in the same locations over
// all future releases, are:

Version = 11// Version number = Version.MinorVersion
MinorVersion// Set externally (see below)
SpruceVersion// Created by checkpoint routines, used to check validity
SpruceMinorVersion// " "
SprintVersion// " "
SprintMinorVersion// " "

//
The static Version is set manually, above, to indicate a major new system release. MinorVersion
// may be conveniently set or incremented using a program, called Note, that knows its static location
// within the Run File (see below). These statics are maintained separately, but in corresponding
// locations, by the two programs. They are never directly stored or retrieved in checkpoints.
//
In Spruce, SpruceVersion and SpruceMinorVersion receive the values of Version and
// MinorVersion as a final step of OpenCheckPointFile() (see SpruceCheck.bcpl). Then they are saved in
// the LEVVersions region of the checkpoint file, along with Spruce’s current values for SprintVersion
// and SprintMinorVersion. Sprint carries out an analogous procedure.
//
In a preceding step of OpenCheckPointFile(), if the checkpoint file seems to have valid contents,
// Spruce restores the LEVVersions region, comparing Version to SpruceVersion and MinorVersion to
// SpruceMinorVersion. If either check fails, the function invalidates all shared and Spruce-specific
// checkpoint levels, requiring complete installation. Sprint again behaves analogously, except it does not
// destroy the shared levels. It is clear that once both systems have executed this code (in either order),
// all four auxiliary version values are available to EITHER system, for use in reporting to the user.
//
In a final check, Spruce verifies that SpruceVersion eq SprintVersion -- that is, that their major
// version numbers match.

//
Guidelines:
//
Whenever the location of existing shared statics change, shared statics are deleted or added, the
// data structures of any shared objects change, or any other modification is made which requires the
// knowledge and/or participation of both system, the major version number MUST be incremented. One
// SHOULD also increment this number in order to indicate a substantive revision. The minor version
// numbers for each system should be reset at 0.
//
Whenever the location of any existing non-shared static changes, or such statics are deleted or
// added, or the data structures change, the minor version number MUST be changed (incremented). It
// should be incremented whenever a new release of any sort is announced to the Spruce community, so
// that the installers will know whether thay have the latest, and all that. A ramification of this is that
// previously-installed checkpoint information may be discarded on occasions that would not normally
// require it. This seems a small price to pay for the validity checking that is occurring. ~~ A solution
// would be the addition of yet another level, perhaps private (not reported), to allow somewhat closer
// control, but it doesn’t seem worth it.
//
It is wise to choose distinctive minor version numbers for test versions of the system. I suggest
// the current release as major version and 100, 101, ... for minor version. Be careful about shared statics
// changes, since the major version is not being incremented according to the above rules. The rules
// need only be followed rigorously for released systems.

//
Notes on the use of the Note program to update MinorVersion:
//
Available on Spruce source directories, this program lets you annotate, checksum, and
// "versionize" any Alto file. Documentation of all features is or will be available elsewhere, but the
// following examples are sufficient for version control:

//
NOTE/V Spruce.Run Repair EFTP listener bug.
// will increment a version number stored in the leader page, and add a comment to those stored in the
// leader page or Spruce.Run. This is not sufficient to update the MinorVersion static. For that, use:

//
NOTE/U Spruce.Run.
// This will place the current leader page version in the static MinorVersion, whose location Note knows.

//
NOTE/VU Spruce.Run comment.
//
NOTE/U 100/V Spruce.Run comment.
// Both commands will modify the version number (incrementing in the first instance, setting it to 100
// in the second instance) in the leader pages, and update the MinorVersion static.
// IMPORTANT: The /U option MUST be issued following each system load. The command files
// ldspruce.cm and ldsprint.cm contain calls on Note to accomplish this. Failure to do this will result in
// a MinorVersion of 0.

// Common Names and Usages, but maintained separately

RunFile
CheckPointFile
CheckFp
// Checkpoint file’s cfa -- for re-opening after Junta
DPzero
// Double Precision zero
Report
// ~~ shared??
SpruceZone
ctxQ
// System context list
PermanentBottom
// Overlay, storage management descriptors
OverlayTable
ovNum
OverlayBottom
OverlayTop
overLayout
numActiveOverlays
cFA
// Run File cfa, valid before junta
CurRMR
// so we can tell what microcode is loaded
sprintFPRD
// InLd descriptor for running Spruce Printer
spruceFPRD
// Send to printer for returning

inMsg
// Argument to OutLd; message coming in
outMsg
// Argument to InLd; message going out

// Checkpoint internal statics
checkTime // time when this checkpoint output operation began
CpZone // permanent zone, for allocating info returned from checkpoint

// Spruce Utils statics
FSTrap
]

// ------- History . . .

// DCS, July 21, 1977 1:45 PM, derived from other places
// August 8, 1977 9:08 PM, add DebugSystem
// August 22, 1977 5:26 PM, DebugSystem takes on bit by bit meaning
// August 25, 1977 3:20 PM, previousOverlay defined
// August 28, 1977 7:29 AM, spruce->sprint, sprouller->spruce
// October 17, 1977 11:41 AM, add XOffset, YOffset, Versions 4.(0,0)
// December 7, 1977 10:04 AM, Verbose defaults to true
// January 21, 1978 1:23 AM, major version 5
// September 1, 1978 9:23 AM, numSpooled -> numFilesSpooled
// September 12, 1978 3:39 PM, add CheckCfa
// September 14, 1978 3:22 PM, revised version scheme
// September 15, 1978 4:42 PM, inherit printerName
// September 18, 1978 9:27 AM, CheckCfa -> CheckFp
// September 20, 1978 9:58 AM, format, document versions
// October 27, 1978 4:57 PM, add statusOf31s, stop sharing drive1Disk
// December 6, 1978 10:07 AM add new printer attribute stuff. Major version 10
// April 30, 1979 11:25 AM add 20000 bit to DebugSystem (see SpruceMeasure {Swinehart}); xmFonts
// August 29, 1979 10:13 AM, add NumBins and BinCounters
// November 16, 1979 2:12 PM, add LogoFont and LogoText
// January 30, 1980 12:56 PM, add CurRMR
// September 27, 1982 5:24 PM remove LogFile and add QueueFile
// September 30, 1982 12:52 PM add SpoolVec