ReactOS
0.4.16-dev-2610-ge2c92c0
part_mbr.h
Go to the documentation of this file.
1
/*
2
* PROJECT: FreeLoader
3
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4
* PURPOSE: MBR partitioning scheme support
5
* COPYRIGHT: Copyright 2002-2003 Brian Palmer <brianp@sginet.com>
6
*/
7
8
#pragma once
9
10
#include <pshpack1.h>
11
12
/*
13
* Define the structure of a partition table entry
14
*/
15
typedef
struct
_PARTITION_TABLE_ENTRY
16
{
17
UCHAR
BootIndicator
;
// 0x00 - non-bootable partition,
18
// 0x80 - bootable partition (one partition only)
19
UCHAR
StartHead
;
// Beginning head number
20
UCHAR
StartSector
;
// Beginning sector (2 high bits of cylinder #)
21
UCHAR
StartCylinder
;
// Beginning cylinder# (low order bits of cylinder #)
22
UCHAR
SystemIndicator
;
// System indicator
23
UCHAR
EndHead
;
// Ending head number
24
UCHAR
EndSector
;
// Ending sector (2 high bits of cylinder #)
25
UCHAR
EndCylinder
;
// Ending cylinder# (low order bits of cylinder #)
26
ULONG
SectorCountBeforePartition
;
// Number of sectors preceding the partition
27
ULONG
PartitionSectorCount
;
// Number of sectors in the partition
28
}
PARTITION_TABLE_ENTRY
, *
PPARTITION_TABLE_ENTRY
;
29
C_ASSERT
(
sizeof
(
PARTITION_TABLE_ENTRY
) == 16);
30
31
/*
32
* Define the structure of the master boot record
33
*/
34
typedef
struct
_MASTER_BOOT_RECORD
35
{
36
UCHAR
MasterBootRecordCodeAndData
[0x1b8];
/* 0x000 */
37
ULONG
Signature
;
/* 0x1B8 */
38
USHORT
Reserved
;
/* 0x1BC */
39
PARTITION_TABLE_ENTRY
PartitionTable
[4];
/* 0x1BE */
40
USHORT
MasterBootRecordMagic
;
/* 0x1FE */
41
}
MASTER_BOOT_RECORD
, *
PMASTER_BOOT_RECORD
;
42
C_ASSERT
(
sizeof
(
MASTER_BOOT_RECORD
) == 512);
43
44
#include <poppack.h>
45
46
/*
47
* Partition type defines (of PSDK)
48
*/
49
#include <
reactos/rosioctl.h
>
50
#define PARTITION_ENTRY_UNUSED 0x00
// Entry unused
51
#define PARTITION_FAT_12 0x01
// 12-bit FAT entries
52
#define PARTITION_XENIX_1 0x02
// Xenix
53
#define PARTITION_XENIX_2 0x03
// Xenix
54
#define PARTITION_FAT_16 0x04
// 16-bit FAT entries
55
#define PARTITION_EXTENDED 0x05
// Extended partition entry
56
#define PARTITION_HUGE 0x06
// Huge partition MS-DOS V4
57
#define PARTITION_IFS 0x07
// IFS Partition
58
#define PARTITION_OS2BOOTMGR 0x0A
// OS/2 Boot Manager/OPUS/Coherent swap
59
#define PARTITION_FAT32 0x0B
// FAT32
60
#define PARTITION_FAT32_XINT13 0x0C
// FAT32 using extended int13 services
61
#define PARTITION_XINT13 0x0E
// Win95 partition using extended int13 services
62
#define PARTITION_XINT13_EXTENDED 0x0F
// Same as type 5 but uses extended int13 services
63
#define PARTITION_NTFS 0x17
// NTFS
64
#define PARTITION_PREP 0x41
// PowerPC Reference Platform (PReP) Boot Partition
65
#define PARTITION_LDM 0x42
// Logical Disk Manager partition
66
#define PARTITION_UNIX 0x63
// Unix
67
#define VALID_NTFT 0xC0
// NTFT uses high order bits
68
#define PARTITION_NTFT 0x80
// NTFT partition
69
#define PARTITION_GPT 0xEE
// GPT protective partition
70
#ifdef __REACTOS__
71
#define PARTITION_OLD_LINUX 0x43
72
#define PARTITION_LINUX 0x83
73
#endif
C_ASSERT
#define C_ASSERT(e)
Definition:
intsafe.h:73
PARTITION_TABLE_ENTRY
struct _PARTITION_TABLE_ENTRY PARTITION_TABLE_ENTRY
PPARTITION_TABLE_ENTRY
struct _PARTITION_TABLE_ENTRY * PPARTITION_TABLE_ENTRY
PMASTER_BOOT_RECORD
struct _MASTER_BOOT_RECORD * PMASTER_BOOT_RECORD
MASTER_BOOT_RECORD
struct _MASTER_BOOT_RECORD MASTER_BOOT_RECORD
USHORT
unsigned short USHORT
Definition:
pedump.c:61
rosioctl.h
MASTER_BOOT_RECORD
Definition:
parttest.c:88
PARTITION_TABLE_ENTRY
Definition:
parttest.c:75
_MASTER_BOOT_RECORD
Definition:
part_mbr.h:35
_MASTER_BOOT_RECORD::MasterBootRecordCodeAndData
UCHAR MasterBootRecordCodeAndData[0x1b8]
Definition:
part_mbr.h:36
_MASTER_BOOT_RECORD::MasterBootRecordMagic
USHORT MasterBootRecordMagic
Definition:
part_mbr.h:40
_MASTER_BOOT_RECORD::PartitionTable
PARTITION_TABLE_ENTRY PartitionTable[4]
Definition:
part_mbr.h:39
_MASTER_BOOT_RECORD::Reserved
USHORT Reserved
Definition:
part_mbr.h:38
_MASTER_BOOT_RECORD::Signature
ULONG Signature
Definition:
part_mbr.h:37
_PARTITION_TABLE_ENTRY
Definition:
part_mbr.h:16
_PARTITION_TABLE_ENTRY::SectorCountBeforePartition
ULONG SectorCountBeforePartition
Definition:
part_mbr.h:26
_PARTITION_TABLE_ENTRY::PartitionSectorCount
ULONG PartitionSectorCount
Definition:
part_mbr.h:27
_PARTITION_TABLE_ENTRY::BootIndicator
UCHAR BootIndicator
Definition:
part_mbr.h:17
_PARTITION_TABLE_ENTRY::StartCylinder
UCHAR StartCylinder
Definition:
part_mbr.h:21
_PARTITION_TABLE_ENTRY::StartSector
UCHAR StartSector
Definition:
part_mbr.h:20
_PARTITION_TABLE_ENTRY::SystemIndicator
UCHAR SystemIndicator
Definition:
part_mbr.h:22
_PARTITION_TABLE_ENTRY::EndHead
UCHAR EndHead
Definition:
part_mbr.h:23
_PARTITION_TABLE_ENTRY::EndSector
UCHAR EndSector
Definition:
part_mbr.h:24
_PARTITION_TABLE_ENTRY::EndCylinder
UCHAR EndCylinder
Definition:
part_mbr.h:25
_PARTITION_TABLE_ENTRY::StartHead
UCHAR StartHead
Definition:
part_mbr.h:19
UCHAR
unsigned char UCHAR
Definition:
typedefs.h:53
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
boot
freeldr
freeldr
disk
part_mbr.h
Generated on Thu Apr 16 2026 06:03:07 for ReactOS by
1.9.6