xref: /original-bsd/sys/sys/dkbad.h (revision 27393bdf)
1 /*-
2  * Copyright (c) 1982, 1986, 1993, 1994
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)dkbad.h	8.2 (Berkeley) 07/10/94
8  */
9 
10 /*
11  * Definitions needed to perform bad sector revectoring ala DEC STD 144.
12  *
13  * The bad sector information is located in the first 5 even numbered
14  * sectors of the last track of the disk pack.  There are five identical
15  * copies of the information, described by the dkbad structure.
16  *
17  * Replacement sectors are allocated starting with the first sector before
18  * the bad sector information and working backwards towards the beginning of
19  * the disk.  A maximum of 126 bad sectors are supported.  The position of
20  * the bad sector in the bad sector table determines which replacement sector
21  * it corresponds to.
22  *
23  * The bad sector information and replacement sectors are conventionally
24  * only accessible through the 'c' file system partition of the disk.  If
25  * that partition is used for a file system, the user is responsible for
26  * making sure that it does not overlap the bad sector information or any
27  * replacement sectors.
28  */
29 struct dkbad {
30 	int32_t   bt_csn;		/* cartridge serial number */
31 	u_int16_t bt_mbz;		/* unused; should be 0 */
32 	u_int16_t bt_flag;		/* -1 => alignment cartridge */
33 	struct bt_bad {
34 		u_int16_t bt_cyl;	/* cylinder number of bad sector */
35 		u_int16_t bt_trksec;	/* track and sector number */
36 	} bt_bad[126];
37 };
38 
39 #define	ECC	0
40 #define	SSE	1
41 #define	BSE	2
42 #define	CONT	3
43