Home | History | Annotate | Line # | Download | only in sun
disklabel.h revision 1.3
      1  1.3  agc /*	$NetBSD: disklabel.h,v 1.3 2003/08/07 16:31:23 agc Exp $ */
      2  1.1  mrg 
      3  1.1  mrg /*
      4  1.1  mrg  * Copyright (c) 1992, 1993
      5  1.1  mrg  *	The Regents of the University of California.  All rights reserved.
      6  1.1  mrg  *
      7  1.1  mrg  * This software was developed by the Computer Systems Engineering group
      8  1.1  mrg  * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
      9  1.1  mrg  * contributed to Berkeley.
     10  1.1  mrg  *
     11  1.1  mrg  * All advertising materials mentioning features or use of this software
     12  1.1  mrg  * must display the following acknowledgement:
     13  1.1  mrg  *	This product includes software developed by the University of
     14  1.1  mrg  *	California, Lawrence Berkeley Laboratory.
     15  1.1  mrg  *
     16  1.1  mrg  * Redistribution and use in source and binary forms, with or without
     17  1.1  mrg  * modification, are permitted provided that the following conditions
     18  1.1  mrg  * are met:
     19  1.1  mrg  * 1. Redistributions of source code must retain the above copyright
     20  1.1  mrg  *    notice, this list of conditions and the following disclaimer.
     21  1.1  mrg  * 2. Redistributions in binary form must reproduce the above copyright
     22  1.1  mrg  *    notice, this list of conditions and the following disclaimer in the
     23  1.1  mrg  *    documentation and/or other materials provided with the distribution.
     24  1.3  agc  * 3. Neither the name of the University nor the names of its contributors
     25  1.1  mrg  *    may be used to endorse or promote products derived from this software
     26  1.1  mrg  *    without specific prior written permission.
     27  1.1  mrg  *
     28  1.1  mrg  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     29  1.1  mrg  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     30  1.1  mrg  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     31  1.1  mrg  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     32  1.1  mrg  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     33  1.1  mrg  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     34  1.1  mrg  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     35  1.1  mrg  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     36  1.1  mrg  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     37  1.1  mrg  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     38  1.1  mrg  * SUCH DAMAGE.
     39  1.1  mrg  *
     40  1.1  mrg  *	@(#)sun_disklabel.h	8.1 (Berkeley) 6/11/93
     41  1.1  mrg  */
     42  1.1  mrg 
     43  1.1  mrg /*
     44  1.1  mrg  * SunOS disk label layout (only relevant portions discovered here).
     45  1.1  mrg  */
     46  1.1  mrg 
     47  1.1  mrg #define	SUN_DKMAGIC	55998
     48  1.1  mrg 
     49  1.1  mrg /* These are the guys that Sun's dkinfo needs... */
     50  1.1  mrg #define DKIOCGGEOM	_IOR('d', 2, struct sun_dkgeom)	/* geometry info */
     51  1.1  mrg #define DKIOCINFO	_IOR('d', 8, struct sun_dkctlr)	/* controller info */
     52  1.1  mrg #define DKIOCGPART	_IOR('d', 4, struct sun_dkpart)	/* partition info */
     53  1.1  mrg 
     54  1.1  mrg /* geometry info */
     55  1.1  mrg struct sun_dkgeom {
     56  1.1  mrg 	u_short	sdkc_ncylinders;	/* data cylinders */
     57  1.1  mrg 	u_short	sdkc_acylinders;	/* alternate cylinders */
     58  1.1  mrg 	u_short	sdkc_xxx1;
     59  1.1  mrg 	u_short	sdkc_ntracks;		/* tracks per cylinder */
     60  1.1  mrg 	u_short	sdkc_xxx2;
     61  1.1  mrg 	u_short	sdkc_nsectors;		/* sectors per track */
     62  1.1  mrg 	u_short	sdkc_interleave;	/* interleave factor */
     63  1.1  mrg 	u_short	sdkc_xxx3;
     64  1.1  mrg 	u_short	sdkc_xxx4;
     65  1.1  mrg 	u_short	sdkc_sparespercyl;	/* spare sectors per cylinder */
     66  1.1  mrg 	u_short	sdkc_rpm;		/* rotational speed */
     67  1.1  mrg 	u_short	sdkc_pcylinders;	/* physical cylinders */
     68  1.1  mrg 	u_short	sdkc_xxx5[7];
     69  1.1  mrg };
     70  1.1  mrg 
     71  1.1  mrg /* controller info */
     72  1.1  mrg struct sun_dkctlr {
     73  1.1  mrg 	int	sdkc_addr;		/* controller address */
     74  1.1  mrg 	short	sdkc_unit;		/* unit (slave) address */
     75  1.1  mrg 	short	sdkc_type;		/* controller type */
     76  1.1  mrg 	short	sdkc_flags;		/* flags */
     77  1.1  mrg };
     78  1.1  mrg 
     79  1.1  mrg /* partition info */
     80  1.1  mrg struct sun_dkpart {
     81  1.2  mrg 	int	sdkp_cyloffset;		/* starting cylinder */
     82  1.2  mrg 	int	sdkp_nsectors;		/* number of sectors */
     83  1.1  mrg };
     84  1.1  mrg 
     85  1.1  mrg struct sun_disklabel {			/* total size = 512 bytes */
     86  1.1  mrg 	char	sl_text[128];
     87  1.1  mrg 	char	sl_xxx1[292];
     88  1.1  mrg #define sl_bsdlabel	sl_xxx1		/* Embedded NetBSD label */
     89  1.1  mrg 	u_short sl_rpm;			/* rotational speed */
     90  1.1  mrg 	u_short	sl_pcylinders;		/* number of physical cyls */
     91  1.1  mrg #define	sl_pcyl	 sl_pcylinders		/* XXX: old sun3 */
     92  1.1  mrg 	u_short sl_sparespercyl;	/* spare sectors per cylinder */
     93  1.1  mrg 	char	sl_xxx3[4];
     94  1.1  mrg 	u_short sl_interleave;		/* interleave factor */
     95  1.1  mrg 	u_short	sl_ncylinders;		/* data cylinders */
     96  1.1  mrg 	u_short	sl_acylinders;		/* alternate cylinders */
     97  1.1  mrg 	u_short	sl_ntracks;		/* tracks per cylinder */
     98  1.1  mrg 	u_short	sl_nsectors;		/* sectors per track */
     99  1.1  mrg 	char	sl_xxx4[4];
    100  1.1  mrg 	struct sun_dkpart sl_part[8];	/* partition layout */
    101  1.1  mrg 	u_short	sl_magic;		/* == SUN_DKMAGIC */
    102  1.1  mrg 	u_short	sl_cksum;		/* xor checksum of all shorts */
    103  1.1  mrg };
    104  1.1  mrg 
    105  1.1  mrg #define SUN_LABELOFFSET	128		/* XXX we don't use this */
    106