altblk(4) altblk(4)NAME altblk - alternate block information for bad block handling SYNOPSIS #include <sys/types.h> #include <apple/abm.h> DESCRIPTION abm is the data structure used by A/UX disk device drivers to handle bad blocks for disk partitions that support alternate block bad block handling. The abm structure can be retrieved through an ioctl(2) with a request of GD_GETABM. The actual contents of the alternate block map can be retrieved via the abmi structure through an ioctl(2) with a request of GD_GETMAP. The abmi structure is described in gd(7). The format of the abm structure is: struct abm /* altblk map info stored in bzb */ { int abm_size; /* size of map (bytes) */ int abm_ents; /* number of used entries (bytes) */ daddr_t abm_start; /* start of altblk map (phys blk num) */ }; typedef struct abm ABM; #define ABM_ENTSIZ (sizeof(long)) /* size of each map entry */ #define NO_ALTMAP ((daddr_t) 0) /* value of abm_off field if no map */ #define ABM_FREE -1 /* block not used */ #define ABM_BADBLK -2 /* block is bad */ #define ABM_ABM -3 /* part of AltBlkMap */ #define ABM_MAXVAL -16 /* last reserved map value */ Normally the alternate block area, that area between the end of the logical partition and the end of the physical partition, will (optionally) contain an alternate block map and alternate block data blocks for alternate block handling. The alternate block map resides anywhere in the alternate block area, in a contiguous set of blocks. The format of the alternate block map is an array of long integers. Each indexed location in the array corresponds to a potential alternate block in the alternate block area. A location in the alternate block array (map) may either contain the number of a block in the logical partition of the disk partition that will be remapped, or it may contain a flag. January 1992 1
altblk(4) altblk(4)The currently recognized flag values are ABM_FREE for available blocks, ABM_BADBLK if the free block is bad, and ABM_ABM to indicate that the block is allocated to the alternate block map. Flag values within the range of ABM_ABM and ABM_MAXVAL are reserved for future use. Alternate block mapping may be disabled through an ioctl(2) with the request GD_ALTBLK. A bad block may be alternately blocked through an ioctl(2) with the request GD_MKBAD. Field descriptions abm_size This field contains the size of the alternate block map as measured in bytes. This value should always be evenly divisible by ABM_ENTSIZ. The value of this field should be consulted when requesting the contents of the alternate block map through an ioctl(2). abm_ents The value of this field represents the byte offset of the next available entry in the alternate block map as measured from the beginning of the map. This field is maintained by the device driver. abm_start The value of this field is set to NO_ALTMAP to indicate that there is no alternate block map for the corresponding partition. If the value of this field is not set to NO_ALTMAP, then the value is the physical block number (relative to the start of the physical partition) of the first block of the alternate block map. SEE ALSO bzb(4), gd(7) badblk(1M), dp(1M), in A/UX System Administrator's Reference 2 January 1992