.bp
.ul
Detailed Descriptions of Flowcharts

DEVA = ALLOC(DEV)
.br
	Recall that the function of ALLOC is to obtain
the device address DEVA of a free 512-byte block
of storage from the free pool on device
DEVA.
Recall also that a bit map of
free blocks for each device is maintained
in the super-block for that device.
Referring to FIG. X, ALLOC operates
as follows:
variable DEVA is set to 0.
Then, at point 1 of FIG. X, the bit in the free map for device DEV
corresponding
to DEVA is tested.
If the bit is "1", the block is already allocated.
In that case DEVA is incremented (point 2)
and tested against
the free map size contained in the
super-block for the device.
If DEVA exceeds the free map size, an error
is reflected to the user; there is no
space on the device to satisfy his request.
If at point 3 DEVA has not exceeded the free map size, control
returns to point 1 and
another bit of the free list is tested.

	If at point 1 the free list bit corresponding to DEVA
is "0", the associated block is free;
in that case, the bit is made "1" to indicate
allocation of the block (point 4)
and the current value of DEVA is returned
to the caller of ALLOC.

	The blocks on DEV containing
the super block and the I-list for that device are
permanently allocated and never freed,
so the bits representing them in the free list are always "1".

FREE(DEV, DEVA)
.br
	Refer to Fig X, and recall that the function of FREE is to return
block number DEVA to the free list for device DEV.
FREE simply sets to "0" the bit in the free list
of the super block for DEV
which corresponds to DEVA.

DEVRD(DEV, DEVA)
	Recall that the function of DEVRD
is to read one 512-byte block from block
number DEVA on device DEV into a common buffer
area DEVBUF.
Refer to FIG. X.
DEVRD simply switches to the device handler appropriate
to device DEV,
which reads in the requested block.
If a device error is indicated, a return is made to
the user with an error indication.
The device handlers are not described here; consult
the documents XXX
available from Digital Equipment Corp.

DEVWR(DEV, DEVA)
	Recall that the function of DEVWR is
is to write one 512-byte
block from the common buffer area DEVBUF
to block number DEVA on device DEV.
Refer to FIG. X.
DEVWR simply switches to the device
handler appropriate to device DEV,
which writes the requested block DEVA.
If a device error is indicated,
a return is made to the user
with an error indication.
The device handlers are not described here; consult XXX
available from Digital Equipment Corporation.

