Hardware manual
1106 can’t create an essential file during NewDisk
1107 bit table problem during NewDisk
1108 attempt to access nonexistant bit table page
9. Implementation -- Bfs
The implementation expects a structure BFSDSK to be passed as the "disk" argument to the routines. The
initial portion of this structure is the standard DSK structure followed by a copy of the DiskDescriptor
header and finally some private instance data for the disk in use. (Note: The Alto operating system
maintains a static sysDisk that points to such a structure for disk drive 0.)
Bfs ("Basic File System") is the name for a package of routines that implement the disk class for the
standard Alto disks (either Diablo Model 31 drives or a single Diablo Model 44 drive). The definitions (in
addition to those in AltoFileSys.D and Disks.D) are contained in Bfs.D. The code comes in two "levels:" a
"base" for reading and writing existing files (implements ActOnDiskPages, RealDiskDA and
VirtualDiskDA only); and a "write" level for creating, deleting, lengthening and shortening files
(implements WriteDiskPages, CreateDiskFile, DeleteDiskPages, AssignDiskPage, ReleaseDiskPage). The
source files BfsBase.Bcpl, Dvec.Bcpl and BfsMl.Asm comprise the base level; files BfsWrite.Bcpl
BfsCreate.bcpl, BfsClose.bcpl, and BfsDDMgr.bcpl implement the write level.
BfsMakeFpFromLabel(fp, la) constructs a virtual file id in the file pointer fp from the real file id in the
label la.
disk = BFSInit(diskZone, allocate[false], driveNumber[0], ddMgr[0], freshDisk[false],
tempZone[diskZone]) returns a disk object for driveNumber or zero. The permanent data structures for
the disk are allocated from diskZone; temporary free storage needed during the initialization process is
allocated from tempZone. If allocate is true, the machinery for allocating and deallocating disk space is
enabled. If it is enabled, a small DDMgr object and a 256 word buffer will be extracted from diskZone in
order to buffer the bit table. A single DDMgr, created by calling ’ddMgr = CreateDDMgr(zone)’, can
manage both disks. If freshDisk is true, BFSInit does not attempt to open and read the DiskDescriptor
file. This operation is essential for creating a virgin file system.
success = BFSNewDisk(zone, driveNum[0], nDisks[number spinning], nTracks[physical size],
dirLen[3000], nSectors[physical size]) creates a virgin Alto file system on the specified drive and returns
true if successful. The zone must be capable of supplying about 1000 words of storage. The logical size of
the file system may be different from the physical size of driveNum: it may span both disks (a ’double-disk
file system’), or it may occupy fewer tracks (a model 44 used as a model 31). The length in words of
SysDir, the master directory, is specified by dirLen. Some machines that emulate Altos implement 14
sectors per track.
BFSExtendDisk(zone, disk, nDisks, nTracks) extends (i.e. adds pages to) the filesystem on ’disk’.
Presumably ’nDisks’ or ’nTracks’ or both is bigger than the corresponding parameters currently in disk. A
single model 31 may be extended to a double model 31 or a single model 44 or a double model 44, and a
single model 44 may be extended to a double model 44. The zone must be capable of supplying about 750
words of storage.
0 = BFSClose(disk, dontFree[false]) destroys the disk object in an orderly way. If dontFree is true, the
ddMgr for the disk is not destroyed; presumably it is still in use by the other disk. (Note that this
procedure is the one invoked by the CloseDisk generic operation.)
BFSWriteDiskDescriptor(disk) insures that any important state saved in memory is correctly written on the
disk.
virtualDA = BFSFindHole(disk, nPages) attempts to find a contiguous hole nPages long in disk. It
returns the virtual disk address of the first page of a hole if successful, else -1.
Disks & Bfs August 10, 1980 61
For Xerox Internal Use Only -- December 15, 1980










