{{Short description|Boot loader used in Windows NT-based products}} {{About|the boot loader for Windows Vista and later versions|older versions|NTLDR}} {{more citations needed|date=May 2010}} {{Infobox software | screenshot = File:Windows Boot Manager with Windows 7,Vista and XP.png | caption = Windows Boot Manager operating system select menu | title = Windows Boot Manager | other_names = <code>BOOTMGR</code> | developer = Microsoft | operating system = Windows | replaces = NTLDR | genre = Bootloader | license = Proprietary }}
The '''Windows Boot Manager''' (<code>BOOTMGR</code>) 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.<ref>{{Cite web |last=barrygolden |title=Boot and UEFI – Windows drivers |url=https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/boot-and-uefi |access-date=2023-03-20 |website=learn.microsoft.com |language=en-us}}</ref> It replaced the NTLDR present in older versions of Windows.
The boot sector or UEFI loads the Windows Boot Manager (a file named <code>BOOTMGR</code> on either the system or the boot partition), accesses the Boot Configuration Data store and uses the information to load the operating system through <code>winload.exe</code> or <code>winresume.exe</code> on BIOS systems, and <code>winload.efi</code> and <code>winresume.efi</code> on UEFI systems.<ref name="pollard">{{cite web|url=https://jdebp.eu/FGA/windows-nt-6-boot-process.html|title=The Windows NT 6 boot process|work=Frequently Given Answers|author-first=Jonathan|author-last=de Boyne Pollard|archive-url=https://web.archive.org/web/20160826093757/http://jdebp.eu/FGA/windows-nt-6-boot-process.html|archive-date= August 26, 2016|url-status=dead}}</ref>
== Launching == On system with BIOS firmware, the BIOS invokes MBR boot code from a hard disk drive at startup. The MBR boot code and 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 <code>bootmgr</code> file from an active partition.<ref>{{Cite web |title=Boot Sequence of Windows Multi-Boot – Multibooters.com |url=http://www.multibooters.com/guides/boot-sequence-of-mixed-windows-multiboot.html |archive-url=https://web.archive.org/web/20240227204046/http://www.multibooters.com/guides/boot-sequence-of-mixed-windows-multiboot.html |archive-date=2024-02-27 |url-status=dead |access-date=2020-11-19 |website=www.multibooters.com}}</ref>
On systems with UEFI firmware, UEFI invokes <code>bootmgfw.efi</code> from an EFI system partition at startup, starting the Windows Boot Manager.
== Operation == 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 {{mono|boot.ini}}.
These menu entries can include:
* Options to boot Windows Vista and later by invoking winload.exe. * Options to resume Windows Vista and later from hibernation by invoking winresume.exe. * Options to boot a prior version of the Windows NT family by invoking its NTLDR. * Options to load and to execute a volume boot record.
== Operating system loading == {{see also|Booting process of Windows#Windows NT}} The operating system is loaded by individual boot loaders for each install of Windows, called the Windows Boot Loader.
=== winload.exe === The Windows Boot Manager invokes <code>winload.exe</code>—the operating system boot loader—to load the operating system kernel executive (<code>ntoskrnl.exe</code>) 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 <code>winload.efi</code> and the file is always located at <code>\windows\system32</code> or <code>\windows\system32\boot</code>. In addition, if Hyper-V is enabled, winload.exe or winload.efi will load <code>hvix64.exe</code> or <code>hvax64.exe</code> on x64 computer systems; later, <code>ntoskrnl.exe</code> is loaded.
=== winresume.exe === If the computer has recently hibernated, then <code>bootmgr</code> will instead invoke <code>winresume.exe</code>. In UEFI systems, the file is called <code>winresume.efi</code> and is always located at <code>\windows\system32</code> or <code>\windows\system32\boot</code>.<ref>{{cite web |last1=Hudek |first1=Ted |last2=Marshall |first2=Don |last3=Graf |first3=Eliot |date=23 April 2019 |title=Overview of Boot Options in Windows |url=https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/boot-options-in-windows |url-status=live |archive-url=https://web.archive.org/web/20200421135336/https://docs.microsoft.com/en-us/windows-hardware/drivers/devtest/boot-options-in-windows |archive-date=21 April 2020 |access-date=21 April 2020 |website=Microsoft Docs Hardware Dev Center |publisher=Microsoft |language=EN |ref=11}}</ref>
== Boot Configuration Data == <code>BCD</code> is a file that is used to store the configuration of Microsoft's Windows Boot Manager. It is the equivalent of NTLDR's <code>boot.ini</code> or GNU GRUB's <code>grub.cfg</code>.
For UEFI boot, the file is located at <code>/EFI/Microsoft/Boot/BCD</code> on the EFI System Partition. For traditional BIOS boot, the file is at <code>\boot\BCD</code> on the active partition.<ref>{{cite web |author=Microsoft |title=Error message when you start Windows 7: "The Windows Boot Configuration Data file is missing required information" |url=https://support.microsoft.com/en-us/kb/2004518 |archive-url=https://web.archive.org/web/20100116044204/http://support.microsoft.com/kb/2004518 |archive-date=16 January 2010}}</ref>
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 {{mono|HKEY_LOCAL_MACHINE\BCD00000}}<ref name="like registry">{{cite news |last=Russinovich |first=Mark |author-link=Mark Russinovich |date=8 November 2011 |title=Fixing Disk Signature Collisions |work=Mark's Blog |publisher=Microsoft Corporation |agency=Microsoft TechNet |url=https://docs.microsoft.com/en-us/archive/blogs/markrussinovich/fixing-disk-signature-collisions |access-date=5 February 2021}}</ref> (with restricted permissions<ref>{{cite web |title=Why can't I edit the system BCD store via regedit? |url=http://superuser.com/questions/654971/why-cant-i-edit-the-system-bcd-store-via-regedit}}</ref>).
Boot Configuration Data (BCD) is a firmware-independent database for boot-time configuration data.<ref>{{Cite web |last=Marshall |first=Don |title=Overview of Boot Options in Windows – Windows drivers |url=https://learn.microsoft.com/en-us/windows-hardware/drivers/devtest/boot-options-in-windows |access-date=2023-03-20 |website=learn.microsoft.com |language=en-us}}</ref>
The BCD itself is encoded with UTF-16 encoding.
Several command-line tool to edit this file have been made available: bootrec, bcdboot and bcdedit.
=== bcdedit === {{Infobox software | name = bcdedit | screenshot = | logo = | screenshot size = | caption = | developer = Microsoft | released = | latest release version = | latest release date = | operating system = Microsoft Windows | genre = Command | license = Proprietary commercial software | website = {{URL|https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/bcdedit}} }} Boot Configuration Data may be altered using a command-line tool (bcdedit.exe), using the Registry Editor<ref name="like registry"/> (regedit.exe), using Windows Management Instrumentation, or with third-party tools such as EasyBCD, BOOTICE,<ref>{{cite web | url = http://bbs.ipauly.com/viewforum.php?f=2 | title = BOOTICE board index | author = Pauly | access-date = 2013-12-27 | archive-date = 2013-12-28 | archive-url = https://web.archive.org/web/20131228000320/http://bbs.ipauly.com/viewforum.php?f=2 | url-status = dead }}</ref> or Visual BCD Editor.<ref>{{cite web | url = http://www.boyans.net | title = Visual BCD Editor | author = Bo Yans }}</ref>
Boot Configuration Data allows for third-party integration, so anyone can implement tools such as diagnostics or recovery options.
=== bcdboot === BCDboot can be used to set up a system partition or repair the boot environment located on the system partition. BCDBoot can create a Boot Configuration Data (BCD) store on the system partition using the latest version of the Windows files.
=== bootrec === bootrec is a command in the Windows Recovery Environment that can be used to troubleshoot and repair issues with an MBR, a boot sector, or a BCD file.<ref>{{cite web |url=https://support.microsoft.com/en-us/topic/use-bootrec-exe-in-the-windows-re-to-troubleshoot-startup-issues-902ebb04-daa3-4f90-579f-0fbf51f7dd5d |title=Use Bootrec.exe in the Windows RE to troubleshoot startup issues |website=Microsoft Support}}</ref>
== See also == * Booting process of Windows * Windows Vista I/O technologies
== References == <references responsive="1"></references>
== Further reading == {{Refbegin}} *{{cite web |author-last=de Boyne Pollard |author-first=Jonathan |title=The Windows NT 6 boot process |url=https://jdebp.eu/FGA/windows-nt-6-boot-process.html |work=Frequently Given Answers}} {{Refend}}
{{Windows Components}} {{Firmware and booting}}
Category:Boot loaders Category:Windows NT architecture Category:Windows Vista