Site hosted by Angelfire.com: Build your free website today!

Multibooting OS's with NTDLR

Much appreciation to the following references:

Because without them, I would not have understood how to boot the following OS's on my machine:

MS DOS 5.0
MS DOS 6.22 (w/Win 3.11)
MS Windows 95
MS Windows 98
MS Windows NT 4.0 Server
RedHat Linux 6.0

So why bother with so many OS's? Well, I figure it gives you the flexibility of doing certain tasks which maybe suited better in one OS over another. So without further ado, I'll explain a bit about how I got all this to work.

I'm sure there will be topics I fail to mention or merely gloss over (since they have been well documented in the references I stated above). So, if you need further explanation on something I did not seem to cover (such as file system compatibility and the actual boot process), I suggest you follow up on those references. With my document and their's, you should have a pretty good foundation to work with.

Mapping of First and Second hard drives:

My first and second hard drives reside on the Primary and Secondary Master connectors. No doubt your drives might lie on different connectors. And although my partition sizes are adequate for my needs, you may decided to allocate more or less space for your partitions.

Keep in mind, however, that valid FAT16 partitions can be no larger than 2GB. Also if you have a large hard drive, many of the OS's involved here can only boot from a partition within the first 7.875 GB (or 8064 MB) of the disk. (I personally didn't have to worry about this, but it may be different with you.)

WD ATA Caviar 2.5GB HDD (Primary Master)
*C: [600MB]
  [FAT16]
MSDOS6.22
Win98/Win3.11
E: [600MB]
  [FAT16]
WinNT4.0
F: [1050MB]
  [FAT16]
(For various apps)
G: [180MB]
  [FAT16]
(For NT install)
 
WD ATA Caviar 2.0GB HDD (Secondary Master)
*D: [300MB]
  [FAT16]
MSDOS5.0
Win95
H: [800MB]
  [EXT2]
Linux Native
I: [800MB]
  [FAT16]
(Future FreeBSD partition)
J: [100MB]
  [Swap]
 
* = Partition set active using MSDOS FDISK.

At least 2 hard drives and a BIOS with boot sequence setup are somewhat of a requirement to boot all the OS's I listed. The 2 hard drives are needed since MSDOS 5.0 and MSDOS 6.22 cannot reside on the same disk. The same goes for Win95 and Win98. The BIOS with boot sequence setup is needed in order to specify the option of booting from another disk. Otherwise, you'll have to remove the outer case from your computer and do a bit of cable swapping to boot the second disk. If you have to do that, it's really not worth the effort to mark the second disk with an active partition and boot older versions of Windows and MSDOS, especially since Win98 and MSDOS 6.22 are capable of doing whatever Win95 and MSDOS 5.0 can do respectively. (I guess the reason why I even bothered with Win95 and MSDOS 5.0 is for nostalgic reasons. Pretty sad, huh?)

Before Starting:

I'll assume you have setup floppies for MSDOS and CD-ROM's for Win95, Win98, NT, and Linux. If not, then have the appropriate disks handy for install.

Also make sure you have boot floppies for MSDOS 5.0 and 6.22, containing not only the necessary system files but also:

ATTRIB.EXE
EDIT.COM
FDISK.EXE
FORMAT.COM
MORE.COM
MSCDEX.EXE
QBASIC.EXE
SYS.COM
<your CD-ROM driver file>

Here are sample CONFIG.SYS and AUTOEXEC.BAT files for the boot floppies in order to use your CD-ROM.

-- begin -- [CONFIG.SYS]

DEVICE=A:\<your CD-ROM driver file> /D:<your driver signature>

-- end -- [CONFIG.SYS]

-- begin --[AUTOEXEC.BAT]

A:\MSCDEX.EXE /D:<your driver signature>

-- end -- [AUTOEXEC.BAT]

Setting up the First hard drive:

Much of how to install MSDOS 6.22, Win98, NT on the first disk can be found in the documents I referred to in the beginning. So I won't go into detail about setting up the first disk. Most of what I have to say is about setting up the second disk (since I seem to be the only person who is interested in booting old versions of MSDOS and Windows).

Anyway, start off by booting the 6.22 floppy and run FDISK to partition the disk. (You can also partition the second disk, or wait until you actually get to set up the second disk, if you fancy.) Also make sure you set the first partition active. Once done partitioning, you will be prompted to reboot the system. Leave the boot floppy in the drive and then proceed to format the partitions. If you have the actual setup disks for 6.22, don't use the /S flag when using the FORMAT command. The MSDOS setup program will see the system files and will not install over an existing OS. If you don't have the setup disks, you'll need to format the first partition using the /S flag. You can then copy your 6.22 executables to the drive (if you happen to have them). You may also want to install the DOS drivers for your CD-ROM before you decide to reboot in order to boot from the hard drive.

After installing MSDOS 6.22, you can either install Win98 or NT next. I don't think it really matters. I chose to install NT next, because I found it easier to retrieve the boot sector to MSDOS.

If you noticed on my partition map, I had set aside a small partition for the NT install. To be honest, you really don't need that particular partition and can simply allocate that space for some other partition. But because cluster sizes are small for small FAT partitions, I got better disk performance and was able to cut down my NT install time. But again, it may not be necessary to even have such a partition if you already have the performance and aren't dealing with old legacy hard drives.

After installing NT (and saving the MSDOS boot sector file), go ahead and install Win98, save its boot sector file, and then modify NT's BOOT.INI file by adding the appropriate boot sector filenames and options. (NOTE: Because Win98 was released later than NT 4.0, you'll need to rely on the boot options that are used for booting Win95 in order to boot Win98 from NT's boot loader. -- i.e. -- /WIN95 and /WIN95DOS)

That's it. Everything should boot. (Of course, easier said than done. Also if you have it, you can then install Win3.11 from MSDOS.)

Setting up the Second hard drive:

Before installing OS's on the second drive, you will need to disable the first drive in BIOS. Why? FDISK is rather picky on what partition can be set active. Only the first partition on one drive can be set active. This means we need to make sure that the second is the only drive visible in order to make FDISK think there is no active partition. So enter BIOS, make the appropriate changes, and save. Then boot from the 5.0 floppy, and run FDISK to partition the drive if you haven't done so already. Make sure the first partition is active. Once that's taken care of, the system should prompt for a reboot. You can leave the boot disk in the floppy drive, since we're now ready to begin installing MSDOS 5.0 and Win95. (I suggest you install MSDOS 5.0 before installing Win95.)

Installing MSDOS 5.0:

Because I don't have the actual setup disks for this version of MSDOS, I merely formatted the first partition with the /S flag. Or if you happen to have the setup disks, it would be simpler to just run the setup program. (Just remember not to format the partition using the /S flag.) You may choose to format the rest of the partitions at this point. (But it may be a bit pointless, since you'll be converting them to different file systems anyway.) Install the DOS drivers for your CD-ROM. Then remove any floppies from your floppy drive and reboot your system in order to boot from the hard drive.

Installing Windows 95:

Installing Win95 from CD is pretty straighforward. Just run the setup program and follow the instructions. However, the thing I did before installing Win95 was a bit out of the ordinary, and it's not a necessary step to install Win95 (and still boot MSDOS 5.0), so I'll leave it up to you to determine if this step is worthwhile. Instead of immediately running Win95's setup program, I decided to install NT beforehand. (I'm sure you're wondering: What?! Whatever for? You already have NT on the first hard drive. Why a second install?)

Well, what I failed to mention was that my intention was to never fully install NT but to just install the boot loader. I'm sure there would have been a better way to install the boot loader by using NT boot or repair disks. But since I didn't make any of those disks (I guess I like to do things the hard way), I ran NT's setup program, and I let the install continue until I saw the percentage meter show up. At that point, I pressed the eject button on my CD-ROM, forcing the install to halt. I was then able to exit back to MSDOS. I guess pressing CTRL+ALT+ DEL would have been just as effective. If you decide to reboot, the NT loader would start. Just boot back into MSDOS, not the NT Installation. The boot sector for MSDOS would have been written to the file, BOOTSECT.DOS. **COPY THE FILE TO BOOTSECT.500** (or anything else meaningful so that you know it is the boot sector to MSDOS). Once done copying the file, you can run Win95's install program. Because Win95 will overwrite the BOOTSECT.DOS file, the NT boot option for MSDOS will actually refer to Win95. So just select that option whenever you need to reboot from Win95's install.

Now as I mentioned earlier, it's not necessary to use NT's boot loader to dualboot Win95 and MSDOS. As a matter of fact, Win95 is quite capable of booting into MSDOS **AND** w/o having to deal with BOOTSECT files. Unfortunately, you need to press a function key at a specific time during system bootup. When you boot Win95 and see the message:

Starting Windows 95...

Press F8. You'll then be able to bypass Win95's system files and enter what is called the troubleshooting menu. Choose the option to boot MSDOS. Doing so will also cause Win95's system files to be renamed, keeping them intact. Quite helpful when wanting to boot back to Win95.

However, the problem with booting MSDOS this way is trying to boot back to Win95. If MSDOS was the last OS to be booted, you will not be able to boot Win95, because Win95 is not smart enough to look for its own system files, and your system will hang on trying to use system files from MSDOS. At that point, you will need a boot disk in order to rename system files. Or, to avoid using the boot disk, you will need to rename system files before leaving MSDOS. Either way, Win95's system files need to be reset. It's not hard, but it is tedious because of the number of commands involved. (That is why I chose to install the NT boot loader, so that I don't have to deal with it.) But I did write a small batch file, RESETSYS.BAT, to take care of the problem.

You can freely view the source which is located below this paragraph. (Note: I originally wrote this for use on MSDOS 6.22. Also, I believe the MOVE command is not available in previous versions of MSDOS, so it might be best to use RENAME. The RENAME command should be integraded into the shell, so you shouldn't have to worry about system paths.)

-- begin -- [RESETSYS.BAT]

@echo off
:prompt
echo.
echo Only to be used under true legacy MS-DOS to reset Windows' system
echo files. If used inappropriately, overwritten files cannot be restored.
echo Once completed, you must either shutdown or reboot the system.
echo.
choice /c:yn Do you wish to continue...
if errorlevel 255 goto error
if errorlevel 2 goto stop
if errorlevel 1 goto start
if errorlevel 0 goto cancel
:error
goto prompt
:stop
goto end
:start
echo.
c:\msdos622\attrib -r -s -h c:\io.sys
c:\msdos622\attrib -r -s -h c:\msdos.sys
c:\msdos622\attrib -r -s -h c:\winboot.sys
c:\msdos622\attrib -r -s -h c:\msdos.w40
c:\msdos622\move c:\io.sys c:\io.dos
c:\msdos622\move c:\msdos.sys c:\msdos.dos
c:\msdos622\move c:\command.com c:\command.dos
c:\msdos622\move c:\config.sys c:\config.dos
c:\msdos622\move c:\autoexec.bat c:\autoexec.dos
c:\msdos622\move c:\winboot.sys c:\io.sys
c:\msdos622\move c:\msdos.w40 c:\msdos.sys
c:\msdos622\move c:\command.w40 c:\command.com
c:\msdos622\move c:\config.w40 c:\config.sys
c:\msdos622\move c:\autoexec.w40 c:\autoexec.bat
c:\msdos622\attrib +r +s +h c:\io.dos
c:\msdos622\attrib +r +s +h c:\msdos.dos
c:\msdos622\attrib +r +s +h c:\io.sys
c:\msdos622\attrib +r +s +h c:\msdos.sys
echo.
echo Shutdown/Reboot the system now.
goto end
:cancel
echo Batch terminated.
goto end
:end
echo.

-- end -- [RESETSYS.BAT]

After finishing up the install for Win95, if you opted not to install the NT boot loader, then you're pretty much done with the first partition of this hard drive. Otherwise, you'll need to **COPY BOOTSECT.DOS TO BOOTSECT.W95** (or anything else meaningful so that you know it is the boot sector to Win95). Then modify the BOOT.INI file by adding the appropriate BOOTSECT filenames and boot options.

Everything should boot now, and you can remove NT's temp directories, $WIN_NT$.~LS and $WIN_NT$.~BT, that were generated during install. You now can go into BIOS and enable the first hard drive again.

Everything else -- Installing Non-DOS OS's:

I'm sure you noticed on my partition map that I have allocated an unused partition for FreeBSD. Now during the time I have written this document, I have yet to acquire/install the OS. But I'm sure it'll be quite similar to installing Linux.

Installing Linux:

If you can boot the Linux installation CD, go ahead and do so. Otherwise, you'll have to install the OS using boot floppies. They shouldn't be hard to make. Just follow the directions from the Linux readme docs.

Installing Linux should be another straight-forward procedure. Simply give the appropriate input whenever prompted for it, though pay close attention to the following prompts:

Once done installing, boot your system with your Linux boot disk and login to Linux. If you were able to install LILO on your Linux root partition, then all you need to do is write the Linux boot sector to file on your "C" drive. (You may need to mount your "C" drive in order to write to it.) I simply used the command:

dd if=/dev/hdc5 of=/mnt/drive_c/bootsect.lnx bs=512 count=1

... where "/dev/hdc5" was the volume indicating my Linux root partition, "/mnt/drive_c" was the mount point for my "C" drive, and "bootsect.lnx" was the filename I had given for the boot sector. (No doubt your command options may differ.)

If LILO isn't on your root partition yet, you need to run "lilo" first before running the "dd" command. There are two ways of doing so:

After taking care of "lilo", copy the boot sector to file using the "dd" command as shown above. Then modify NT's BOOT.INI file to include the Linux boot sector file. Remove your Linux boot floppy from the drive, and reboot.

Final Words:

If everything can boot at this point, well then, I have to give you a well deserved congrats for all the time and energy you spent on a job that could've been easily solved with an installation of PowerQuest BootMagic or any other third-party boot manager. (Hey hey, don't get too mad at me. I did say I do things the hard way.) (^_^)