Home | History | Annotate | Line # | Download | only in include
disklabel.h revision 1.1
      1  1.1  wdk /*	$NetBSD: disklabel.h,v 1.1 2000/08/12 22:58:13 wdk Exp $	*/
      2  1.1  wdk 
      3  1.1  wdk /*
      4  1.1  wdk  * Copyright (c) 2000 Wayne Knowles.     All rights reserved.
      5  1.1  wdk  *
      6  1.1  wdk  * Redistribution and use in source and binary forms, with or without
      7  1.1  wdk  * modification, are permitted provided that the following conditions
      8  1.1  wdk  * are met:
      9  1.1  wdk  * 1. Redistributions of source code must retain the above copyright
     10  1.1  wdk  *    notice, this list of conditions and the following disclaimer.
     11  1.1  wdk  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1  wdk  *    notice, this list of conditions and the following disclaimer in the
     13  1.1  wdk  *    documentation and/or other materials provided with the distribution.
     14  1.1  wdk  * 3. All advertising materials mentioning features or use of this software
     15  1.1  wdk  *    must display the following acknowledgement:
     16  1.1  wdk  *      This product includes software developed by Christopher G. Demetriou.
     17  1.1  wdk  * 4. The name of the author may not be used to endorse or promote products
     18  1.1  wdk  *    derived from this software without specific prior written permission
     19  1.1  wdk  *
     20  1.1  wdk  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     21  1.1  wdk  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     22  1.1  wdk  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     23  1.1  wdk  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     24  1.1  wdk  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     25  1.1  wdk  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     26  1.1  wdk  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     27  1.1  wdk  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     28  1.1  wdk  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     29  1.1  wdk  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     30  1.1  wdk  */
     31  1.1  wdk 
     32  1.1  wdk #if 0
     33  1.1  wdk 
     34  1.1  wdk #define	LABELSECTOR	0			/* sector containing label */
     35  1.1  wdk #define	LABELOFFSET	64			/* offset of label in sector */
     36  1.1  wdk #define	MAXPARTITIONS	8			/* number of partitions */
     37  1.1  wdk #define	RAW_PART	2			/* raw partition: xx?c */
     38  1.1  wdk #define NUMBOOT		2			/* bootxx + xxboot... */
     39  1.1  wdk 
     40  1.1  wdk /* Just a dummy */
     41  1.1  wdk struct cpu_disklabel {
     42  1.1  wdk 	int	cd_dummy;			/* must have one element. */
     43  1.1  wdk };
     44  1.1  wdk 
     45  1.1  wdk #endif /* _MACHINE_DISKLABEL_H_ */
     46  1.1  wdk 
     47  1.1  wdk 
     48  1.1  wdk #ifndef _MACHINE_DISKLABEL_H_
     49  1.1  wdk #define _MACHINE_DISKLABEL_H_
     50  1.1  wdk 
     51  1.1  wdk /*
     52  1.1  wdk  * MIPS partition conventions:
     53  1.1  wdk  *
     54  1.1  wdk  * Partition 0 - root
     55  1.1  wdk  * Partition 1 - swap
     56  1.1  wdk  * Partition 6 - usr
     57  1.1  wdk  * Partition 7 - volume body
     58  1.1  wdk  * Partition 8 - volume header
     59  1.1  wdk  * Partition 10 - whole disk
     60  1.1  wdk  */
     61  1.1  wdk 
     62  1.1  wdk #define MAXPARTITIONS	8
     63  1.1  wdk #define RAW_PART	2
     64  1.1  wdk 
     65  1.1  wdk #define LABELSECTOR	0
     66  1.1  wdk #define LABELOFFSET	128
     67  1.1  wdk 
     68  1.1  wdk struct cpu_disklabel {
     69  1.1  wdk 	int	cd_dummy;
     70  1.1  wdk };
     71  1.1  wdk 
     72  1.1  wdk struct mips_volheader {
     73  1.1  wdk 	u_int32_t	vh_magic;
     74  1.1  wdk #define MIPS_VH_MAGIC	0xbe5a941
     75  1.1  wdk 	int16_t		root;	/* Root partition number */
     76  1.1  wdk 	int16_t		swap;	/* Swap partition number */
     77  1.1  wdk 	char		bootfile[16]; /* Path of default file to boot */
     78  1.1  wdk 	char		_devparms[48]; /* disk device parameters */
     79  1.1  wdk 	struct {		/* Disk volume directory */
     80  1.1  wdk 		char 		name[8];
     81  1.1  wdk 		int32_t		block;
     82  1.1  wdk 		int32_t		bytes;
     83  1.1  wdk 	} voldir[15];
     84  1.1  wdk 	struct {
     85  1.1  wdk 		int32_t 	blocks;
     86  1.1  wdk 		int32_t 	first;
     87  1.1  wdk 		int32_t 	type;
     88  1.1  wdk 	} partitions[16];
     89  1.1  wdk 	int32_t		checksum;
     90  1.1  wdk 	int32_t		_pad;
     91  1.1  wdk } __attribute__((__packed__));
     92  1.1  wdk 
     93  1.1  wdk #define MIPS_PTYPE_VOLHDR	0
     94  1.1  wdk #define MIPS_PTYPE_TRKREPL      1
     95  1.1  wdk #define MIPS_PTYPE_SECREPL      2
     96  1.1  wdk #define MIPS_PTYPE_RAW		3
     97  1.1  wdk #define MIPS_PTYPE_BSD          4
     98  1.1  wdk #define MIPS_PTYPE_BSD42        4
     99  1.1  wdk #define MIPS_PTYPE_SYSV         5
    100  1.1  wdk #define MIPS_PTYPE_VOLUME	6 /* Entire volume */
    101  1.1  wdk 
    102  1.1  wdk #endif /* _MACHINE_DISKLABEL_H_ */
    103