1 1.6 christos /* $NetBSD: disklabel.h,v 1.6 2015/09/26 03:31:52 christos 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.5 dholland #include <sys/ioccom.h> 48 1.5 dholland 49 1.1 mrg #define SUN_DKMAGIC 55998 50 1.1 mrg 51 1.1 mrg /* These are the guys that Sun's dkinfo needs... */ 52 1.6 christos #define SUN_DKIOCGGEOM _IOR('d', 2, struct sun_dkgeom) /* geometry info */ 53 1.6 christos #define SUN_DKIOCINFO _IOR('d', 8, struct sun_dkctlr) /* controller info */ 54 1.6 christos #define SUN_DKIOCGPART _IOR('d', 4, struct sun_dkpart) /* partition info */ 55 1.1 mrg 56 1.1 mrg /* geometry info */ 57 1.1 mrg struct sun_dkgeom { 58 1.1 mrg u_short sdkc_ncylinders; /* data cylinders */ 59 1.1 mrg u_short sdkc_acylinders; /* alternate cylinders */ 60 1.1 mrg u_short sdkc_xxx1; 61 1.1 mrg u_short sdkc_ntracks; /* tracks per cylinder */ 62 1.1 mrg u_short sdkc_xxx2; 63 1.1 mrg u_short sdkc_nsectors; /* sectors per track */ 64 1.1 mrg u_short sdkc_interleave; /* interleave factor */ 65 1.1 mrg u_short sdkc_xxx3; 66 1.1 mrg u_short sdkc_xxx4; 67 1.1 mrg u_short sdkc_sparespercyl; /* spare sectors per cylinder */ 68 1.1 mrg u_short sdkc_rpm; /* rotational speed */ 69 1.1 mrg u_short sdkc_pcylinders; /* physical cylinders */ 70 1.1 mrg u_short sdkc_xxx5[7]; 71 1.1 mrg }; 72 1.1 mrg 73 1.1 mrg /* controller info */ 74 1.1 mrg struct sun_dkctlr { 75 1.1 mrg int sdkc_addr; /* controller address */ 76 1.1 mrg short sdkc_unit; /* unit (slave) address */ 77 1.1 mrg short sdkc_type; /* controller type */ 78 1.1 mrg short sdkc_flags; /* flags */ 79 1.1 mrg }; 80 1.1 mrg 81 1.1 mrg /* partition info */ 82 1.1 mrg struct sun_dkpart { 83 1.2 mrg int sdkp_cyloffset; /* starting cylinder */ 84 1.2 mrg int sdkp_nsectors; /* number of sectors */ 85 1.1 mrg }; 86 1.1 mrg 87 1.1 mrg struct sun_disklabel { /* total size = 512 bytes */ 88 1.1 mrg char sl_text[128]; 89 1.1 mrg char sl_xxx1[292]; 90 1.1 mrg #define sl_bsdlabel sl_xxx1 /* Embedded NetBSD label */ 91 1.1 mrg u_short sl_rpm; /* rotational speed */ 92 1.1 mrg u_short sl_pcylinders; /* number of physical cyls */ 93 1.1 mrg #define sl_pcyl sl_pcylinders /* XXX: old sun3 */ 94 1.1 mrg u_short sl_sparespercyl; /* spare sectors per cylinder */ 95 1.1 mrg char sl_xxx3[4]; 96 1.1 mrg u_short sl_interleave; /* interleave factor */ 97 1.1 mrg u_short sl_ncylinders; /* data cylinders */ 98 1.1 mrg u_short sl_acylinders; /* alternate cylinders */ 99 1.1 mrg u_short sl_ntracks; /* tracks per cylinder */ 100 1.1 mrg u_short sl_nsectors; /* sectors per track */ 101 1.1 mrg char sl_xxx4[4]; 102 1.1 mrg struct sun_dkpart sl_part[8]; /* partition layout */ 103 1.1 mrg u_short sl_magic; /* == SUN_DKMAGIC */ 104 1.1 mrg u_short sl_cksum; /* xor checksum of all shorts */ 105 1.1 mrg }; 106 1.1 mrg 107 1.1 mrg #define SUN_LABELOFFSET 128 /* XXX we don't use this */ 108