Volume boot record
This article needs additional citations for verification. (September 2014) |
A volume boot record (VBR) (also known as a volume boot sector, a partition boot record or a partition boot sector) is a type of
The code in volume boot records is invoked either directly by the machine's firmware or indirectly by code in the master boot record or a
Invoking a VBR via a boot manager is known as
In
Technical details
Signature
The presence of an IBM PC compatible boot loader for x86-CPUs in the boot sector is by convention indicated by a two-byte hexadecimal sequence called the boot sector signature (55h at fixed offset +1FEh and AAh at +1FFh) for sector sizes of 512 bytes or more.[nb 1] For 512 byte sectors, the boot sector signature also marks the end of the sector. VBRs on smaller and larger sectors may show signatures at the end of the actual sector size as well, however, the semantics described herein apply to the 16-bit signature at +1FEh only.
This signature indicates the presence of at least a dummy boot loader which is safe to be executed, even if it may not be able to actually load an operating system. It does not indicate the presence of a (or even a particular)
The signature is tested for by most System BIOSes since (at least) the
If the BIOS or MBR code does not detect a valid boot sector and therefore cannot pass execution to the boot sector code, it will try the next boot device in the row. If they all fail it will typically display an error message and invoke
From decimal offset 72 to 79, an NTFS PBR contains the partition UUID volume ID serial number.
Invocation
The boot code in the VBR can assume that the BIOS has set up its data structures and interrupts and initialized the hardware. The code should not assume more than 32 KB of memory to be present for fail-safe operation;
Some conditions can be relaxed in controlled environments, for example, some boot loaders today assume to have up to 128 KB of memory to work with in normal operation (without querying for more), and some boot loaders using
The VBR is loaded at memory location 0000h
:7C00h
[1] and with the following CPU registers set up when the prior bootstrap loader (that is, typically the BIOS or MBR, but possibly another boot loader) passes execution to it by jumping to 0000h
:7C00h
in the CPU's real mode.
- IP=
0000h
:7C00h
(fixed)
Some Compaq BIOSes erroneously use 07C0h:0000h instead. While this resolves to the same location in real mode memory, it is non-standard and should be avoided, since VBR code assuming certain register values or not written to be relocatible may not work otherwise.
- FAT16volumes only, if the BPB value is set to
FFh
.) - INT 13h; else: don't care (should be zero). DH is supported by some IBM BIOSes. Some MBR and VBR codes preserve the value of DH.
Systems with
- DL = boot drive unit (see above)
- DI= points to "
$PnP
" installation check structure
This information allows the boot loader (in the MBR or VBR) to actively interact with the BIOS or a resident PnP / BBS overlay in memory in order to configure the boot order etc., however, this information is ignored by most standard MBRs and VBRs. Ideally, ES:DI is passed on, but PnP-enabled operating systems typically also have fallback methods to retrieve the PnP BIOS entry point later on so that most operating systems do not rely on this. Information in ES:DI can be used as a hint - according to the PnP BIOS specification, "$PnP" installation check structure could be found by searching for a signature of the ASCII string $PnP in system memory starting from F0000h to FFFFFh at every 16 byte boundary.
With partitioned media, when the VBR is launched by the MBR (or different boot loader) rather than the BIOS, many implementation pass additional information to the VBR besides just DL (and sometimes DH and ES:DI as well):
- Advanced Active Partition (AAP) feature. In addition to support for LOADER and AAPs, DR-DOS 7.07 can use this to determine the necessary INT 13h access method when using its dual CHS/LBA VBR code. The MBR code of OS/2, MS-DOS (prior to 7.0), PC DOS (up to 7.10), and Windows NT(up to ca. 2007) happens to provide this same interface as well, although these systems do not make use of it. The MBR installed by Windows NT 6.0 (and higher) uses other registers, and is therefore no longer compatible with these extensions. While some extensions only depend on the 16-byte partition table entry itself, other extensions may require the whole 4 (or 5 entry) partition table to be present as well.
Under DR-DOS 7.07 an extended interface may be optionally used by the MBR and in conjunction with LOADER:
- AX= magic signature indicating the presence of this extension (
0EDCh
) - DL = boot drive unit (see above)
- DS:SI = points to the 16-byte MBR partition table entry used (see above)
- ES:BX= start of boot sector or special "
NEWLDR
" sector image (typically 7C00h) - CX= reserved
In conjunction with
- EAX=
54504721h
("!GPT
") - DL = boot drive unit (see above)
- ES:DI = points to "
$PnP
" installation check structure (see above) - DS:SI = points to a Hybrid MBR handover structure, consisting of a 16-byte dummy MBR partition table entry (with all bits set except for the boot flag at offset
+0h
and the partition type at offset+4h
) followed by additional data. This is partially compatible with the older DS:SI extension discussed above, if only the 16-byte partition entry, not the whole partition table is required by these older extensions.
See also
- Master Boot Record(MBR)
- Extended Boot Record(EBR)
- BIOS Parameter Block(BPB)
- BPB formats in FAT file systems
- Disk partitioning
- Partition alignment
Notes
- big-endianrepresentation. Since this has been mixed up numerous times in books and even in original Microsoft reference documents, this article uses the offset-based byte-wise on-disk representation to avoid any possible misinterpretation.
References
- ^ a b c d e Paul, Matthias R. (1997-10-02) [1997-09-29]. "Caldera OpenDOS 7.01/7.02 Update Alpha 3 IBMBIO.COM - README.TXT and BOOT.TXT - A short description of how OpenDOS is booted". Archived from the original on 2003-10-04. Retrieved 2009-03-29. [1]
- ^ Intel Corporation (1996-01-11). BIOS Boot Specification 1.01 (PDF). 1.01. Archived from the original(PDF) on 2016-04-14.
- ^ a b Paul, Matthias R. (2017-08-14) [2017-08-07]. "The continuing saga of Windows 3.1 in enhanced mode on OmniBook 300". MoHPC - the Museum of HP Calculators. Archived from the original on 2018-05-01. Retrieved 2018-05-01.
[…] SYS […] /O[:nnn] Override IPL reported boot drive unit (n=0..126, 128..254). […] Preparing target disk... Choosing FAT12 CHS Boot Sector (requires IPL to report boot unit). Treating target as diskette or superfloppy medium (boot drive unit 0). Writing new Boot Sector... […]
- ^ Intel Corporation (1994-05-05). Plug and Play BIOS Specification 1.0A (PDF). 1.0A. Archived from the original(PDF) on 2018-02-02.
- ^ Elliott, Robert (2010-01-04). "EDD-4 Hybrid MBR boot code annex" (PDF). Hewlett-Packard, T13 Technical Committee. e09127r3. Archived (PDF) from the original on 2018-05-01. Retrieved 2018-05-01.
Further reading
- "Volume Boot Sectors". PC Guide.