Misplaced Pages

Windows Boot Manager

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

The Windows Boot Manager ( BOOTMGR ) is the bootloader provided by Microsoft for Windows NT versions starting with Windows Vista and Windows Server 2008 . It is the first program launched by the BIOS or UEFI of the computer and is responsible for loading the rest of Windows. It replaced the NTLDR present in older versions of Windows.

#857142

38-599: The boot sector or UEFI loads the Windows Boot Manager (a file named BOOTMGR on either the system or the boot partition ), accesses the Boot Configuration Data store and uses the information to load the operating system through winload.exe or winresume.exe . On system with BIOS firmware, the BIOS invokes MBR boot code from a hard disk drive at startup. The MBR boot code and

76-498: A VBR. If the device is a hard disk, that will be an MBR. It is the code in the MBR which generally understands disk partitioning, and in turn, is responsible for loading and running the VBR of whichever primary partition is set to boot (the active partition). The VBR then loads a second-stage bootloader from another location on the disk. Furthermore, whatever is stored in the first sector of

114-463: A crash when the BIOS passes execution to the boot sector assuming that it contains valid executable code. Nevertheless, some media for other platforms erroneously contain the signature, anyway, rendering this check not 100% reliable in practice. The signature is checked for by most system BIOSes since (at least) the IBM PC/AT (but not by the original IBM PC and some other machines). Even more so, it

152-424: A dummy boot loader which is safe to be executed, even if it may not be able actually to load an operating system. It does not indicate a particular (or even the presence of) file system or operating system, although some old versions of DOS 3 relied on it in their process to detect FAT -formatted media (newer versions do not). Boot code for other platforms or CPUs should not use this signature, since this may lead to

190-519: A floppy diskette, USB device, hard disk or any other bootable storage device, is not required to immediately load any bootstrap code for an OS, if ever. The BIOS merely passes control to whatever exists there, as long as the sector meets the very simple qualification of having the boot record signature of 0x55, 0xAA in its last two bytes. This is why it is easy to replace the usual bootstrap code found in an MBR with more complex loaders, even large multi-functional boot managers (programs stored elsewhere on

228-462: A sector size of 512 bytes or are limited to 32-bit calculations, exceeding the 2 TiB limit could cause compatibility problems. In operating systems that support GPT-based boot through BIOS services rather than EFI, the first sector may also still be used to store the first stage of the bootloader code, but modified to recognize GPT partitions. The bootloader in the MBR must not assume a sector size of 512 bytes. The partition table header defines

266-611: Is also checked by most MBR boot loaders before passing control to the boot sector. Some BIOSes (like the IBM PC/AT) perform the check only for fixed disk/removable drives, while for floppies and superfloppies, it is enough to start with a byte greater or equal to 06h and the first nine words not to contain the same value, before the boot sector is accepted as valid, thereby avoiding the explicit test for 0x55 , 0xAA on floppies. Since old boot sectors (e.g., very old CP/M-86 and DOS media) sometimes do not feature this signature despite

304-417: Is always located at \windows\system32 or \windows\system32\boot . If the computer has recently hibernated , then bootmgr will instead invoke winresume.exe . In UEFI systems, the file is called winresume.efi and is always located at \windows\system32 or \windows\system32\boot . Boot Configuration Data (BCD) is a firmware -independent database for boot-time configuration data. It

342-413: Is expected to be. There are two definitions on how to store the information regarding the partitioning: 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 0x55 0xAA (called the boot sector signature) at the end of the boot sector (offsets 0x1FE and 0x1FF ). This signature indicates the presence of at least

380-538: Is still reserved in the GPT specification, but it is now used in a way that prevents MBR-based disk utilities from misrecognizing and possibly overwriting GPT disks. This is referred to as a protective MBR . A single partition of type EEh , encompassing the entire GPT drive (where "entire" actually means as much of the drive as can be represented in an MBR), is indicated and identifies it as GPT. Operating systems and tools which cannot read GPT disks will generally recognize

418-662: Is the MEMZ GUID Partition Table The GUID Partition Table ( GPT ) is a standard for the layout of partition tables of a physical computer storage device , such as a hard disk drive or solid-state drive , using universally unique identifiers (UUIDs), which are also known as globally unique identifiers (GUIDs). Forming a part of the Unified Extensible Firmware Interface (UEFI) standard ( Unified EFI Forum -proposed replacement for

SECTION 10

#1732780591858

456-524: Is the sector of a persistent data storage device (e.g., hard disk , floppy disk , optical disc , etc.) which contains machine code to be loaded into random-access memory (RAM) and then executed by a computer system 's built-in firmware (e.g., the BIOS ). Usually, the first sector of the hard disk is the boot sector, regardless of sector size (512 or 4096 bytes) and partitioning flavor ( MBR or GPT ). The purpose of defining one particular sector as

494-719: Is the nature and purpose of GUIDs and as per RFC 4122, no central registry is needed to ensure the uniqueness of the GUID partition type designators. The 64-bit partition table attributes are shared between 48-bit common attributes for all partition types, and 16-bit type-specific attributes: Microsoft defines the type-specific attributes for basic data partition as: Google defines the type-specific attributes for ChromeOS kernel as: Windows 7 and earlier do not support UEFI on 32-bit platforms, and therefore do not allow booting from GPT partitions. Limited to 128 partitions per disk. "Partition type GUID" means that each partition type

532-501: Is used by Microsoft's Windows Boot Manager and replaces the boot.ini that was used by NTLDR . Boot Configuration Data is stored in a data file that has the same format as Windows Registry hives and is eventually mounted at registry key HKEY_LOCAL_MACHINE\BCD00000 (with restricted permissions). For UEFI boot, the file is located at /EFI/Microsoft/Boot/BCD on the EFI System Partition . For traditional BIOS boot,

570-591: The PC BIOS ), it is nevertheless also used for some BIOSs, because of the limitations of master boot record (MBR) partition tables, which use 32 bits for logical block addressing (LBA) of traditional 512-byte disk sectors . All modern personal computer operating systems support GPT. Some, including macOS and Microsoft Windows on the x86 architecture, support booting from GPT partitions only on systems with EFI firmware, but FreeBSD and most Linux distributions can boot from GPT partitions on systems with either

608-453: The VBR boot code are OS-specific. In Microsoft Windows, the MBR boot code tries to find an active partition (the MBR is only 512 bytes), then executes the VBR boot code of an active partition. The VBR boot code tries to find and execute the bootmgr file from an active partition. On systems with UEFI firmware, UEFI invokes bootmgfw.efi from an EFI system partition at startup, starting

646-555: The boot sector is inter-operability between firmware and various operating systems. The purpose of chain loading first a firmware (e.g., the BIOS), then some code contained in the boot sector, and then, for example, an operating system, is maximal flexibility. On an IBM PC compatible machine, the BIOS selects a boot device, then copies the first sector from the device (which may be a MBR , VBR or any executable code), into physical memory at memory address 0x7C00. On other systems,

684-513: The BIOS or the EFI firmware interface. The Master Boot Record (MBR) partitioning scheme, widely used since the early 1980s, imposed limitations for use of modern hardware. The available size for block addresses and related information is limited to 32 bits. For hard disks with 512‑byte sectors, the MBR partition table entries allow a maximum size of 2  TiB (2³² × 512‑bytes) or 2.20  TB (2.20 × 10¹² bytes). In

722-405: The GPT header. The first 16 bytes of each entry designate the partition type's globally unique identifier (GUID). For example, the GUID for an EFI system partition is C12A7328-F81F-11D2-BA4B-00A0C93EC93B . The second 16 bytes are a GUID unique to the partition. Then follow the starting and ending 64 bit LBAs, partition attributes, and the 36 character (max.) Unicode partition name. As

760-592: The OS may refuse to manipulate the partition table. If the actual size of the disk exceeds the maximum partition size representable using the legacy 32-bit LBA entries in the MBR partition table, the recorded size of this partition is clipped at the maximum, thereby ignoring the rest of the disk. This amounts to a maximum reported size of 2 TiB, assuming a disk with 512 bytes per sector (see 512e ). It would result in 16 TiB with 4 KiB sectors ( 4Kn ), but since many older operating systems and tools are hard coded for

798-484: The Partition Entry Array. Thus, on a disk with 512-byte sectors, at least 32 sectors are used for the Partition Entry Array, and the first usable block is at LBA 34 or higher, while on a 4,096-byte sectors disk, at least 4 sectors are used for the Partition Entry Array, and the first usable block is at LBA 6 or higher. For limited backward compatibility, the space of the legacy Master Boot Record (MBR)

SECTION 20

#1732780591858

836-478: The Windows Boot Loader. The Windows Boot Manager invokes winload.exe —the operating system boot loader —to load the operating system kernel executive ( ntoskrnl.exe ) and core device drivers . In that respect, winload.exe is functionally equivalent to the operating system loader function of NTLDR in prior versions of Windows NT. In UEFI systems, the file is called winload.efi and the file

874-442: The Windows Boot Manager. Once launched the Windows Boot Manager reads the Boot Configuration Data to determine what operating systems are present and if it should present the user with a menu allowing them to select which operating system to boot. Before Windows Vista, this data was contained in boot.ini . These menu entries can include: The operating system is loaded by individual boot loaders for each install of Windows, called

912-440: The device which can run without an operating system), allowing users a number of choices in what occurs next. With this kind of freedom, abuse often occurs in the form of boot sector viruses. Since code in the boot sector is executed automatically, boot sectors have historically been a common attack vector for computer viruses . To combat this behavior, the system BIOS often includes an option to prevent software from writing to

950-416: The disk as containing one partition of unknown type and no empty space, and will typically refuse to modify the disk unless the user explicitly requests and confirms the deletion of this partition. This minimizes accidental erasures. Furthermore, GPT-aware OSes may check the protective MBR and if the enclosed partition type is not of type EEh or if there are multiple partitions defined on the target device,

988-411: The disk partitioning in an inconsistent state. As an example, the malware NotPetya attempts to gain administrative privileges on an operating system, and then would attempt to overwrite the boot sector of a computer. The CIA has also developed malware that attempts to modify the boot sector in order to load additional drivers to be used by other malware. Another Malware that overwrites boot sector

1026-650: The drive is forced to perform two read-modify-write operations to satisfy a single misaligned 4,096‑byte write operation. Since April 2014, enterprise-class drives without emulation technology ( 4K native ) have been available on the market. Readiness of the support for 4 KB logical sectors within operating systems differs among their types, vendors and versions. For example, Microsoft Windows supports 4K native drives since Windows 8 and Windows Server 2012 (both released in 2012) in UEFI . Like MBR, GPT uses logical block addressing (LBA) in place of

1064-471: The fact that they can be booted successfully, the check can be disabled in some environments. 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 INT 18h. This will either start up optional resident software in ROM ( ROM BASIC ), reboot

1102-530: The file is at /boot/BCD on the active partition. Boot Configuration Data may be altered using a command-line tool (bcdedit.exe), using the Registry Editor (regedit.exe), using Windows Management Instrumentation , or with third-party tools such as EasyBCD , BOOTICE, or Visual BCD Editor. Boot Configuration Data allows for third-party integration, so anyone can implement tools like diagnostics or recovery options Boot sector A boot sector

1140-400: The first sector of any attached hard drives; it could thereby protect the master boot record containing the partition table from being overwritten accidentally, but not the volume boot records in the bootable partitions. Depending on the BIOS, attempts to write to the protected sector may be blocked with or without user interaction. Most BIOSes, however, will display a popup message giving

1178-420: The hard disk will no longer be bootable, unless used with a custom BIOS that defines a non-damaged sector as the boot sector. However, since the very first sector additionally contains data regarding the partitioning of the hard disk, the hard disk will become entirely unusable except when used in conjunction with custom software. A disk can be partitioned into multiple partitions and, on conventional systems, it

Windows Boot Manager - Misplaced Pages Continue

1216-505: The historical cylinder-head-sector (CHS) addressing. The protective MBR is stored at LBA 0, and the GPT header is in LBA 1, with a backup GPT header stored at the final LBA. The GPT header has a pointer to the partition table ( Partition Entry Array ), which is typically at LBA 2. Each entry on the partition table has a size of 128 bytes. The UEFI specification stipulates that a minimum of 16,384 bytes, regardless of sector size, are allocated for

1254-570: The late 1990s, Intel developed a new partition table format as part of what eventually became the Unified Extensible Firmware Interface (UEFI). The GUID Partition Table is specified in chapter 5 of the UEFI 2.8 specification. GPT uses 64 bits for logical block addresses, allowing a maximum disk size of 2 sectors. For disks with 512‑byte sectors, the maximum size is 8  ZiB (2  × 512‑bytes) or 9.44  ZB (9.44 × 10²¹ bytes). For disks with 4,096‑byte sectors

1292-522: The maximum size is 64  ZiB (2  × 4,096‑bytes) or 75.6  ZB (75.6 × 10²¹ bytes). In 2010, hard-disk manufacturers introduced drives with 4,096‑byte sectors ( Advanced Format ). For compatibility with legacy hardware and software, those drives include an emulation technology ( 512e ) that presents 512‑byte sectors to the entity accessing the hard drive, despite their underlying 4,096‑byte physical sectors. Performance could be degraded on write operations, when

1330-498: The process may be quite different. The UEFI (not legacy boot via CSM) does not rely on boot sectors, UEFI system loads the boot loader ( EFI application file in USB disk or in the EFI system partition ) directly. Additionally, the UEFI specification also contains "secure boot", which basically wants the UEFI code to be digitally signed . In case a boot sector receives physical damage,

1368-441: The system via INT 19h after user confirmation or cause the system to halt the bootstrapping process until the next power-up. Systems not following the above described design are: On IBM PC compatible machines, the BIOS is ignorant of the distinction between VBRs and MBRs, and of partitioning. The firmware simply loads and runs the first sector of the storage device. If the device is a floppy or USB flash drive , that will be

1406-407: The usable blocks on the disk. It also defines the number and size of the partition entries that make up the partition table (offsets 80 and 84 in the table). After the primary header and before the backup header, the Partition Entry Array describes partitions, using a minimum size of 128 bytes for each entry block. The starting location of the array on disk, and the size of each entry, are given in

1444-420: The user a chance to override the setting. The BIOS option is disabled by default because the message may not be displayed correctly in graphics mode and blocking access to the MBR may cause problems with operating system setup programs or disk access, encryption or partitioning tools like FDISK , which may not have been written to be aware of that possibility, causing them to abort ungracefully and possibly leaving

#857142