disklabel.h revision 1.3
11.1Schopps/*
21.1Schopps * Copyright (c) 1994 Christian E. Hopps
31.1Schopps * All rights reserved.
41.1Schopps *
51.1Schopps * Redistribution and use in source and binary forms, with or without
61.1Schopps * modification, are permitted provided that the following conditions
71.1Schopps * are met:
81.1Schopps * 1. Redistributions of source code must retain the above copyright
91.1Schopps *    notice, this list of conditions and the following disclaimer.
101.1Schopps * 2. Redistributions in binary form must reproduce the above copyright
111.1Schopps *    notice, this list of conditions and the following disclaimer in the
121.1Schopps *    documentation and/or other materials provided with the distribution.
131.1Schopps * 3. All advertising materials mentioning features or use of this software
141.1Schopps *    must display the following acknowledgement:
151.1Schopps *      This product includes software developed by Christian E. Hopps.
161.1Schopps * 4. The name of the author may not be used to endorse or promote products
171.1Schopps *    derived from this software without specific prior written permission
181.1Schopps *
191.1Schopps * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
201.1Schopps * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
211.1Schopps * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
221.1Schopps * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
231.1Schopps * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
241.1Schopps * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
251.1Schopps * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
261.1Schopps * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
271.1Schopps * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
281.1Schopps * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
291.1Schopps *
301.3Scgd *	$Id: disklabel.h,v 1.3 1994/10/14 18:26:30 cgd Exp $
311.1Schopps */
321.1Schopps#ifndef _MACHINE_DISKLABEL_H_
331.1Schopps#define _MACHINE_DISKLABEL_H_
341.1Schopps
351.3Scgd#define	LABELSECTOR	0			/* sector containing label */
361.3Scgd#define	LABELOFFSET	64			/* offset of label in sector */
371.3Scgd#define	MAXPARTITIONS	16			/* number of partitions */
381.3Scgd#define	RAW_PART	2			/* raw partition: xx?c */
391.1Schopps
401.1Schopps/*
411.1Schopps * describes ados Rigid Disk Blocks
421.1Schopps * which are used to partition a drive
431.1Schopps */
441.1Schopps#define RDBNULL ((u_long)0xffffffff)
451.1Schopps
461.1Schopps/*
471.1Schopps * you will find rdblock somewhere in [0, RDBMAXBLOCKS)
481.1Schopps */
491.1Schopps#define RDB_MAXBLOCKS	16
501.1Schopps
511.1Schoppsstruct rdblock {
521.1Schopps	u_long id;		/* 'RDSK' */
531.1Schopps	u_long nsumlong;	/* number of longs in check sum */
541.1Schopps	u_long chksum;		/* simple additive with wrap checksum */
551.1Schopps	u_long hostid;		/* scsi target of host */
561.1Schopps	u_long nbytes;		/* size of disk blocks */
571.1Schopps	u_long flags;
581.1Schopps	u_long badbhead;	/* linked list of badblocks */
591.1Schopps	u_long partbhead;	/* linked list of partblocks */
601.1Schopps	u_long fsbhead;		/*   "     "   of fsblocks */
611.1Schopps	u_long driveinit;
621.1Schopps	u_long resv1[6];	/* RDBNULL */
631.1Schopps	u_long ncylinders;	/* number of cylinders on drive */
641.1Schopps	u_long nsectors;	/* number of sectors per track */
651.1Schopps	u_long nheads;		/* number of tracks per cylinder */
661.1Schopps	u_long interleave;
671.1Schopps	u_long park;		/* only used with st506 i.e. not */
681.1Schopps	u_long resv2[3];
691.1Schopps	u_long wprecomp;	/* start cyl for write precomp */
701.1Schopps	u_long reducedwrite;	/* start cyl for reduced write current */
711.1Schopps	u_long steprate;	/* driver step rate in ?s */
721.1Schopps	u_long resv3[5];
731.1Schopps	u_long rdblowb;		/* lowblock of range for rdb's */
741.1Schopps	u_long rdbhighb;	/* high block of range for rdb's */
751.1Schopps	u_long lowcyl;		/* low cylinder of partition area */
761.1Schopps	u_long highcyl;		/* upper cylinder of partition area */
771.1Schopps	u_long secpercyl;	/* number of sectors per cylinder */
781.1Schopps	u_long parkseconds;	/* zero if no park needed */
791.1Schopps	u_long resv4[2];
801.1Schopps	char   diskvendor[8];	/* inquiry stuff */
811.1Schopps	char   diskproduct[16];	/* inquiry stuff */
821.1Schopps	char   diskrevision[4];	/* inquiry stuff */
831.1Schopps	char   contvendor[8];	/* inquiry stuff */
841.1Schopps	char   contproduct[16];	/* inquiry stuff */
851.1Schopps	char   contrevision[4];	/* inquiry stuff */
861.1Schopps#if never_use_secsize
871.1Schopps	u_long resv5[0];
881.1Schopps#endif
891.1Schopps};
901.1Schopps
911.1Schopps
921.1Schopps#define RDBF_LAST	0x1	/* last drive available */
931.1Schopps#define RDBF_LASTLUN	0x2	/* last LUN available */
941.1Schopps#define RDBF_LASTUNIT	0x4	/* last target available */
951.1Schopps#define RDBF_NORESELECT	0x8	/* do not use reselect */
961.1Schopps#define RDBF_DISKID	0x10	/* disk id is valid ?? */
971.1Schopps#define RDBF_CTRLID	0x20	/* ctrl id is valid ?? */
981.1Schopps
991.1Schoppsstruct ados_environ {
1001.1Schopps	u_long tabsize;		/* 0: environ table size */
1011.1Schopps	u_long sizeblock;	/* 1: n long words in a block */
1021.1Schopps	u_long secorg;		/* 2: not used must be zero */
1031.1Schopps	u_long numheads;	/* 3: number of surfaces */
1041.1Schopps	u_long secperblk;	/* 4: must be 1 */
1051.1Schopps	u_long secpertrk;	/* 5: blocks per track */
1061.1Schopps	u_long resvblocks;	/* 6: reserved blocks at start */
1071.1Schopps	u_long prefac;		/* 7: must be 0 */
1081.1Schopps	u_long interleave;	/* 8: normally 1 */
1091.1Schopps	u_long lowcyl;		/* 9: low cylinder of partition */
1101.1Schopps	u_long highcyl;		/* 10: upper cylinder of partition */
1111.1Schopps	u_long numbufs;		/* 11: ados: number of buffers */
1121.1Schopps	u_long membuftype;	/* 12: ados: type of bufmem */
1131.1Schopps	u_long maxtrans;	/* 13: maxtrans the ctrlr supports */
1141.1Schopps	u_long mask;		/* 14: mask for valid address */
1151.1Schopps	u_long bootpri;		/* 15: boot priority for autoboot */
1161.1Schopps	u_long dostype;		/* 16: filesystem type */
1171.1Schopps	u_long baud;		/* 17: serial handler baud rate */
1181.1Schopps	u_long control;		/* 18: control word for fs */
1191.1Schopps	u_long bootblocks;	/* 19: blocks containing boot code */
1201.1Schopps	u_long fsize;		/* 20: file system block size */
1211.1Schopps	u_long frag;		/* 21: allowable frags per block */
1221.1Schopps	u_long cpg;		/* 22: cylinders per group */
1231.1Schopps};
1241.1Schopps
1251.1Schoppsstruct partblock {
1261.1Schopps	u_long id;		/* 'PART' */
1271.1Schopps	u_long nsumlong;	/* number of longs in check sum */
1281.1Schopps	u_long chksum;		/* simple additive with wrap checksum */
1291.1Schopps	u_long hostid;		/* scsi target of host */
1301.1Schopps	u_long next;		/* next in chain */
1311.1Schopps	u_long flags;		/* see below */
1321.1Schopps	u_long resv1[3];
1331.1Schopps	u_char partname[32];	/* (BCPL) part name (may not be unique) */
1341.1Schopps	u_long resv2[15];
1351.1Schopps	struct ados_environ e;
1361.1Schopps#if never_use_secsize
1371.1Schopps	u_long extra[9];	/* 8 for extra added to environ */
1381.1Schopps#endif
1391.1Schopps};
1401.1Schopps
1411.1Schopps#define PBF_BOOTABLE	0x1	/* partition is bootable */
1421.1Schopps#define PBF_NOMOUNT	0x2	/* partition should be mounted */
1431.1Schopps
1441.1Schoppsstruct badblock {
1451.1Schopps	u_long id;		/* 'BADB' */
1461.1Schopps	u_long nsumlong;	/* number of longs in check sum */
1471.1Schopps	u_long chksum;		/* simple additive with wrap checksum */
1481.1Schopps	u_long hostid;		/* scsi target of host */
1491.1Schopps	u_long next;		/* next in chain */
1501.1Schopps	u_long resv;
1511.1Schopps	struct badblockent {
1521.1Schopps		u_long badblock;
1531.1Schopps		u_long goodblock;
1541.1Schopps	} badtab[0];		/* 61 for secsize == 512 */
1551.1Schopps};
1561.1Schopps
1571.1Schoppsstruct fsblock {
1581.1Schopps	u_long id;		/* 'FSHD' */
1591.1Schopps	u_long nsumlong;	/* number of longs in check sum */
1601.1Schopps	u_long chksum;		/* simple additive with wrap checksum */
1611.1Schopps	u_long hostid;		/* scsi target of host */
1621.1Schopps	u_long next;		/* next in chain */
1631.1Schopps	u_long flags;
1641.1Schopps	u_long resv1[2];
1651.1Schopps	u_long dostype;		/* this is a file system for this type */
1661.1Schopps	u_long version;		/* version of this fs */
1671.1Schopps	u_long patchflags;	/* describes which functions to replace */
1681.1Schopps	u_long type;		/* zero */
1691.1Schopps	u_long task;		/* zero */
1701.1Schopps	u_long lock;		/* zero */
1711.1Schopps	u_long handler;		/* zero */
1721.1Schopps	u_long stacksize;	/* to use when loading handler */
1731.1Schopps	u_long priority;	/* to run the fs at. */
1741.1Schopps	u_long startup;		/* zero */
1751.1Schopps	u_long lsegblocks;	/* linked list of lsegblocks of fs code */
1761.1Schopps	u_long globalvec;	/* bcpl vector not used mostly */
1771.1Schopps#if never_use_secsize
1781.1Schopps	u_long resv2[44];
1791.1Schopps#endif
1801.1Schopps};
1811.1Schopps
1821.1Schoppsstruct lsegblock {
1831.1Schopps	u_long id;		/* 'LSEG' */
1841.1Schopps	u_long nsumlong;	/* number of longs in check sum */
1851.1Schopps	u_long chksum;		/* simple additive with wrap checksum */
1861.1Schopps	u_long hostid;		/* scsi target of host */
1871.1Schopps	u_long next;		/* next in chain */
1881.1Schopps	u_long loaddata[0];	/* load segment data, 123 for secsize == 512 */
1891.1Schopps};
1901.1Schopps
1911.1Schopps#define RDBLOCK_ID	0x5244534b	/* 'RDSK' */
1921.1Schopps#define PARTBLOCK_ID	0x50415254	/* 'PART' */
1931.1Schopps#define BADBLOCK_ID	0x42414442	/* 'BADB' */
1941.1Schopps#define FSBLOCK_ID	0x46534844	/* 'FSHD' */
1951.1Schopps#define LSEGBLOCK_ID	0x4c534547	/* 'LSEG' */
1961.1Schopps
1971.1Schoppsstruct cpu_disklabel {
1981.1Schopps	u_long rdblock;			/* may be RDBNULL which invalidates */
1991.1Schopps	u_long pblist[MAXPARTITIONS];	/* partblock number (RDB list order) */
2001.1Schopps	char pbindex[MAXPARTITIONS];	/* index of pblock (partition order) */
2011.1Schopps	int  valid;			/* essential that this is valid */
2021.1Schopps};
2031.1Schopps
2041.1Schopps#endif /* _MACHINE_DISKLABEL_H_ */
205