ReactOS  0.4.14-dev-55-g2da92ac
bootblock.h File Reference
#include "type.h"
Include dependency graph for bootblock.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mbr_bpbFAT12
 
struct  mbr_bpbFAT16
 
struct  mbr_bpbFAT32
 
struct  mbr_bootsel
 
struct  mbr_partition
 
struct  mbr_sector
 
struct  shared_bbinfo
 
struct  x86_boot_params
 

Macros

#define MBR_BBSECTOR   0 /* MBR relative sector # */
 
#define MBR_BPB_OFFSET   11 /* offsetof(mbr_sector, mbr_bpb) */
 
#define MBR_BOOTCODE_OFFSET   90 /* offsetof(mbr_sector, mbr_bootcode) */
 
#define MBR_BS_OFFSET   400 /* offsetof(mbr_sector, mbr_bootsel) */
 
#define MBR_DSN_OFFSET   440 /* offsetof(mbr_sector, mbr_dsn) */
 
#define MBR_BS_MAGIC_OFFSET   444 /* offsetof(mbr_sector, mbr_bootsel_magic) */
 
#define MBR_PART_OFFSET   446 /* offsetof(mbr_sector, mbr_part[0]) */
 
#define MBR_MAGIC_OFFSET   510 /* offsetof(mbr_sector, mbr_magic) */
 
#define MBR_MAGIC   0xaa55 /* MBR magic number */
 
#define MBR_BS_MAGIC   0xb5e1 /* mbr_bootsel magic number */
 
#define MBR_PART_COUNT   4 /* Number of partitions in MBR */
 
#define MBR_BS_PARTNAMESIZE   8 /* Size of name mbr_bootsel nametab */
 
#define MBR_PFLAG_ACTIVE   0x80 /* The active partition */
 
#define MBR_PTYPE_FAT12   0x01 /* 12-bit FAT */
 
#define MBR_PTYPE_FAT16S   0x04 /* 16-bit FAT, less than 32M */
 
#define MBR_PTYPE_EXT   0x05 /* extended partition */
 
#define MBR_PTYPE_FAT16B   0x06 /* 16-bit FAT, more than 32M */
 
#define MBR_PTYPE_NTFS   0x07 /* OS/2 HPFS, NTFS, QNX2, Adv. UNIX */
 
#define MBR_PTYPE_FAT32   0x0b /* 32-bit FAT */
 
#define MBR_PTYPE_FAT32L   0x0c /* 32-bit FAT, LBA-mapped */
 
#define MBR_PTYPE_FAT16L   0x0e /* 16-bit FAT, LBA-mapped */
 
#define MBR_PTYPE_EXT_LBA   0x0f /* extended partition, LBA-mapped */
 
#define MBR_PTYPE_ONTRACK   0x54
 
#define MBR_PTYPE_LNXSWAP   0x82 /* Linux swap or Solaris */
 
#define MBR_PTYPE_LNXEXT2   0x83 /* Linux native */
 
#define MBR_PTYPE_EXT_LNX   0x85 /* Linux extended partition */
 
#define MBR_PTYPE_NTFSVOL   0x87 /* NTFS volume set or HPFS mirrored */
 
#define MBR_PTYPE_PREP   0x41 /* PReP */
 
#define MBR_PTYPE_386BSD   0xa5 /* 386BSD partition type */
 
#define MBR_PTYPE_APPLEUFS   0xa8 /* Apple UFS */
 
#define MBR_PTYPE_NETBSD   0xa9 /* NetBSD partition type */
 
#define MBR_PTYPE_OPENBSD   0xa6 /* OpenBSD partition type */
 
#define MBR_PSECT(s)   ((s) & 0x3f)
 
#define MBR_PCYL(c, s)   ((c) + (((s) & 0xc0) << 2))
 
#define MBR_IS_EXTENDED(x)
 
#define MBR_BS_ACTIVE   0x01 /* Bootselector active (or code present) */
 
#define MBR_BS_EXTINT13   0x02 /* Set by fdisk if LBA needed (deprecated) */
 
#define MBR_BS_READ_LBA   0x04 /* Force LBA reads - even for low numbers */
 
#define MBR_BS_EXTLBA   0x08 /* Extended ptn capable (LBA reads) */
 
#define MBR_BS_NEWMBR   0x80 /* New bootsel at offset 440 */
 
#define MBR_FAT32_FATNUM   0x0F /* mask for numbering active FAT */
 
#define MBR_FAT32_FATMIRROR   0x80 /* FAT is mirrored (as previously) */
 
#define MBR_FAT32_FSVERS   0 /* currently only 0 is understood */
 
#define SHARED_BBINFO_MAXBLOCKS   118 /* so sizeof(shared_bbinfo) == 512 */
 
#define X86_BOOT_MAGIC(n)   ('x' << 24 | 0x86b << 12 | 'm' << 4 | (n))
 
#define X86_BOOT_MAGIC_1   X86_BOOT_MAGIC(1) /* pbr.S */
 
#define X86_BOOT_MAGIC_2   X86_BOOT_MAGIC(2) /* bootxx.S */
 
#define X86_BOOT_MAGIC_PXE   X86_BOOT_MAGIC(3) /* start_pxe.S */
 
#define X86_BP_FLAGS_RESET_VIDEO   1
 
#define X86_BP_FLAGS_PASSWORD   2
 
#define X86_BP_CONSDEV_PC   0
 
#define X86_BP_CONSDEV_COM0   1
 
#define X86_BP_CONSDEV_COM1   2
 
#define X86_BP_CONSDEV_COM2   3
 
#define X86_BP_CONSDEV_COM3   4
 
#define X86_BP_CONSDEV_COM0KBD   5
 
#define X86_BP_CONSDEV_COM1KBD   6
 
#define X86_BP_CONSDEV_COM2KBD   7
 
#define X86_BP_CONSDEV_COM3KBD   8
 

Functions

int xlat_mbr_fstype (int)
 

Macro Definition Documentation

◆ MBR_BBSECTOR

#define MBR_BBSECTOR   0 /* MBR relative sector # */

Definition at line 202 of file bootblock.h.

◆ MBR_BOOTCODE_OFFSET

#define MBR_BOOTCODE_OFFSET   90 /* offsetof(mbr_sector, mbr_bootcode) */

Definition at line 204 of file bootblock.h.

◆ MBR_BPB_OFFSET

#define MBR_BPB_OFFSET   11 /* offsetof(mbr_sector, mbr_bpb) */

Definition at line 203 of file bootblock.h.

◆ MBR_BS_ACTIVE

#define MBR_BS_ACTIVE   0x01 /* Bootselector active (or code present) */

Definition at line 248 of file bootblock.h.

◆ MBR_BS_EXTINT13

#define MBR_BS_EXTINT13   0x02 /* Set by fdisk if LBA needed (deprecated) */

Definition at line 249 of file bootblock.h.

◆ MBR_BS_EXTLBA

#define MBR_BS_EXTLBA   0x08 /* Extended ptn capable (LBA reads) */

Definition at line 251 of file bootblock.h.

◆ MBR_BS_MAGIC

#define MBR_BS_MAGIC   0xb5e1 /* mbr_bootsel magic number */

Definition at line 211 of file bootblock.h.

◆ MBR_BS_MAGIC_OFFSET

#define MBR_BS_MAGIC_OFFSET   444 /* offsetof(mbr_sector, mbr_bootsel_magic) */

Definition at line 207 of file bootblock.h.

◆ MBR_BS_NEWMBR

#define MBR_BS_NEWMBR   0x80 /* New bootsel at offset 440 */

Definition at line 252 of file bootblock.h.

◆ MBR_BS_OFFSET

#define MBR_BS_OFFSET   400 /* offsetof(mbr_sector, mbr_bootsel) */

Definition at line 205 of file bootblock.h.

◆ MBR_BS_PARTNAMESIZE

#define MBR_BS_PARTNAMESIZE   8 /* Size of name mbr_bootsel nametab */

Definition at line 213 of file bootblock.h.

◆ MBR_BS_READ_LBA

#define MBR_BS_READ_LBA   0x04 /* Force LBA reads - even for low numbers */

Definition at line 250 of file bootblock.h.

◆ MBR_DSN_OFFSET

#define MBR_DSN_OFFSET   440 /* offsetof(mbr_sector, mbr_dsn) */

Definition at line 206 of file bootblock.h.

◆ MBR_FAT32_FATMIRROR

#define MBR_FAT32_FATMIRROR   0x80 /* FAT is mirrored (as previously) */

Definition at line 319 of file bootblock.h.

◆ MBR_FAT32_FATNUM

#define MBR_FAT32_FATNUM   0x0F /* mask for numbering active FAT */

Definition at line 318 of file bootblock.h.

◆ MBR_FAT32_FSVERS

#define MBR_FAT32_FSVERS   0 /* currently only 0 is understood */

Definition at line 321 of file bootblock.h.

◆ MBR_IS_EXTENDED

#define MBR_IS_EXTENDED (   x)
Value:
((x) == MBR_PTYPE_EXT || \
(x) == MBR_PTYPE_EXT_LBA || \
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define MBR_PTYPE_EXT
Definition: bootblock.h:222
#define MBR_PTYPE_EXT_LNX
Definition: bootblock.h:232
#define MBR_PTYPE_EXT_LBA
Definition: bootblock.h:228

Definition at line 243 of file bootblock.h.

◆ MBR_MAGIC

#define MBR_MAGIC   0xaa55 /* MBR magic number */

Definition at line 210 of file bootblock.h.

◆ MBR_MAGIC_OFFSET

#define MBR_MAGIC_OFFSET   510 /* offsetof(mbr_sector, mbr_magic) */

Definition at line 209 of file bootblock.h.

◆ MBR_PART_COUNT

#define MBR_PART_COUNT   4 /* Number of partitions in MBR */

Definition at line 212 of file bootblock.h.

◆ MBR_PART_OFFSET

#define MBR_PART_OFFSET   446 /* offsetof(mbr_sector, mbr_part[0]) */

Definition at line 208 of file bootblock.h.

◆ MBR_PCYL

#define MBR_PCYL (   c,
  s 
)    ((c) + (((s) & 0xc0) << 2))

Definition at line 241 of file bootblock.h.

◆ MBR_PFLAG_ACTIVE

#define MBR_PFLAG_ACTIVE   0x80 /* The active partition */

Definition at line 217 of file bootblock.h.

◆ MBR_PSECT

#define MBR_PSECT (   s)    ((s) & 0x3f)

Definition at line 240 of file bootblock.h.

◆ MBR_PTYPE_386BSD

#define MBR_PTYPE_386BSD   0xa5 /* 386BSD partition type */

Definition at line 235 of file bootblock.h.

◆ MBR_PTYPE_APPLEUFS

#define MBR_PTYPE_APPLEUFS   0xa8 /* Apple UFS */

Definition at line 236 of file bootblock.h.

◆ MBR_PTYPE_EXT

#define MBR_PTYPE_EXT   0x05 /* extended partition */

Definition at line 222 of file bootblock.h.

◆ MBR_PTYPE_EXT_LBA

#define MBR_PTYPE_EXT_LBA   0x0f /* extended partition, LBA-mapped */

Definition at line 228 of file bootblock.h.

◆ MBR_PTYPE_EXT_LNX

#define MBR_PTYPE_EXT_LNX   0x85 /* Linux extended partition */

Definition at line 232 of file bootblock.h.

◆ MBR_PTYPE_FAT12

#define MBR_PTYPE_FAT12   0x01 /* 12-bit FAT */

Definition at line 220 of file bootblock.h.

◆ MBR_PTYPE_FAT16B

#define MBR_PTYPE_FAT16B   0x06 /* 16-bit FAT, more than 32M */

Definition at line 223 of file bootblock.h.

◆ MBR_PTYPE_FAT16L

#define MBR_PTYPE_FAT16L   0x0e /* 16-bit FAT, LBA-mapped */

Definition at line 227 of file bootblock.h.

◆ MBR_PTYPE_FAT16S

#define MBR_PTYPE_FAT16S   0x04 /* 16-bit FAT, less than 32M */

Definition at line 221 of file bootblock.h.

◆ MBR_PTYPE_FAT32

#define MBR_PTYPE_FAT32   0x0b /* 32-bit FAT */

Definition at line 225 of file bootblock.h.

◆ MBR_PTYPE_FAT32L

#define MBR_PTYPE_FAT32L   0x0c /* 32-bit FAT, LBA-mapped */

Definition at line 226 of file bootblock.h.

◆ MBR_PTYPE_LNXEXT2

#define MBR_PTYPE_LNXEXT2   0x83 /* Linux native */

Definition at line 231 of file bootblock.h.

◆ MBR_PTYPE_LNXSWAP

#define MBR_PTYPE_LNXSWAP   0x82 /* Linux swap or Solaris */

Definition at line 230 of file bootblock.h.

◆ MBR_PTYPE_NETBSD

#define MBR_PTYPE_NETBSD   0xa9 /* NetBSD partition type */

Definition at line 237 of file bootblock.h.

◆ MBR_PTYPE_NTFS

#define MBR_PTYPE_NTFS   0x07 /* OS/2 HPFS, NTFS, QNX2, Adv. UNIX */

Definition at line 224 of file bootblock.h.

◆ MBR_PTYPE_NTFSVOL

#define MBR_PTYPE_NTFSVOL   0x87 /* NTFS volume set or HPFS mirrored */

Definition at line 233 of file bootblock.h.

◆ MBR_PTYPE_ONTRACK

#define MBR_PTYPE_ONTRACK   0x54

Definition at line 229 of file bootblock.h.

◆ MBR_PTYPE_OPENBSD

#define MBR_PTYPE_OPENBSD   0xa6 /* OpenBSD partition type */

Definition at line 238 of file bootblock.h.

◆ MBR_PTYPE_PREP

#define MBR_PTYPE_PREP   0x41 /* PReP */

Definition at line 234 of file bootblock.h.

◆ SHARED_BBINFO_MAXBLOCKS

#define SHARED_BBINFO_MAXBLOCKS   118 /* so sizeof(shared_bbinfo) == 512 */

Definition at line 405 of file bootblock.h.

◆ X86_BOOT_MAGIC

#define X86_BOOT_MAGIC (   n)    ('x' << 24 | 0x86b << 12 | 'm' << 4 | (n))

Definition at line 630 of file bootblock.h.

◆ X86_BOOT_MAGIC_1

#define X86_BOOT_MAGIC_1   X86_BOOT_MAGIC(1) /* pbr.S */

Definition at line 631 of file bootblock.h.

◆ X86_BOOT_MAGIC_2

#define X86_BOOT_MAGIC_2   X86_BOOT_MAGIC(2) /* bootxx.S */

Definition at line 632 of file bootblock.h.

◆ X86_BOOT_MAGIC_PXE

#define X86_BOOT_MAGIC_PXE   X86_BOOT_MAGIC(3) /* start_pxe.S */

Definition at line 633 of file bootblock.h.

◆ X86_BP_CONSDEV_COM0

#define X86_BP_CONSDEV_COM0   1

Definition at line 641 of file bootblock.h.

◆ X86_BP_CONSDEV_COM0KBD

#define X86_BP_CONSDEV_COM0KBD   5

Definition at line 645 of file bootblock.h.

◆ X86_BP_CONSDEV_COM1

#define X86_BP_CONSDEV_COM1   2

Definition at line 642 of file bootblock.h.

◆ X86_BP_CONSDEV_COM1KBD

#define X86_BP_CONSDEV_COM1KBD   6

Definition at line 646 of file bootblock.h.

◆ X86_BP_CONSDEV_COM2

#define X86_BP_CONSDEV_COM2   3

Definition at line 643 of file bootblock.h.

◆ X86_BP_CONSDEV_COM2KBD

#define X86_BP_CONSDEV_COM2KBD   7

Definition at line 647 of file bootblock.h.

◆ X86_BP_CONSDEV_COM3

#define X86_BP_CONSDEV_COM3   4

Definition at line 644 of file bootblock.h.

◆ X86_BP_CONSDEV_COM3KBD

#define X86_BP_CONSDEV_COM3KBD   8

Definition at line 648 of file bootblock.h.

◆ X86_BP_CONSDEV_PC

#define X86_BP_CONSDEV_PC   0

Definition at line 640 of file bootblock.h.

◆ X86_BP_FLAGS_PASSWORD

#define X86_BP_FLAGS_PASSWORD   2

Definition at line 637 of file bootblock.h.

◆ X86_BP_FLAGS_RESET_VIDEO

#define X86_BP_FLAGS_RESET_VIDEO   1

Definition at line 636 of file bootblock.h.

Function Documentation

◆ xlat_mbr_fstype()

int xlat_mbr_fstype ( int  )