In
computer file system
In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
s, a block availability map (BAM) is a
data structure
In computer science, a data structure is a data organization, management, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, a ...
used to track
disk blocks that are considered free (available for new data). It is used along with a
directory
Directory may refer to:
* Directory (computing), or folder, a file system structure in which to store computer files
* Directory (OpenVMS command)
* Directory service, a software application for organizing information about a computer network's u ...
to manage files on a disk (originally only a
floppy disk
A floppy disk or floppy diskette (casually referred to as a floppy, or a diskette) is an obsolescent type of disk storage composed of a thin and flexible disk of a magnetic storage medium in a square or nearly square plastic enclosure lined w ...
, and later also a
hard disk
A hard disk drive (HDD), hard disk, hard drive, or fixed disk is an electro-mechanical data storage device that stores and retrieves digital data using magnetic storage with one or more rigid rapidly rotating platters coated with magnet ...
).
In terms of
Commodore DOS
Commodore DOS, also known as CBM DOS, is the disk operating system used with Commodore's 8-bit computers. Unlike most other DOSes, which are loaded from disk into the computer's own RAM and executed there, CBM DOS is executed internally in the dr ...
(
CBM DOS) compatible
disk drives
Data storage is the recording (storing) of information (data) in a storage medium. Handwriting, phonographic recording, magnetic tape, and optical discs are all examples of storage media. Biological molecules such as RNA and DNA are conside ...
, the BAM was a data structure stored in a reserved area of the disk (its size and location varied based on the physical characteristics of the disk). For each track, the BAM consisted of a
bitmap of available
blocks and (usually) a
count
Count (feminine: countess) is a historical title of nobility in certain European countries, varying in relative status, generally of middling rank in the hierarchy of nobility. Pine, L. G. ''Titles: How the King Became His Majesty''. New York: ...
of the available blocks. The count was held in a single byte, as all formats had 256 or fewer blocks per
track
Track or Tracks may refer to:
Routes or imprints
* Ancient trackway, any track or trail whose origin is lost in antiquity
* Animal track, imprints left on surfaces that an animal walks across
* Desire path, a line worn by people taking the shorte ...
. The count byte was simply the sum of all 1-bits in the bitmap of bytes for the current track.
The following table illustrates the layout of
Commodore 1541 BAM. The table would be larger for higher-capacity disks (described below).
The bitmap was contained in 3 bytes for Commodore 1541 format (
single-sided) disks because it had 17 to 20
sectors per track (note 3 bytes can hold at least 20 bits). Similarly, the
Commodore 1571 used 3 bytes for the bitmap of each track, but the BAM was twice the size because there were twice as many tracks when formatted as
double-sided. In contrast, the
Commodore 1581 disk drive used 5 bytes for the bitmap because the disk format had 40 blocks per track (note 5 bytes can hold 40 bits).
In the bitmap of any format, a 1
bit indicated the block was available (free), while a 0 bit indicated the block was not available (used), and the bitmap data was stored
low-byte first. So the first
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable unit ...
held a map for blocks 0 to 7, the second byte held a map for blocks 8 to 15, and so on. Within a byte, the bitmap was ordered
low-bit first. For example, the first byte would represent block 0 with the least significant bit and block 7 with the
most significant bit.
Storage devices by
Creative Micro Designs
Creative Micro Designs (CMD) was founded in 1987 by Doug Cotton and Mark Fellows. It is a computer technology company which originally developed and sold products for the Commodore 64 and C128 8-bit personal computers. After 2001 it sold ...
, intended for use with CBM computers, also used a Block Availability Map which served the same purpose. However, these devices (
FD-2000, FD-4000, and
CMD-HD) did not include a count byte, and the bits in each byte were reversed (high-bit first). Although the bits were reversed (compared to CBM formats), the bytes were still stored in the same order (low-byte first).
See also
*
Commodore DOS
Commodore DOS, also known as CBM DOS, is the disk operating system used with Commodore's 8-bit computers. Unlike most other DOSes, which are loaded from disk into the computer's own RAM and executed there, CBM DOS is executed internally in the dr ...
*
File Allocation Table
File Allocation Table (FAT) is a file system developed for personal computers. Originally developed in 1977 for use on floppy disks, it was adapted for use on hard disks and other devices. It is often supported for compatibility reasons by ...
(FAT)
*
Design of the FAT file system
*
Free space bitmap
Free-space bitmaps are one method used to track allocated sectors by some file systems. While the most simplistic design is highly inefficient, advanced or hybrid implementations of free-space bitmaps are used by some modern file systems.
Exampl ...
References
{{DEFAULTSORT:Block Availability Map
Computer file systems