NTLDR
Template:Short description Template:About NTLDR (abbreviation of NT loader) is the boot loader for all releases of Windows NT from 1993 with the release of Windows NT 3.1 up until Windows XP and Windows Server 2003. From Windows Vista onwards it is replaced by Windows Boot Manager (BOOTMGR).
NTLDR is typically run from the primary storage device, but it can also run from portable storage devices such as a CD-ROM, USB flash drive, or floppy disk. NTLDR can also load a non NT-based operating system given the appropriate boot sector in a file.
NTLDR requires, at a minimum, the following three (or four) files to be on the system volume:
- Template:Mono, the main boot loader itself
- Template:Mono, required for booting an NT-based OS, detects basic hardware information needed for successful boot
- Template:Mono, which contains boot configuration
- If this file was missing, then it would default to the Windows directory on the first partition of the first hard drive (which by default is Template:Mono on most Windows NT releases until Windows 2000, Template:Mono on Windows NT 3.5 and 3.51, or Template:Mono on Windows XP and Windows Server 2003).
- Non-English versions of Windows may also load Template:Mono.
NTLDR is launched by the volume boot record of system partition, which is typically written to the disk by the Windows Template:Mono or Template:Mono command.
History
Windows NT was designed to be compatible with Advanced RISC Computing (ARC) platforms, relying on its boot manager support and providing only osloader.exe, a loading program accepting ordinary command-line arguments specifying Windows directory partition, location or boot parameters, which is launched by an ARC-compatible boot manager when a user chooses to start a specific Windows NT operating system. However, because IBM PC compatible machines based on the x86 IA-32 platform lacked any kind of ARC support (as they predate the creation of the ARC specification), an additional layer was added specifically for that platform: a custom boot manager code presenting a text-based menu allowing the user to choose from one or more operating systems and its options configured in a Template:Mono configuration file, prepended by a special StartUp module which is responsible for some preparations such as switching the CPU to protected mode.
When a user chooses an operating system from the boot menu, the following command-line arguments are then passed to the part of the osloader.exe common to all processor architectures:
Different versions of NTLDR were used for several different architectures. On Itanium-based systems, a system-reserved EFI system partition (ESP) is used containing Template:Mono, which initializes the OS. Windows Server 2003 for x86-64 and Windows XP Professional x64 Edition used a native 64-bit version of NTLDR (though beta versions still used the 32-bit version of NTLDR).
In Windows releases starting from Windows Vista and Windows Server 2008, NTLDR was split off into two parts: Windows Boot Manager for the boot manager and winload.exe for the system loader. The boot manager part has been completely rewritten; it no longer uses Template:Mono as a configuration file, although the bootcfg utility for modifying Template:Mono is still present in the case of multi-boot configurations with Windows versions up to Windows XP and Windows Server 2003.
Command-line interface
{{#invoke:Infobox|infobox}}Template:Template other {{#invoke:Check for unknown parameters|check|unknown=Template:Main other|preview=Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y| AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo class | logo size | logo title | logo upright | logo_alt | logo_caption | logo_class | logo_size | logo_title | logo_upright | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | qid | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot class | screenshot size | screenshot title | screenshot upright | screenshot_alt | screenshot_class | screenshot_size | screenshot_upright | service_name | size | standard | title | ver layout | website }}Template:Main other{{#invoke:Check for conflicting parameters|check | template = Template:Infobox software | cat = Template:Main other | logo size; logo_size | logo class; logo_class | logo alt; logo_alt | logo title; logo_title | logo caption; logo_caption | screenshot size; screenshot_size | screenshot upright; screenshot_upright | screenshot class; screenshot_class | screenshot alt; screenshot_alt | screenshot title; screenshot title | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | latest release version; latest_release_version | latest release date; latest_release_date | latest preview version; latest_preview_version | latest preview date; latest_preview_date | programming language; programming_language | operating system; operating_system }} Template:Expand section The bootsect.exe utility program in the Windows PE tools has options (/nt52 (NTLDR) and /nt60 (Vista and up)) to store a NTLDR or Vista boot record in the first sector of a specified partition.[1] The command can be used for FAT and NTFS based file systems. It replaces the FixFAT and FixNTFS tools.[2]
Example
The following example applies the NTLDR compatible master boot code to the D: volume:[2] <syntaxhighlight lang="doscon"> C:\>bootsect /nt52 D: </syntaxhighlight>
Startup process
Template:See also
When a PC is powered on its BIOS follows the configured boot order to find a bootable device. This can be a harddisk, floppy, CD/DVD, network connection, USB-device, etc. depending on the BIOS. In the case of a floppy the BIOS interprets its boot sector (first sector) as code, for NTLDR this could be a NTLDR boot sector looking for the ntldr file on the floppy. For a harddisk the code in the Master Boot Record (first sector) determines the active partition. The code in the boot sector of the active partition could then be again a NTLDR boot sector looking for ntldr in the root directory of this active partition. In a more convoluted scenario the active partition can contain a Vista boot sector for the newer Vista boot manager with an {ntldr} entry pointing to another partition with a NTLDR boot sector.[3]
When booting, the loader portion of NTLDR does the following in order:
- Accesses the file system on the boot drive (either FAT or New Technology File System, NTFS).
- If Windows was put in the hibernation state, the contents of hiberfil.sys are loaded into memory and the system resumes where it left off.
- Otherwise, reads Template:Mono and prompts the user with the boot menu accordingly. Meanwhile, ARC-based systems use osloader.exe,[4] while Itanium-based systems use ia64ldr.efi.[5]
- If a non NT-based OS is selected, NTLDR loads the associated file listed in Template:Mono (bootsect.dos if no file is specified or if the user is booting into a DOS based OS) and gives it control.
- If an NT-based OS is selected, NTLDR runs ntdetect.com, which gathers information about the computer's hardware. (If ntdetect.com hangs during hardware detection, there is a debug version called ntdetect.chk that can be found on Microsoft support.[6])
- Starts ntoskrnl.exe, passing to it the information returned by ntdetect.com.[7]
boot.ini
NTLDR's first action is to read the Template:Mono file.[8] It allows the user to choose which operating system to boot from at the menu. For NT and NT-based operating systems, it also allows the user to pass preconfigured options to the kernel. The menu options are stored in Template:Mono, which itself is located in the root of the same disk as NTLDR. Though NTLDR can boot DOS and non-NT versions of Windows, Template:Mono cannot configure their boot options.
For NT-based OSs, the location of the operating system is written as an ARC path. bootsect.dos is the boot sector loaded by NTLDR to load DOS, or if there is no file specified when loading a non NT-based OS.
Template:Mono is protected from user configuration by having the following file attributes: system, hidden, read-only. To manually edit it, the user would first have to remove these attributes. A more secure fashion to edit the file is to use the bootcfg command from a console. bootcfg will also relock the file (setting the file back to system, hidden, and read-only). Additionally, the file can be edited within Windows using a text editor if the folder view option "Show hidden files and folders" is selected, the folder view option "Hide protected operating system files" is unchecked, and the "Read-only" option is unchecked under the file's properties. Extreme caution should be taken when modifying Template:Mono, as erroneous information can result in an OS that fails to boot.
Example
An example of a Template:Mono file, extracted from a working Windows XP Professional installation: <syntaxhighlight lang="ini"> [boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect </syntaxhighlight>
Note: If the boot loader timeout option in Template:Mono is set to 0, the NTLDR boot menu does not appear. This happens especially on multi-booted systems; the boot menu also does not appear when only one option is defined in Template:Mono (or if only one operating system is installed), like the example above, even if the timeout option is set into any other value other than 0.
NT kernel switches
Note: Unless otherwise stated, the following kernel switches apply to both Windows XP and Windows Server 2003 as well as prior versions of Windows NT.
- Template:Mono Template:En dash Option introduced with Windows NT 4.0 Server, Enterprise Edition.[9] Allocates 3 GB for the user-mode address space and 1 GB for the system-mode (or kernel-mode) address space on 32-bit x86-based systems only, rather than the 2 GB allocation used for both user-mode and system/kernel-mode address spaces. It is intended for programs that can take advantage of the additional memory address space, such as certain Windows Server 2003 and Microsoft Exchange Server 2003 configurations.[10][11] Activating this option however may break VMR-9 video;[12] it may also cause audio problems with certain Sound Blaster X-Fi sound cards (X-Fi Gamer / X-Fi Titanium @ WINXP 32-bit 3/2012) due to the way that Creative's drivers handle memory over 2 GB.[13][14]
- Template:Mono Template:En dash Starts Windows in "VGA mode", where a VGA-compatible display driver is used with a 16-color, Template:Resx resolution.[11] This can be used to recover from configuration problems with certain display drivers; the Template:Mono switch can be used in conjunction with the Template:Mono switch to help diagnose display driver failures on startup (this is the case for Windows NT 4.0 for the "VGA mode" option in the boot menu, which has both Template:Mono and Template:Mono switches enabled).[10]
- Template:Mono Template:En dash Specifies the baud rate for the debug port used by the kernel debugger, overriding the default value (9600–19200 Kbps with a modem and 115200 Kbps with a null modem). Enabling this option under Template:Mono automatically enables kernel debugging with the Template:Mono switch.[10][11]
- Template:Mono Template:En dash Writes a log of the boot process to the file Template:Mono for diagnostic purposes.[10][11] It is set by default for certain Safe Mode options.
- Template:Mono Template:En dash Displays a custom Template:Resx 16-color bitmap instead of the default graphical boot screen on startup. This bitmap is named Template:Mono and is located in Template:Mono directory. This switch must be used in conjunction with the Template:Mono switch, otherwise the default boot screen would be shown immediately after the custom bitmap is displayed on startup.[11]
- Template:Mono Template:En dash Makes the system halt at a breakpoint within the hardware abstraction layer (HAL). Causes a stop error if a debugger is not used (or when the Template:Mono switch is absent).[11]
- Template:Mono Template:En dash Decreases the amount of memory that Windows can use (e.g. Template:Mono on a system using 512 MB of memory would take out 128 MB of memory from within Windows, making it only use 384 MB of memory).[10][11]
- Template:Mono Template:En dash Used when debugging through the IEEE 1394 port (using Template:Mono), to specify channels where the kernel debugger can communicate with.[10][11]
- Template:Mono Template:En dash Sets the HAL to use level-sensitive clocks settings rather than edge-triggered clock settings for hardware interrupts.[11]
- Template:Mono Template:En dash Passed when booting into the Recovery Console.[11]
- Template:Mono Template:En dash Loads the kernel debugger on startup, to be used when the system crashes.[11]
- Template:Mono Template:En dash Enables debugging at the kernel level.[10][11]
- Template:Mono Template:En dash Specifies a port used for kernel-mode debugging. Supports serial and (in Windows XP and Windows Server 2003 only) IEEE 1394 ports for use with debugging.[11][10]
- Template:Mono Template:En dash Disables Data Execution Prevention (DEP) support.[11]
- Template:Mono Template:En dash Disables serial and bus mouse detection in Template:Mono. Otherwise serial and bus mouse detections are performed if the Template:Mono switch is excluded. Set by default on Windows 2000 onwards.[10][11]
- Template:Mono Template:En dash Sets a different HAL to use.[11][10]
- Template:Mono Template:En dash Makes the HAL set hardware interrupts to only the highest numbered processor on multiprocessor systems.[11]
- Template:Mono Template:En dash Sets a different kernel image to use.[11][10]
- Template:Mono Template:En dash Sets the maximum amount of memory that Windows can use (e.g. Template:Mono makes Windows use 64 MB of memory even if the computer has 512 MB or more memory). Template:Mono does not account for memory leaks; Template:Mono is recommended for those use cases instead.[10]
- Template:Mono Template:En dash Option used for Windows PE. Changes the <syntaxhighlight lang="text" class="" style="" inline="1">HKLM\SYSTEM</syntaxhighlight> key in the Windows Registry to be non-persistent so that any changes made to the key are not saved when the system shuts down.[11]
- Template:Mono Template:En dash Disables debugging at the kernel level.[10]
- Template:Mono} Template:En dash Sets Data Execution Prevention (DEP) settings, applies to both 32-bit and 64-bit CPUs with the NX bit.[11]
- Template:Mono Template:En dash Enables DEP for core system images and those specified in the DEP configuration dialog.
- Template:Mono Template:En dash Enables DEP for all images except those specified in the DEP configuration dialog.
- Template:Mono Template:En dash Enables DEP on all images.
- Template:Mono Template:En dash Disables DEP.
- Template:Mono Template:En dash Disables the graphical boot screen on startup, only displaying device driver names as they are loaded, similar to Template:Mono. It can be used in conjunction with Template:Mono to diagnose device driver failures on startup.[10][11] It is set by default for certain Safe Mode options.
- Template:Mono Template:En dash Disables Physical Address Extension support.[11]
- Template:Mono Template:En dash Disables serial mouse detection in Template:Mono. Otherwise serial mouse detections are performed if the Template:Mono switch is excluded. Replaced with Template:Mono on Windows 2000 onwards.[11]
- Template:Mono Template:En dash Specifies the number of processors used in a multiprocessor system (e.g. Template:Mono on a four-way system causes Windows to use only two processors instead of all four). Can be used to troubleshoot performance issues and defective CPUs.[11][10]
- Template:Mono Template:En dash Makes Windows use only one processor in a multiprocessor system, similar to that of Template:Mono.[11]
- Template:Mono Template:En dash Enables Physical Address Extension support.[10]
- Template:Mono Template:En dash Locks IRQ settings used by PCI devices to the ones set by the computer's BIOS.[10]
- Template:Mono Template:En dash Specifies a path to the System Disk Image (SDI) file.[11]
- Template:Mono Template:En dash Enables Emergency Management Services (EMS). Only available in Windows XP onwards.[10][11]
- Template:Mono Template:En dash Sets Safe Mode settings.[11][10]
- Safe Mode (Template:Mono) Template:En dash Starts Windows using a minimal set of device drivers and services.[15]
- Safe Mode with Networking (Template:Mono) Template:En dash Starts Windows using a minimal set of device drivers and services, along with the necessary drivers to load networking.[15]
- Safe Mode with Command Prompt (Template:Mono) Template:En dash Starts Windows using a minimal set of device drivers and services, but uses the Command Prompt as its user interface instead of Windows Explorer.[15]
- Windows in Directory Services Restore Mode (Template:Mono) Template:En dash Performs a directory service repair. (This mode is valid only for Windows-based domain controllers.)[15]
- Template:Mono Template:En dash Option used for Windows XP Embedded. Allows booting a RAM image from a System Disk Image (SDI) file.[10][11]
- Template:Mono Template:En dash Displays device driver names on startup.[10][11] Can be used in conjunction with the Template:Mono switch to help diagnose display driver failures on startup (this is the case for Windows NT 4.0 for the "VGA mode" option in the boot menu, which has both Template:Mono and Template:Mono switches enabled). It is set by default for certain Safe Mode options. From Windows 2000 onwards, it also changes the graphical boot screen to the one seen when Template:Mono is run on startup (Template:Mono), showing operating system information in a similar manner to Windows NT 4.0.
- Template:Mono Template:En dash Sets the system timer resolution for the HAL.[11]
- Template:Mono Template:En dash Specifies that Windows uses the Power Management Timer (PM_TIMER) timer settings instead of the Time Stamp Counter (TSC) timer settings if the processor supports the PM_TIMER settings.[10] By default, Windows Server 2003 Service Pack 2 (SP2) uses the PM timer for all multiprocessor APIC or ACPI HALs. Template:Mono must be enabled for Windows Server 2003 Service Pack 1 (SP1) and below.[16]
- Template:Mono Template:En dash Option used only on 32-bit x86-based systems that allows applications to be given a larger address space specified by the user, similar to the Template:Mono switch. The aforementioned switch is mandatory when using the Template:Mono switch.[11][15]
- Template:Mono Template:En dash Allows booting of non-NT versions of Windows (e.g. Windows 9x) using Template:Mono.[11]
- Template:Mono Template:En dash Allows booting of DOS or non-NT versions of Windows (e.g. Windows 9x) using Template:Mono, similar to the Template:Mono switch.[11]
- Template:Mono Template:En dash Overrides the year set by the computer's clock settings (e.g. Template:Mono sets the year to 2000 within Windows, even if the year is set to 1999 within the computer's clock settings). Was used for testing Y2K compliance.[11]
See also
- Booting process of Windows
- ntoskrnl.exe
- ntdetect.com
- Emergency Management Services
- Comparison of boot loaders
- Windows Boot Manager
References
External links
- Template:Web archive
- Template:Web archive
- MS Knowledge Base help on "NTLDR Is Missing" error message in Windows 2000 and Windows XP (also [1] Template:Webarchive, [2] Template:Webarchive, [3] Template:Webarchive, [4] Template:Webarchive)
- Template:Web archive
- Explanation of BOOT.INI by Daniel B. Sedory
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ 2.0 2.1 {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ Template:Cite book
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ Template:Cite book
- ↑ 10.00 10.01 10.02 10.03 10.04 10.05 10.06 10.07 10.08 10.09 10.10 10.11 10.12 10.13 10.14 10.15 10.16 10.17 10.18 10.19 10.20 10.21 {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ 11.00 11.01 11.02 11.03 11.04 11.05 11.06 11.07 11.08 11.09 11.10 11.11 11.12 11.13 11.14 11.15 11.16 11.17 11.18 11.19 11.20 11.21 11.22 11.23 11.24 11.25 11.26 11.27 11.28 11.29 11.30 11.31 11.32 11.33 11.34 {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ 15.0 15.1 15.2 15.3 15.4 {{#invoke:citation/CS1|citation |CitationClass=web }}
- ↑ {{#invoke:citation/CS1|citation |CitationClass=web }}