Friday, June 13, 2008

BOOT.INI is gone in Vista

The reason why I needed to modify boot.ini-normally a few-minute operation that became a multi-hour process, although it'll take you much less time after reading this-is that when I'm running test machines that are not connected to the Internet, either virtual or real, I'm often using slower machines, and in an effort to reduce my waiting time when playing with Vista, I like to turn off Data Execution Prevention (DEP). I do not recommend doing this on a production machine or, for that matter, any system into which you will type any data that you wouldn't want the world to know. But for test systems that you won't be sharing your vital data with, it's a great idea. With XP and 2003 systems, I could always shut off DEP by editing the boot.ini and adding the /NoExecute=AlwaysOff option to any boot.ini entry. But how to do that (and other things) to BCD? Well, to learn that, we've got to learn BCD-ese. Here's the boot.ini on my XP workstation:

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP x64 " /fastdetect /
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP x64 w/debug" /fastdetect /
NoExecute=OptOut /DEBUG
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"

This particular boot.ini offers three different operating system options when booting this computer; those three options are in the section named [operating systems]. The three lines following it (each is long and broken on the page, but there would indeed be just three lines if we were viewing this on a wide computer screen) is called a "boot.ini entry." For example, consider this one:

multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP x64 " /fastdetect /

The multi(0)disk(0)partition(2)\WINDOWS is just an arcane way of saying "the actual operating system is on the second partition of the first hard disk, and in the Windows directory on that partition." That's followed by two "switches," /fastdetect (which tells Windows not to bother looking around for devices attached to parallel and serial devices, which hasn't been generally necessary since 2000 came out), and /NoExecute=OptOut, which is the normal setting for DEP. Because there are three operating system entries, I see a boot.ini menu offering those three every time I boot my workstation. Other useful switches are /maxmem, which tell your copy of Windows to not use your system's RAM above some level, or /debug, which enables system debugging, or /numprocs, which tells your system to ignore some number of processors.

Above the [operating systems] section, there is a [boot loader] section. It specifies two things: how long to leave the menu on the screen, and which option to make default if the boot.ini options time out.

Now, if you're scratching your head saying, "I never see anything like that boot.ini file, or a boot-time menu at all in either XP or in Vista," that means that you've got only one operating system entry. In that case, you don't get the menu on either XP or Vista. If you do have a Vista BCD with more than one entry, then you see a different boot menu from the one that you would have in the pre-Vista days, assuming that you had a multi-entry boot.ini. The Vista boot menu is text, but it's a bit snazzier than boot.ini.

*.* Source of Information : Administering Windows Vista Security: The Big Surprises

No comments: