/*
 *   Copyright (c) 1996 David Parsons. All rights reserved.
 *   
 *   Redistribution and use in source and binary forms, with or without
 *   modification, are permitted provided that the following conditions
 *   are met:
 *  1. Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *  2. Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *  3. All advertising materials mentioning features or use of this
 *     software must display the following acknowledgement:
 *     
 *   This product includes software developed by David Parsons
 *   (orc@pell.chi.il.us)
 *
 *  4. My name may not be used to endorse or promote products derived
 *     from this software without specific prior written permission.
 *     
 *  THIS SOFTWARE IS PROVIDED BY DAVID PARSONS ``AS IS'' AND ANY
 *  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 *  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID
 *  PARSONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
 *  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 *  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 *  THE POSSIBILITY OF SUCH DAMAGE.
 */
/*
 * interesting things about the partition block on a hard disk
 */
#ifndef _PARTITION_D
#define _PARTITION_D

#define PARTYPE_LINUX	0x83
#define PARTYPE_SWAP	0x82
#define ACTIVE_FLAG	0x80
#define PARTYPE_FAT12	0x01
#define PARTYPE_FAT16	0x04
#define PARTYPE_BIGFAT	0x06

#define BYTES_PER_SECTOR	512
#define PARTITION_OFFSET	0x1be
#define VALIDATION_OFFSET	0x1fe

#define MAXCYLINDER		1024	/* IBM PC BIOS limit */

#define partition_is_ok(p)	(((unsigned short*)((p)+VALIDATION_OFFSET))[0] == 0xaa55)
#define make_partition_ok(p)	(((unsigned short*)((p)+VALIDATION_OFFSET))[0] = 0xaa55)

#define partition_offset(p, nr)  ((p) + PARTITION_OFFSET + (nr) * sizeof(struct partition))


#define EP_OK		0	/* writing partitions: ok */
#define EP_SMALL	1	/* ... disk too small to install onto */
#define EP_READ		2	/* ... error reading superblock */
#define EP_WRITE	3	/* ... write error */
#endif
