1*c0bfb082Skrw /* $OpenBSD: disklabel.h,v 1.16 2015/09/30 15:13:54 krw Exp $ */ 252c13d20Sdrahn 352c13d20Sdrahn /* 452c13d20Sdrahn * Copyright (c) 1994 Christopher G. Demetriou 552c13d20Sdrahn * All rights reserved. 652c13d20Sdrahn * 752c13d20Sdrahn * Redistribution and use in source and binary forms, with or without 852c13d20Sdrahn * modification, are permitted provided that the following conditions 952c13d20Sdrahn * are met: 1052c13d20Sdrahn * 1. Redistributions of source code must retain the above copyright 1152c13d20Sdrahn * notice, this list of conditions and the following disclaimer. 1252c13d20Sdrahn * 2. Redistributions in binary form must reproduce the above copyright 1352c13d20Sdrahn * notice, this list of conditions and the following disclaimer in the 1452c13d20Sdrahn * documentation and/or other materials provided with the distribution. 1552c13d20Sdrahn * 3. All advertising materials mentioning features or use of this software 1652c13d20Sdrahn * must display the following acknowledgement: 1752c13d20Sdrahn * This product includes software developed by Christopher G. Demetriou. 1852c13d20Sdrahn * 4. The name of the author may not be used to endorse or promote products 1952c13d20Sdrahn * derived from this software without specific prior written permission 2052c13d20Sdrahn * 2152c13d20Sdrahn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2252c13d20Sdrahn * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2352c13d20Sdrahn * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2452c13d20Sdrahn * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2552c13d20Sdrahn * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2652c13d20Sdrahn * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2752c13d20Sdrahn * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2852c13d20Sdrahn * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2952c13d20Sdrahn * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3052c13d20Sdrahn * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3152c13d20Sdrahn */ 3252c13d20Sdrahn 3352c13d20Sdrahn #ifndef _MACHINE_DISKLABEL_H_ 3452c13d20Sdrahn #define _MACHINE_DISKLABEL_H_ 3552c13d20Sdrahn 3652c13d20Sdrahn #define LABELSECTOR 1 /* sector containing label */ 3752c13d20Sdrahn #define LABELOFFSET 0 /* offset of label in sector */ 3852c13d20Sdrahn #define MAXPARTITIONS 16 /* number of partitions */ 3952c13d20Sdrahn 4052c13d20Sdrahn /* HFS/DPME */ 4152c13d20Sdrahn 4252c13d20Sdrahn /* partition map structure from Inside Macintosh: Devices, SCSI Manager 4352c13d20Sdrahn * pp. 13-14. The partition map always begins on physical block 1. 4452c13d20Sdrahn * 4552c13d20Sdrahn * With the exception of block 0, all blocks on the disk must belong to 4652c13d20Sdrahn * exactly one partition. The partition map itself belongs to a partition 4752c13d20Sdrahn * of type `APPLE_PARTITION_MAP', and is not limited in size by anything 4852c13d20Sdrahn * other than available disk space. The partition map is not necessarily 4952c13d20Sdrahn * the first partition listed. 5052c13d20Sdrahn */ 5152c13d20Sdrahn struct part_map_entry { 5252c13d20Sdrahn #define PART_ENTRY_MAGIC 0x504d 5352c13d20Sdrahn u_int16_t pmSig; /* partition signature */ 5452c13d20Sdrahn u_int16_t pmSigPad; /* (reserved) */ 5552c13d20Sdrahn u_int32_t pmMapBlkCnt; /* number of blocks in partition map */ 5652c13d20Sdrahn u_int32_t pmPyPartStart; /* first physical block of partition */ 5752c13d20Sdrahn u_int32_t pmPartBlkCnt; /* number of blocks in partition */ 5852c13d20Sdrahn char pmPartName[32]; /* partition name */ 5952c13d20Sdrahn char pmPartType[32]; /* partition type */ 6052c13d20Sdrahn u_int32_t pmLgDataStart; /* first logical block of data area */ 6152c13d20Sdrahn u_int32_t pmDataCnt; /* number of blocks in data area */ 6252c13d20Sdrahn u_int32_t pmPartStatus; /* partition status information */ 6352c13d20Sdrahn u_int32_t pmLgBootStart; /* first logical block of boot code */ 6452c13d20Sdrahn u_int32_t pmBootSize; /* size of boot code, in bytes */ 6552c13d20Sdrahn u_int32_t pmBootLoad; /* boot code load address */ 6652c13d20Sdrahn u_int32_t pmBootLoad2; /* (reserved) */ 6752c13d20Sdrahn u_int32_t pmBootEntry; /* boot code entry point */ 6852c13d20Sdrahn u_int32_t pmBootEntry2; /* (reserved) */ 6952c13d20Sdrahn u_int32_t pmBootCksum; /* boot code checksum */ 7052c13d20Sdrahn char pmProcessor[16]; /* processor type (e.g. "68020") */ 7152c13d20Sdrahn u_int8_t pmBootArgs[128]; /* A/UX boot arguments */ 7252c13d20Sdrahn /* we do not index the disk image as an array, 7352c13d20Sdrahn * leave out the on disk padding 7452c13d20Sdrahn */ 7552c13d20Sdrahn #if 0 7652c13d20Sdrahn u_int8_t pad[248]; /* pad to end of block */ 7752c13d20Sdrahn #endif 7852c13d20Sdrahn }; 7952c13d20Sdrahn 8052c13d20Sdrahn #define PART_TYPE_DRIVER "APPLE_DRIVER" 8152c13d20Sdrahn #define PART_TYPE_DRIVER43 "APPLE_DRIVER43" 8252c13d20Sdrahn #define PART_TYPE_DRIVERATA "APPLE_DRIVER_ATA" 8352c13d20Sdrahn #define PART_TYPE_DRIVERIOKIT "APPLE_DRIVER_IOKIT" 8452c13d20Sdrahn #define PART_TYPE_FWDRIVER "APPLE_FWDRIVER" 8552c13d20Sdrahn #define PART_TYPE_FWB_COMPONENT "FWB DRIVER COMPONENTS" 8652c13d20Sdrahn #define PART_TYPE_FREE "APPLE_FREE" 8752c13d20Sdrahn #define PART_TYPE_MAC "APPLE_HFS" 8852c13d20Sdrahn #define PART_TYPE_OPENBSD "OPENBSD" 8952c13d20Sdrahn 9052c13d20Sdrahn #endif /* _MACHINE_DISKLABEL_H_ */ 91