Imported Upstream version 1.1.11
[platform/upstream/cdrkit.git] / genisoimage / diskmbr.h
1 /*
2  * This file has been modified for the cdrkit suite.
3  *
4  * The behaviour and appearence of the program code below can differ to a major
5  * extent from the version distributed by the original author(s).
6  *
7  * For details, see Changelog file distributed with the cdrkit package. If you
8  * received this file from another source then ask the distributing person for
9  * a log of modifications.
10  *
11  */
12
13 /* @(#)diskmbr.h        1.2 04/03/02 Copyright 1999-2004 J. Schilling */
14 /*
15  *      Header file diskmbr.h - assorted structure definitions and macros
16  *      describing standard PC partition table
17  *
18  *      Copyright (c) 1999-2004 J. Schilling
19  */
20 /*
21  * This program is free software; you can redistribute it and/or modify
22  * it under the terms of the GNU General Public License version 2
23  * as published by the Free Software Foundation.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
28  * GNU General Public License for more details.
29  *
30  * You should have received a copy of the GNU General Public License along with
31  * this program; see the file COPYING.  If not, write to the Free Software
32  * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33  */
34
35 #ifndef _DISKMBR_H
36 #define _DISKMBR_H
37
38 #define MBR_MAGIC               0xAA55
39
40 #define PARTITION_UNUSED        0x00
41 #define PARTITION_ACTIVE        0x80
42
43 #define PARTITION_COUNT         4
44
45 #define MBR_SECTOR(x)           ((x)&0x3F)
46 #define MBR_CYLINDER(x)         ((x)>>8|((x)<<2&0x300))
47
48 struct disk_partition {
49         unsigned char   status;
50         unsigned char   s_head;
51         unsigned char   s_cyl_sec[2];
52         unsigned char   type;
53         unsigned char   e_head;
54         unsigned char   e_cyl_sec[2];
55         unsigned char   boot_sec[4];
56         unsigned char   size[4];
57 };
58
59 struct disk_master_boot_record {
60         char                    pad[0x1BE];
61         struct disk_partition   partition[PARTITION_COUNT];
62         unsigned char           magic[2];
63 };
64
65 #endif  /* _DISKMBR_H */