Get More from the Windows Boot Menu

Windows XP and its predecessors have long offered a text-mode menu for selecting which operating system to boot. The available operating systems are learnt from entries in the BOOT.INI file. Each entry provides a title, a path and options. The menu ordinarily shows only the titles. Provision exists, however, to reveal extra detail in the boot menu and even to edit the selected operating system’s options before proceeding with the boot. As so often, Microsoft seems to have left this potentially useful facility undocumented.

Background

When booting a machine on which a Windows NT version is installed (prior to Windows Vista), the NT bootstrap loader (NTLDR) may offer a text-mode menu of installed operating systems and of configurations in which to start them. The possibilities are learnt from entries in the [operating systems] section of a BOOT.INI file. Each entry takes one line of the file and can provide a title, a path and options.

The menu lists the operating systems by their titles, one per line. One title is displayed in reverse video as a highlight to denote that it is the current selection. The user changes the current selection by pressing the Up, Down, Home and End keys, and accepts the current selection by pressing Enter (or by letting a configurable timeout expire).

The menu ordinarily shows nothing of the path or options for any operating system, except that some few options of special significance to the loader are indicated indirectly by appending to the title a qualifying description (such as “debugger enabled”) in square brackets.

Enhancements

NTLDR has two undocumented enhancements of the boot menu. One is an action to take at boot time to reveal the path and options. The other, which (unfortunately) requires advance preparation, is to allow editing of the options before proceeding with the boot.

Show Path and Options

To be shown the path and options for the installed operating systems, type unsupporteddebug while the menu is displayed. Your typing will be blind: there is no feedback on the display until you have pressed all the necessary keys. The result is a new display area beneath the list of available operating systems. The title, path and options for the current selection are shown there, and are updated whenever the current selection changes.

Warning

Once you put the boot menu into this unsupported debug mode, be careful about pressing F5 or F8. These keys take you to the Windows Advanced Options Menu, as usual, but if you cancel this menu, thinking to return to the boot menu, you will trigger a coding error. The consequences vary with the NTLDR version, depending on the precise arrangement of local variables on the stack. When the boot menu is redrawn, the text at the top may be corrupt or the NTLDR may crash.

Edit Options

As well as letting you see the title, path and options for each of the installed operating systems, your blind typing of unsupporteddebug may allow you to edit the options for whatever operating system you eventually choose to start. If BOOT.INI has been prepared in advance so that at least one entry in the [operating systems] section satisfies at least one of four properties (listed below, under the heading Restriction), then when you accept the current selection from the menu, the loader will clear the display, show the title, path and options for the selected system, and prompt you to “Enter new load options”.

Editing is basic, as if in overwrite mode with no facility to toggle to an insert mode. A cursor is simulated by showing one character in reverse video. The Left, Right, Home and End keys move the cursor. Keys that correspond to an ASCII character between space and the lower-case z cause that character to overwrite whatever character was already at the cursor. The Insert key inserts one space at the cursor, so that each character at and to the right of the cursor moves one column further right. The Delete key deletes the character at the cursor, so that each character to the right of the cursor moves one column left. The Backspace key deletes the character to the left of the cursor, so that each character at and to the right of the cursor moves one column left.

Restriction

This facility has somewhat limited value in practice because it must be prepared in advance. It is activated only if at least one of the installed operating systems has at least one of the following properties (in which the path and options are case-insensitive):

  1. The options include /redirect and the title is longer than 57 characters. The title will be truncated to 57 characters, with “ [EMS enabled]” appended.
  2. The options include a forward slash, after which there is no nodebug or crashdebug, but there is either debug or baudrate, and the path does not begin with “C:\” (not counting the quotes). The loader will have appended “ [debugger enabled]” to a possibly truncated title.
  3. The options include /win95dos or /win95.
  4. The path is exactly “C:\” (not counting the quotes).

What might have been a valuable use for this facility is missed because of these constraints. Imagine that kernel-mode debugging is wanted for finding why some computer will not start, but the computer is the possession of an ordinary user and its BOOT.INI file on the local hard disk has no entry that would enable debugging. Among the available strategies is to boot an operating system from another device, as with MS-DOS from a floppy disk or the Windows Recovery Console from a CD, then edit the BOOT.INI on the hard disk before rebooting from the hard disk. Another is to boot from the hard disk as normal but press F5 or F8 for the Windows Advanced Options Menu: the effect of the Debugging Mode option in this menu is essentially to add a /debug option, so that Windows will then start with default connection parameters for kernel-mode debugging. Plainly better would be to boot from the hard disk but have some way to specify your ideal connection parameters. You would get exactly this from the unsupporteddebug facility, but only if the problem machine is already prepared.

Applicability

This note is based on inspection of the NTLDR from Windows XP Service Pack 1a. However, perusal of earlier Windows versions for a revision of this article in 2007 has shown that the features described above date from at least the original Windows 2000 and continue at least until Windows Server 2003 Service Pack 1 (as does, incidentally, the coding error).

Windows Vista

The boot sequence has been reworked for Windows Vista and the particulars given above are inapplicable. However, the intention to these enhancements is accommodated by the new coding, and is even improved. At the Windows Boot Manager menu, while the current selection corresponds to an installation of Windows Vista or later, press F10 to be taken to the Edit Boot Options menu.