Hardware manual

- A keyboard handler, which decodes keyboard interactions into a sequence of ASCII characters.
- A display driver, which maintains a "system display," and handles the printing of characters on the
display. This is the
DspStream package.
- Miscellaneous functions, including (1) the "call subsystem" function, which reads a file produced
by the Bcpl loader into memory and executes it; (2) allocation functions that manage the space not
used by the operating system or the user code, providing a stack for the user program and fixed-
size blocks that it may require; (3) the procedure for de-activating various portions of the operating
system; and (4) additional utilities.
3.2. Loading and Initialization
The facilities of the operating system are made accessible to user programs via
static variables that refer to
system procedures or system scalars. Because these objects are not defined in your Bcpl program, you must
declare the names to be
external. The Bcpl loader, Bldr, automatically reads the file Sys.Bk, which
describes how to arrange that your program’s external references will match up with the operating system
objects (for details, see Bldr documentation in the Bcpl manual). This arrangement does not require re-
loading programs when objects in the operating system move.
When a Bcpl program is read into the Alto memory, all of the system procedures described below will have
been initialized. A region is reserved for allocating system objects (e.g., disk streams); currently, about 6
disk streams or equivalent can be accomodated. If the space reserved is inadequate for your application,
the system zone can be replaced with one constructed by your program. In addition, most procedures that
create system objects have provision for an optional "zone" argument used for seizing space (see section
4.5).
3.3. Errors
Whenever the system detects an error for which the user program has not supplied its own error routine,
the call SysErr(p1, errCode, p2, p3, ...) is executed. The errCode is a number that identifies the error; the
p’s are parameters that add details.
Normally, SysErr calls Swat (the debugger), which will print out an intelligible error message retrieved
from the file Sys.Errors. The facilities of Swat (see "Alto Subsystems Manual") can then be used to
interrogate the program state more fully, and ultimately to continue or abort its execution.
3.4. Streams
The purpose of streams is to provide a standard interface between programs and their sources of sequential
input and sinks for sequential output. A set of standard operations, defined for all streams, is sufficient for
all ordinary input-output requirements. In addition, some streams may have special operations defined for
them. Programs which use any non-standard operations thereby forfeit complete compatibility.
Streams transmit information in atomic units called
items. Usually an item is a byte or a word, and this is
the case for all the streams supplied by the operating system. Of course, a stream supplied to a program
must have the same ideas about the kind of items it handles as the program does, or confusion will result.
Normally, streams which transmit text use byte items, and those which transmit binary information use
words. (The 16-bit quantity which Bcpl passes as an argument or receives as a result of a stream operation
could be a pointer to some larger object such as a string, although the operating system implements no
such streams. In this case, storage allocation conventions for the objects thus transmitted would have to be
defined.)
You are free to construct your own streams by setting up a suitable data structure (section 4.2) which
provides links to your own procedures which implement the standard operations.
Alto Operating System May 5, 1980 4
For Xerox Internal Use Only -- December 15, 1980