Note: This howto is largely based upon an earlier howto by J. David Bryan; I have added information on Linux and changed the organization somewhat, but have left his text more or less intact wherever it still applies. Also, thanks to Arthur D. Jerijian (jerijian@seas.ucla.edu) for additional information about the Unix dd command. See the References section for pointers to these sources and applicable Microsoft Knowledge Base articles, as well as a reference for doing all this with FreeBSD.
It is possible to boot directly into each of these operating systems using the Windows NT 3.51 boot loader (note that this procedure will not work with NT versions prior to 3.51, and I have not tested it with version 4 yet). Specifically, one can boot directly into DOS, without going through Win95, from the NT multiboot menu. In fact, I have no doubt that OS/2 and other operating systems can be added to this procedure given an understanding of the way the particular boot sequence works for the operating system. The two required conditions for bootup are:
The information contained herein is derived in part from the Microsoft 95WRK.HLP file supplied on the Win95 final beta CD, modified for post-installation operation (the relevant page is titled, "Installing Windows 95 for Dual Booting with Windows NT").
I have Windows NT 3.51 Workstation, Windows 95, DOS 6.22 (with WFW 3.11, though this does not matter), and Slackware Linux 1.2.13. I installed DOS first, then Windows 95, then NT, and then Linux, though I'll attempt to explain how to "insert" another operating system so that you can do this in an arbitrary order. What is central here is the NT boot loader: This won't work without Windows NT 3.51 and its boot loader.
My primary (bootable) partition is the first partition of the first hard drive (this is drive C:) which is FAT. I have each system on a separate partition, though this is not necessary -- it is just easier for me to remember what's what and easier to backup and restore files in emergencies.
Drive C: therefore contains all of the startup files for all operating systems. A listing of all files (including hidden files) should contain at least the following NT system startup files:
If you have Windows 95 installed, then you should also have the following files if DOS was booted more recently than Win95:
or the following files if Win95 was booted more recently than DOS:
If you have not installed Windows 95 yet, then you should just have the following DOS files:
Finally, I have a Linux bootsector file that points to the volume on which I have installed Linux (with LILO):
When you are done, and you reboot, you will get the NT boot loader menu (that starts out at the top of the screen with "OS Loader V3.51") with (at least) these choices:
and when you select a choice, you will then see one of the following messages on the screen (depending on which system you select):
The steps needed to implement directly booting to an arbirary OS are:
What NT's boot loader uses to load any given operating system is a tiny bootstrap file that points it at the rest of the operating system's boot code. These files are pretty easy to create and maintain, given the right tools (and a fair amount of patience). For creating boot sector files, there are a couple of methods.
Now, in order to add DOS to the mix, you need a BOOTSECT.DOS that contains a DOS boot sector. The good news is that NT will make one for you. The bad news is that you have to go a fair way through the setup program for it to generate the BOOTSECT.DOS (which takes about 1 second). To do this, use your NT installation and setup disks/CD-ROM to Repair your NT boot files.
This file, BOOTSECT.DOS, is your DOS boot sector file. SAVE THIS FILE! You will want to copy the actual DOS BOOTSECT.DOS file because Windows NT will OVERWRITE the boot sector file if you reinstall it, because BOOTSECT.DOS is the default filename. So you can just copy this file to BOOTSECT.622 or some other name that you'll remember as being the actual DOS bootsector file.
SAVE THIS FILE! You will want to copy the actual DOS BOOTSECT.DOS file to a new file with a different name because Windows NT will OVERWRITE this boot sector file if you install or reinstall it, as BOOTSECT.DOS is the default filename. So you can just copy this file to BOOTSECT.622 or some other name that you'll remember as being the DOS bootsector file.
If you already have Windows 95 and Windows NT installed and you want to make a bootsector file specifically for Windows 95, then you can use Windows 95 sys.com to rewrite Windows 95's system files onto the Master Boot Record. Then you will need to install or reinstall Windows NT, and once it finishes installing, the resulting BOOTSECT.DOS file will be the Windows 95 bootsector file. Save it to BOOTSECT.W40 or BOOTSECT.W95 or some other filename that you will remember as being the Windows 95 boot sector.
So far so good? If you've installed DOS, Windows 95, and Windows NT, then right about now your machine should load DOS (directly if you've installed the DOS bootsector file into your BOOT.INI file, or indirectly through Windows 95 otherwise), Windows 95, and Windows NT. (And, if somehow all of this didn't kill off LILO, then it will probably run LILO, and then run the NT loader. This is okay, too, for now.)
If all of this has totally wiped LILO from the picture at bootup, don't panic. Just boot Linux from your boot/root floppies with the boot option mount root=/dev/hd? (where /dev/hd? is the volume of your Linux installation--that is, the first partition of the first IDE volume would be /dev/hda1, or the third partition of the second SCSI volume would be /dev/sdb2, etc.). This should get you back into Linux with minimal hassle (all of Linux should still be there--it's just that LILO temporarily isn't around to boot it up!).
Once DOS, Win95, and NT boot okay, it's time to add Linux to the NT boot loader and to remove LILO from the Master Boot Record. The major trick here is to install Linux's boot information onto the superblock of the volume on which Linux resides (usually LILO wants to write its information to the master boot record, and this won't work for our purposes).
Now, assuming that your LILO installation currently expects to be in the master boot record, this needs to be changed. The pertinent LILO information is in the lilo.conf file (again, usually in the /etc directory). So with your favorite editor, edit your lilo.conf file as follows: Replace the boot=/dev/hd? line that is currently there (probably boot=/dev/hda) with a line referring to the superblock of the Linux volume (again, this would be /dev/hdb1 for the first partition of the second IDE volume, or /dev/sdb2 for the second partition of the second SCSI volume, etc.). At this point, since we're expecting LILO just to have to boot Linux, you might also want to comment out whatever menu options are for booting DOS (unless you work for the Department of Redundancy Department and want to have multiple ways to boot DOS and yet another choice at bootup!) Once you have made the appropriate changes, save the file and rerun lilo to update the boot information. Then remove LILO from the MBR This should fix LILO to behave properly when next we launch it.
Once Linux is correctly installed (but not, at this point, bootable anymore), it's time to create the file that NT's boot loader will use to start up LILO. For this purpose, I recommend the shareware utility BOOTPART, which is designed exactly for this purpose. Running BOOTPART with no parameters should display all partitions on the machine and what file system they are formatted with. Then running BOOTPART with a partition number and a boot sector filename should create a new boot sector file (and possibly add it to your BOOT.INI file, but that's jumping ahead a bit). For this process, follow the instructions for BOOTPART, as the exact incantation may change somewhat from time to time and version to version. And when you do create the file, I personally recommend the filename BOOTSECT.LNX, but again, use whatever filename you will remember as being the boot sector for Linux.
For more information on BOOTPART, take a look at the
web site:
http://ourworld.compuserve.com/homepages/gvollant/bootpart.htm
Alternately, if you want to make the BOOTSECT.LNX file from
within Linux, you can do it with the dd command:
dd if=/dev/hda? of=/mnt/c-drive/bootsect.lnx bs=512 count=1
where hda? is your boot partition in Linux and
/mnt/c-drive is where your C:\ drive is mounted. Then, you
can arrange LILO to write the bootsector to this file by setting the
boot= parameter in /etc/lilo.conf:
boot = /mnt/c-drive/bootsect.lnx
The only complication to all of this is removing LILO from the
Master Boot Record (MBR). To do this, you have to rewrite the MBR
with the command:
fdisk /mbr
from Windows 95 or DOS. THIS WILL WIPE OUT THE MASTER BOOT
RECORD, so you will have to use your NT installation disks/CD
to repair NT's master boot record files!
Once you have all these boot sector files floating around, it's time to plug them into the NT loader. (Note: The following procedure can be used from any of the available systems; I used DOS. Be aware, though, that until NT is set up, there is no BOOT.INI file, so you need to have set up Windows NT by this point.) Also, the addition of items to the BOOT.INI file can be done in whatever order you want, but of course if a menu selection refers to a not-yet-created or invalid boot sector file, then your results will be less than favorable (probably a nasty message--I've never really had the urge to try this....)
To get the correct system files (with the correct names), edit the BOOT.INI file (hidden and read-only) present in the bootup directory (probably the root of C:). You should have lines something like the following:
[boot loader] timeout=10 default=multi(0)disk(0)rdisk(1)partition(1)\WINNT [operating systems] multi(0)disk(0)rdisk(1)partition(1)\WINNT="Windows NT Version 3.51" c:\bootsect.dos="Windows 95"
Edit the "c:\bootsect.dos" line and add a new line following it, as follows:
BEFORE EDITING AFTER EDITING ---------------------------- -------------------------------------- c:\bootsect.dos="Windows 95" c:\bootsect.w40="Windows 95" /WIN95 (new line) c:\bootsect.622="MS-DOS 6.22" /WIN95DOS
The /WIN95 and /WIN95DOS switches cause NTLDR to rename the DOS and Win95 system files back and forth so that the correct names are used with the operating system selected. (If you have not noticed before, look at the hidden files in the root of C: when running DOS and Win95. Under Win95, the DOS files are renamed IO.DOS and MSDOS.DOS; under DOS, the Win95 files are renamed WINBOOT.SYS and MSDOS.W40; IO.SYS and MSDOS.SYS belong to the "current" operating system).
Note that the /WIN95 and /WIN95DOS switches are only recognized by NTLDR version 3.51. The NTLDR from versions 3.5 and earlier won't recognize these switches, so the renaming won't take place.
You have also requested that Windows 95 be booted using the boot sector in the file BOOTSECT.W40, while DOS is booted using BOOTSECT.DOS, which is what all of this furious creation of boot sectors was about.
Again, be aware that there is no BOOT.INI file until after you install NT, so make sure that NT is running before you attempt this section.
Adding the Linux boot sector file (BOOTSECT.LNX or whatever name you created it with using BOOTPART) should be trivial. In fact, BOOTPART has an option that will add the Linux option to your BOOT.INI file for you. Voila! Done! Or, if you want to edit the exact message (such as "Slackware Linux", etc.) you can just add the line
c:\bootsect.lnx="Slackware Linux"Either way, this should bring Linux into the picture. Then, when you select your new Linux option, it should fire up LILO with the LILO options you set up previously.
As I said at the top of this explanation, I fully expect that this procedure should work for OS/2 or FreeBSD or whatever other operating system you want to insert, given that it can be made to boot the given operating system without trashing the master boot record. BOOTPART is ideal for this; in fact, I believe it even comments on the steps necessary to add OS/2 Boot Manager partitions. Still, because I don't personally own any Big Blue operating system, I have to say experiment at your own risk. If you have sections to add to this HOWTO, please mail them to me and I will include them.
Here's how to repair your NT bootup files (from Microsoft KnowledgeBase articles Q102793 and Q104429):
NOTE: BE SURE YOU HAVE A BOOTABLE "NT SETUP DISK 1" BEFORE STARTING! AFTER EXECUTING "SYS" AND BEFORE BOOTING SETUP, NT CANNOT BE BOOTED!
When you start the system, the first sector of the active disk partition is loaded into memory and executed. This sector is called the "boot sector" and is physically located "outside" of the FAT file system on drive C: (for a more comprehensive discussion, see the Microsoft KnowledgeBase article Q101787, "General Information on Starting Multiple Operating Systems"). If you can boot NT, then the boot sector is the "NT boot sector", which loads and runs the program NTLDR, which presents the multiboot menu.
When DOS was installed, it put its own boot sector in that loads IO.SYS.
When NT was installed, it overwrote DOS's boot sector with its own (the NT boot sector) after copying the DOS boot sector to a file called BOOTSECT.DOS in the root of C:. When you selected "MS-DOS" from the NT boot menu, NTLDR would run BOOTSECT.DOS, which would load IO.SYS, and DOS would boot.
When Win95 was installed, it left the NT boot sector in place, but overwrote BOOTSECT.DOS with its own boot sector (the "Win95 boot sector") which also loads IO.SYS. Win95 also wants to install its own IO.SYS and MSDOS.SYS, which conflicts with the DOS versions. So it renames DOS's IO.SYS and MSDOS.SYS to IO.DOS and MSDOS.DOS.
Since DOS and Win95 each expect their system files to be *.SYS, their respective IO.SYS and MSDOS.SYS files must be renamed back and forth as the two systems are booted. Therefore:
(Why Win95 renames its IO.SYS to WINBOOT.SYS instead of IO.W40, I do not know).
The Win95 IO.SYS will perform this renaming when you select "Previous version of MS-DOS", but apparently uses an internal loader to perform the equivalent of the DOS boot sector.
NTLDR will also perform the renaming (with the /WIN95 and /WIN95DOS switches) but still needs an external BOOTSECT file to boot DOS.
You can verify which boot sectors are in which file by examining the files with a hex dump program (or use the NT command "DEBUG"). Look at the first few bytes and also at the last few bytes for the following strings:
First bytes Last bytes Operating System -------------------- -------------------- ---------------- MSDOS5.0 IO SYSMSDOS SYS DOS MSDOS5.0 NTLDR NT MSWIN4.0 WINBOOT SYS Win95
I think that operating systems are starting to become as hot a topic of contention as politics and religion, but they don't have to be. I personally believe that there is still no single "perfect operating system." But there is no reason you can't use the right OS for the right job. So it makes sense to have as many operating systems as it takes for you to be able to do what you want to do. I hope that this reference will let you do that.
Note: If you use Norton Speedisk, then add IO.SYS and MSDOS.SYS to the unmovable file list, or else you will no longer be able to boot DOS. Basically, DOS 6.x and before expect IO.SYS and MSDOS.SYS to be the first entries in the file list on the boot partition, but since DOS 7 doesn't care, Norton Speedisk doesn't care either. IT WILL MOVE THEM! And if this happens, DOS will panic! So make these files unmovable or you'll be sorry....
The answer to that question is that I have not tried it yet (I'm waiting on my copy of NT 4 to be shipped to me), but I see no reason why it wouldn't. As soon as I have a chance to try it for myself, I'll post my results.
I have run through all of this on my system, and it works. However, I have not tested it on any other configuration. Also, I may not have thought of every contingency. That is why you made backup files! In general most everything that this procedure alters can be fixed (at least back to its original state) by backing up files and having original installs and emergency repair disks at the ready.
Still, if something does not work right, and the solution is not obvious, restore your backup files and e-mail me a description of the problem. I will try to get back to you as soon as possible.
Also please note that I have not performed an exhaustive examination of the operation of the NT or Win95 boot process, so there may be factual errors in my explanations. I have investigated just enough to get the process to work for me, and I try to investigate scenarios that people bring to me: Corrections are welcomed.
Good luck!
Sean Edmison <sedmison@rice.edu>
Last updated: 3 November 1996