Recipe 6.4. Create a Multiboot Menu


Problem

You want to create a multiboot menu that will allow you choose from several different customized versions of Windows for example, one without a boot screen, one that will automatically create a log about the boot process, and so on.

Solution

Using a graphical user interface

The boot.ini file, a plain text file found in your root C:\ folder, determines how XP starts up and controls a variety of startup options, including whether to use the XP splash screen when XP starts, whether to create a log file about the boot process, and so on.

You might not be able to see boot.ini, because it's a system file, and if you can see it, you might not be able to edit it, because it's a read-only file. To make it visible, launch Windows Explorer, and choose View Tools Folder Options View and select the radio button "Show Hidden Files and Folders." To make it a file you can edit, right-click on it in Windows Explorer, choose Properties, uncheck the Read-Only box, and click on OK.

If you have only one operating system on your PC (XP), boot.ini will look something like this:

[boot loader] timeout=30 default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition"  /fastdetect

In this instance, your PC will boot straight into XP; no menu will be displayed to give you any other startup choices.

If you have more than one operating system on your PC, in the following instance XP Home Edition and Windows 2000 Professional, Windows boot.ini would look like this:

[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 Home Edition"  /fastdetect multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows 2000 Professional" /fastdetect

In this instance, when you boot your PC, a menu would be displayed, allowing you to choose between booting into XP Home Edition or Windows 2000 Professional.

Even if you have only one version of XP installed, though, you can create a multiboot menu that will let you choose to load XP with different parameters by editing the boot.ini file. For example, for menu choices, you might have your normal operating system; the operating system loading in a mode that lets you trace any startup problems; and the operating system loading in safe mode. To do it, create separate entries for each new operating system choice. For example, for the version of the operating system that traces potential startup problems, you could create this entry:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Trace Problems XP Home Edition"  /fastdetect /bootlog /sos

This entry creates a startup log and displays information about the drivers and other operating system information as it loads.

For the version of the operating system that loads in Safe Mode but that still allows networking, you could create this entry:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Safe Start XP Home Edition"  /fastdetect /safeboot:network

So the boot.ini file would look like this, assuming that you want the menu to display for 30 seconds, and you want normal XP startup to be the default:

[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 Home Edition"  /fastdetect multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Trace Problems XP Home Edition"  /fastdetect /bootlog /sos multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Safe Start XP Home Edition"  /fastdetect /safeboot:network

To edit the file, open it with a text editor such as Notepad. Following is a typical boot.ini file for a PC that has two operating systems installed on it Windows XP Home Edition and Windows Me:

[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 Home Edition"  /fastdetect multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows 2000 Professional" /fastdetect

As you can see, there are two sections in the file: [boot loader] and [operating systems]. To customize your menu and startup options, edit the entries in each section. Before editing boot.ini, make a copy of it and save it under a different name (such as boot.ini.old), so that you can revert to it if you cause problems when you edit the file.

Following are details about how to edit the entries in each section:


[boot loader]

This section controls how the boot process works; it specifies the default operating system, and how long a user has to make a selection from a boot menu if a boot menu has been enabled. The timeout value specifies, in seconds, how long to display the menu and wait for a selection before loading the default operating system; if you want a delay of 15 seconds, for example, enter 15 for the value. Use a value of 0 if you want the default operating system to immediately boot. If you want the menu to be displayed indefinitely and stay onscreen until a selection is made, use a value of -1. The default value specifies which entry in the [operating system] section is the default operating system. (It is used even if there is only one operating system in the [operating system] section.) To change the default operating system, edit the setting, in our example, to default=multi(0)disk(0)rdisk(0)partition(2)\WINNT.

So in our example, if you were going to change the menu settings so that the screen appeared for 10 seconds before loading the default operating system, and the default operating system is Windows 2000 Professional, the section would read:

[boot loader] timeout=10 default=multi(0)disk(0)rdisk(0)partition(2)\WINNT


[operating system]

This section specifies which operating systems are present on the computer, and detailed options for each one. XP uses the Advanced RISC Computing (ARC) path to specify the location of the boot partition. In our example, the ARC path is:

multi(0)disk(0)rdisk(0)partition(2)\WINDOWS

The first parameter, which identifies the disk controller, should be 0. The second parameter, the disk parameter, should also be 0. The rdisk parameter specifies the disk number on the controller that has the boot partition. The numbers start at 0. So if you have three hard disks installed, and the second hard disk has the boot partition, the setting would be rdisk(1). The partition parameter identifies the partition number of the boot partition. Partitions start with the number 1. The final section, which in our example is \WINDOWS, specifies the path to the folder where the operating system is installed.

To the right of the ARC path, in the example, is ="Microsoft Windows XP Home Edition" /fastdetect. The words within quotes are what will appear on the boot menu next to the entry. You can change this to whatever you wish to customize the text on the menu; if you'd like, you can call it "My Favorite Operating System" or anything else you want. The /fastdetect switch disables the detection of serial and parallel devices, and so allows for faster booting. (The detection of these devices isn't normally required in XP, because the functions are performed by Plug and Play drivers, and so as a general rule, it's a good idea to use the /fastdetect switch. The /fastdetect switch is only one of many that can be used in the boot.ini file to customize how the operating system loads. Table 6-1 lists others you can use as well.

Table 6-1. Switches for boot.ini

Switch

What it does

/BASEVIDEO

Starts XP using the standard VGA driver. It's of most use if you can't boot normally because of a video driver problem.

/BOOTLOG

Logs information about the boot process to the file ntbtlogl.txt in the C:\Windows folder.

/CRASHDEBUG

Loads the debugger at boot, but the debugger remains inactive unless a crash occurs.

/DEBUG

Loads the debugger at boot and runs it.

/FASTDETECT

Disables the detection of serial and parallel devices.

MAXMEM:n

Specifies the maximum amount of RAM that XP can use.

/NOGUIBOOT

Does not allow the XP splash screen to load during boot.

/NODEBUG

Stops the debugger from loading.

/SAFEBOOT:switch

Forces XP to boot into the safe mode specified by the switch parameter, which can be minimal, network, or minimal(alternate shell). In minimal safe mode, only the minimum set of drivers are loaded necessary to start XP. In network-safe mode, the minimum set of drivers plus networking drivers are loaded. In minimal(alternate shell) the minimum set of drivers are loaded and XP boots into the command prompt.

/SOS

Displays the name of each driver as it loads and gives descriptions of what is occurring during the boot process. It also offers other information, including the XP build number, the service pack number, the number of processors on the system, and the amount of installed memory.


When you've finished editing the boot.ini file, save it. The next time you start your computer, its settings will go into effect.

So, in our example, if we wanted the menu to appear for 45 seconds, the default operating system to be Windows 2000, and the XP splash screen to be turned off when we choose to load XP, the boot.ini file would look like this:

[boot loader] timeout=45 default=multi(0)disk(0)rdisk(0)partition(2)\WINNT [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition"  /fastdetect /noguiboot multi(0)disk(0)rdisk(0)partition(2)\WINNT="Windows 2000 Professional"  /fastdetect

Discussion

If you've installed another operating system in addition to XP on your system, your PC automatically starts up with a multiboot menu, which allows you to choose which operating system you want to run. The menu stays live for 30 seconds, and a screen countdown tells you how long you have to make a choice from the menu. After the 30 seconds elapse, it boots into your default operating system, which is generally the last operating system that you installed. To change that menu and your startup options, edit boot.ini.

See Also

Advanced Startup Manager will let you create different profiles for starting XP. It's shareware; the registration fee is $19.95. Download it from http://www.rayslab.com/startup_manager/startup_manager.html. Also see MS KB 314081, "The purpose of the Boot.ini file in Windows XP."



Windows XP Cookbook
Windows XP Cookbook (Cookbooks)
ISBN: 0596007256
EAN: 2147483647
Year: 2006
Pages: 408

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net