big_gie said:
What do you mean "boot loader"?
Do you mean the "w2ksect.bin" (2k)?
KHAuYeung's N-in-1 CD creation extracts:
----------------------------------------
And if so, you mean that I'll have to have 2 i386 directory, one with all the files, and the other with the files too but with a winnt.sif file?
If this is it, I'm afraid it wont fit on a cd...
The basic purpose of CDIMAGE is simply to help generating an ISO CD-image for the contents which are previously put under a folder of a hard-drive or a CD-drive. There are options which can control various CD's properties like volume label, time stamp, long filename, boot sector file and more. All these sounds like the other CD Burning software can do it: CDRWIN, ECDC, Nero. But what makes the N-in-1 possible? It is the
-o option, "optimize storage by encoding duplicate files only once".
Optimization Magics
Starting from that moment, I understand the magic: It was not the Compression made the Windows 2000 3in1 CD, but the "optimization" process. It is true that when we extract the contents of the 3 Windows 2000 CD's onto the hard-drive, each of them will occupy about 500 MB adding up a total of around 1.5 GB of hard-drive space. However, when we run the CDIMAGE with the -o option to encode an ISO CD-image, it finds DRIVERS.CAB (a 50 MB file) exists in the i386 folder of all 3 individual versions (Professional, Server and Advanced Server) and these 3 files are duplicate files, so it store the 3 DRIVERS.CAB's only once in the final encoding CD-image and updating the file allocation table of the CD so that the 3 DRIVER.CAB's distributed in 3 individual directories will point to the same physical address on the CD. Now we save 100 MB of space by doing optimization on duplicate files of DRIVERS.CAB only, we should not be surprised that we can get 1.5 GB being squeezed into less than 650 MB after the whole optimization process is finished on the other duplicate files.
Obviously, the optimization magic of CDIMAGE is particularly useful in making something like Windows 2000 3in1 and Windows XP 6in1 where more than 95% of the contents in different OS's are of duplicate files. Beyonds the N-in-1, the -o option is also a good tool to bind more different applications, or different versions of application from the same software vendor onto a single CD. Example 1: Symantec System Works 2002 contains a basic version of Winfax Pro, but a Deluxe version of Winfax Pro and Talkwork Pro are also available and will be more powerful, they can be re-packed to one CD with CDIMAGE -o option without taking much of additional space. Example 2: The Adobe Acrobat 5.0 does accompany with different Adobe's applications on the Adobe Utimate Collection CD, we can use -o option to optimize the CD once again so that more space can now be spared for more Goodies. With your imagination, you can think about more situation where optimization magic can be applied.
Cooking Time
Let us start our cooking (in several stages), targeting on a "Multi-Bootable Corporate Windows XP Professional/Home Edition 2in1 CD"!
The following materials are needed in our warm-up stage: DevilsOwn (XP-Professional with Corporate Files), BOOT.BIN (WXP/W2K Boot-Sector), CDIMAGE.EXE, 2.5 GB of Hard-drive space. If you have my 6in1 CD, it is a good source of materials except the CDIMAGE.EXE. Please note that the DevilsOwn is contained in my 6in1 CD under \WXPVOL_EN. The warm-up stage aims to learn using CDIMAGE to encode an ISO CD-image of a bootable DevilsOwn (Volume License Version of XP Professional) CD.
1. Extract or copy all files from your source of DevilsOwn to a directory (sourceroot) of the HD (e.g. E:\CORP2IN1_EN)
2. Copy the popular WXP/W2K Boot-Sector file BOOT.BIN to the sourceroot. (BOOT.BIN can be found at \ of the 6in1)
3. In a minute, we shall be using CDIMAGE.EXE (Version 2.39, 72,464 Bytes) which has been put in a path available to be run in DOS Window. Let us learn its Usage and Options: (To make it simple, I only have listed Options of GROUP1 here which are used more frequently, you can view the full content of CDIMAGE.TXT at
http://members.rogers.com/khayftp1/cdimage.txt)
Usage:
CDIMAGE [options] sourceroot targetfile
Available Options:
GROUP1:
-l volume label, no spaces (e.g. -lMYLABEL)
-t time stamp for all files and directories, no spaces, any delimiter (e.g. -t12/31/91,15:01:00)
-b "El Torito" boot sector file, no spaces (e.g. -c:\location\cdboot.bin)
-h include hidden files and directories
-n allow long filenames (longer than DOS 8.3 names)
-m ignore maximum image size of 681,984,000 bytes
-o optimize storage by encoding duplicate files only once
4. In DOS Window, Enter the following command:
cdimage -lCORP2IN1_EN -t08/23/2001,12:00:00 -bE:\CORP2IN1_EN\BOOT.BIN -h -n -m E:\CORP2IN1_EN E:\CORP2IN1.ISO
In about 3 minutes, CDIMAGE will generate a CORP2IN1.ISO in the root directory of the E: drive. If you use something like DAEMON Tools (recommended), winimage or isobuster to check the generated CORP2IN1.ISO, you will find the following properties which were set by the options: Volume Label is CORP2IN1_EN (-lCORP2IN1_EN); Time Stamp is 02/23/2001 at 12:00:00 GMT time (-t08/23/2001,12:00:00); the CD is bootable because a boot-image was specified (-bE:\CORP2IN1_EN\BOOT.BIN); Options -h -n -m were selected as STANDARD. CDIMAGE looked at the sourceroot E:\CORP2IN1_EN and generate the target ISO as E:\CORP2IN1.ISO. Please note that when CDIMAGE is in the ENCODING process, it expects the target drive (where the targetfile is generated) has at least the same size of free-space as the size of contents under the sourceroot.
Where are we?
Getting lost? Let us take some more time to digest what we have cooked so far. (I mean to take a quick look-back.)
In order to make a "Corporate Professional & Home Edition 2in1":
1. We put DevilsOwn as our first OS under the SourceRoot Directory of our hard-drive (under E:\CORP2IN1_EN). Appeared under E:\CORP2IN1_EN now are folders i386, DOCS, SUPPORT, VALUEADD ... and files ... all from the DevilsOwn.
2. We put Home Edition as our second OS under a directory WXHVOL_EN which is one level down from our SourceRoot (under E:\CORP2IN1_EN\WXHVOL_EN). Appeared under E:\CORP2IN1_EN\WXHVOL_EN now are folders i386, DOCS ... and files ... all from Home Edition.
3. But the Home Edition is from an Untouched Version. In order to turn it to a Corporated Home Edition, we have to replace in the i386 folder (E:\CORP2IN1_EN\WXHVOL_EN\i386) with 8 Corporate Files. Where can we find the 8 files? The i386 folder of DevilsOwn (E:\CORP2IN1_EN\i386) contains them all. We therefore can simply copy them from E:\CORP2IN1_EN\i386 to E:\CORP2IN1_EN\WXHVOL_EN\i386.
4. Now that we have both the Corporated Professional & Home Edition being put under the SourceRoot. We add 2 more files to the SourceRoot: BOOT.BIN which is a Boot-Image file; WIN511C from the Home Edition. (We need to have WIN51, WIN51IP and WIN51IC located in the root directory of our 2in1 CD to make multi-boot possible)
5. After we have finished preparation on our SourceRoot Directory E:\CORP2IN1_EN, we use the CDIMAGE with -o option to generate an ISO CD-Image of the 2in1 CD: cdimage -lCORP2IN1_EN -t08/23/2001,12:00:00 -bE:\CORP2IN1_EN\BOOT.BIN -h -n -m -o E:\CORP2IN1_EN E:\CORP2IN1.ISO. -l option for Volume Label; -t option for Time Stamp; -b option for Boot Image; -h for hidden files; -n for long filename; -m to disable ISO Size-Limit; -o for optimize magics.
6. The generated CORP2IN1.ISO is a CD-Image contains the DevilsOwn (i386 folder located under \ of the CD) and the Home Edition (i386 folder under \WXHVOL_EN of the CD). The CD is bootable to DevilsOwn (it runs \i386\setupldr.bin during boot). If you insert the CD under Win32, it will autorun the setup.exe of the DevilsOwn (\setup.exe)
Traditional Boot Process of a WinXP-CD
We have just finished generating the CORP2IN1.ISO which will give you a Bootable 2in1 CD if you burn it. The only shortcomings are the missing 2in1 Multi-Boot Menu and Autorun Menu.
Before we build Multi-Boot Menu, let us learn the Traditional Single Boot Process of the current 2in1 CD in our hand. I hope I can explain this process in simple words and you should pay attention to those important files names and location I highlighted:
1. You boot your computer with the 2in1 CD, the BIOS search information on the CD which tells to run the
BOOT.BIN.
2. The BOOT.BIN is actually a Boot-Sector telling where to load and what to see. With a HexEditor like UltraEdit, you may see the following contents:
00000470h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 45 ; ..............
SE
00000480h: 54 55 50 4C 44 52 2E 42 49 4E 42 4F 4F 54 46 49 ;
TUPLDR.BINBOOTFI
00000490h: 58 2E 42 49 4E 49 33 38 36 00 00 00 00 00 00 00 ; X.BIN
I386.......
The BOOT.BIN said: "You go to the directory I386 where you can find
SETUPLDR.BIN and
BOOTFIX.BIN plus some other important files."
3. Now the computer goes to the
I386 (the i386 folder of our DevilsOwn), and starting to look into the contents of some important files which once again will tell where and what to to copy in the next setup step. You should pay full attention to the following 3 files which will be very important when we are going to build our Muti-Boot Menu:
SETUPREG.HIV, SETUPLDR.BIN, TXTSETUP.SIF.
4. The
SETUPREG.HIV in the I386 folder tells that the system to be setup is a full retail version of Windows XP Professional and from now on an ID-Card is given to your final product even though it is not finished yet.
5. The
SETUPLDR.BIN in the I386 folder tells how to load, and even more important, where to load the minimum set of drivers and required files in the next DOS Setup stage. If you ASCII-search in the setupldr.ldr for I386, you will find 4 ocurrances of "
I386".
i.e. the SETUPLDR.BIN said: "You go to the
I386 folder to load the minimum set of drivers and required files for DOS Setup Stage!"
6. Now the minimum set of files have been loaded. But before it jumps to the DOS Setup Stage, it will also look into the
TXTSETUP.SIF in the I386 folder for another piece of important information:
setupsourcepath. The setupsourcepath tells the location of the SetupSourceRoot containing the i386 folder which have all the SourceFiles to be copied. By performing a ASCII-search in the TXTSETUP.SIF, it is able to find
SetupSourcePath = "\".
i.e. TXTSETUP.SIF said: "Listen, in the next DOS Setup Stage, you should go to the i386 folder located under "
\" of the CD and copy all those files as the listed in my body for the subsequent Graphical Setup Stage."
The computer keep the words from TXTSETUP.SIF and then jump to the DOS Setup Stage, copying files as specified in TXTSETUP.SIF, followied by a Graphical Windows Setup Stage of the DevilsOwn Windows XP Professional.
After you feel comfortable to understand the boot process of the current Single-Bootable 2in1 CD, we shall start to cook a more complicated Muti-Bootable CD in our next step. By the mean time, try to get the following stuffs from the links provided and add them to your sourceroot (E:\CORP2IN1_EN):
Cooking the Multi-Bootable 2in1 CD
To make our 2in1 CD to be Multi-Bootable to setup any one of the 2 XP's (Professional & Home Editon), I use the "Diskemu - CD-Rom Disk Emulator" which was created by Bart Lagerweij (URL is at
http://www.nu2.nu/diskemu/).
loader.bin, disem1x.bin, diskemu.cmd you have downloaded act as our soul in the Multi-Boot Menu System. 4 Additional files and folders are needed to be added to our sourceroot:
WPROSECT.DAT (Boot-Sector for Professional),
WPRO (folder containing a minimum set of drivers and other required files for DOS Setup Stage of Professional);
WPERSECT.DAT (Boot-Sector for Home Edition),
WPER (folder containing a minimum set of drivers and other required files for DOS Setup Stage of Home Edition).
In the next encoding process with CDIMAGE, we shall specify our -b option (for Boot Image) as -bE:\loader.bin instead of the previous -bE:\BOOT.BIN. Now let me briefly address how these things perform the functions of our 2in1 Multi-Boot process:
1. You boot your computer with the 2in1 CD, the BIOS search information on the CD which tells to run the
loader.bin.
2. The loader.bin takes over the control and runs
diskem1x.bin. Instead of calling a single Boot-Sector in the traditional single boot process, diskem1.bin open the
diskemu.cmd and popup a Multi-Boot Menu asking for our Selection. Here is part of the content in the diskemu.cmd which I have custom made for our 2in1 CD:
:start
cls
print
print ------------------------------------------------------------------------------
print Bootable Corporated Windows XP Professional & Home Edition 2in1 CD
print ------------------------------------------------------------------------------
print F1=Help
print
print
print 1) Setup Windows XP Professioanl (DevilsOwn, VLK)
print 2) Setup Windows XP Home Edition (Corporated, VLK)
print
print
print d) Development->
print q) Quit to command prompt
print r) Reboot
print Esc) Boot first harddisk
print
print Hit the key of choice:
:mainkey
; timeout is 20 seconds, default key is escape
getkey 20 esc
onkey 1 goto wpro
onkey 2 goto wper
onkey d goto dev
onkey q quit
onkey r reboot
onkey f1 goto help
onkey esc boot 80
; When no key found...
goto mainkey
;
...
:
wpro
print Starting Windows XP Professional (DevilsOwn, Volume License Version) Setup
run
WPROSECT.DAT
getkey
goto start
;
:
wper
print Starting Windows XP Home Edition (Corporated, Volume License Version) Setup
run
WPERSECT.DAT
getkey
goto start
;
...
3. If you hit 1, the diskemu.cmd will open and load the Boot-Sector WPROSECT.DAT; Similarly, hitting 2 will lead to WPERSECT.DAT. WPROSECT.DAT and WPERSECT.DAT are almost identical to our previous BOOT.BIN except that they do not point to the "I386" folder. Instead they point to their own corresponding folder
WPRO or
WPER which contain the minimum set of drivers and files. Please note that folder names WPRO and WPER are made in 4 charcters long by purpose because we want "I386" in some binary files to be replaced easily with "WPRO" or "WPER".
4. Let us assume you hit 2 and continue our description. Since you hit 2, diskem1x.bin pass the result WPERSECT.DAT back to loader.bin resulting to get it being loaded and open. The WPERSECT.DAT is modified from BOOT.BIN in the way that the "I386" changed to "
WPER":
00000470h: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 45 ; ..............SE
00000480h: 54 55 50 4C 44 52 2E 42 49 4E 42 4F 4F 54 46 49 ; TUPLDR.BINBOOTFI
00000490h: 58 2E 42 49 4E 57 50 45 52 00 00 00 00 00 00 00 ; X.BIN
WPER.......
5. Now the computers goes to the
WPER directory, checking its SETUPREG.HIV (from Home Edition E:\WXHVOL_EN\I386\SETUPREG.HIV), SETUPLDR.BIN[ ("I386" are replaced with "
WPER" in all 4 ocurrances) & TXTSETUP.HIV (setupsourcepath="\" is replaced with setupsourcepath="\WXHVOL_EN\").
6. The 3 important files mentioned above under
WPER are correctly modified to generate the following expected results: the SETUPREG.HIV gives a "Professional" ID-Card (not Home Edition because it was replaced by the one from Corporate Files); the modified SETUPLDR.BIN tells to load the minimum set of files (for DOS Setup Stage) from
WPER instead of from I386; the modified TXTSETUP.SIF tells to copy files (for Graphical Setup Stage) from the i386 folder under "\WXHVOL_EN\" instead of under "\".
7. Please note that we
only modify the 3 files in in the WPER folder (or the WPRO folder in the Professional case), we do NOT or should NOT change anything in our I386 folder - our Source.
Once again, you may need some more time to digest stuffs in this part. I have addressed how we can boot into Setup of Home Edition, now you try to describe how you can boot into Setup for Professional. It should be less complicated than mine. We are one step to our practical work, I just wait until you fully understand all the behind theories. This time we discuss before we cook!
Just do it!
We have learnt the Multi-Bootable theories behind the N-in-1 CD, let us put it to work on our 2in1:
1. Copy the following stuffs which you have downloaded earlier to the sourceroot (E:\CORP2IN1_EN): loader.bin, diskem1x.bin, diskemu.cmd, deload.bin and the uncompressed WPRO folder.
2. Make a Professional Boot-Sector WPROSECT.DAT pointing to the WPRO folder: In sourceroot, copy boot.bin WPROSECT.DAT; Turn off the READ-ONLY Attribute; Edit WPROSECT.DAT (with UltraEdit or something alike), replace "I386" with "WPRO".
3. Edit (or check) the 3 files in the WPRO foler: The WPRO folder which you got from download has been edited correctly on SETUPREG.HIV (with full retail Professional ID), SETUPLDR.BIN (4 "I386" entries replaced with "WPRO")& TXTSETUP.SIF (setupsourcepath="\"). Double check on them.
4. Make a Home Edition Boot-Sector WPERSECT.DAT pointing to the WPER folder: In sourceroot, copy boot.bin WPERSECT.DAT; Turn off the READ-ONLY Attribute; Edit WPERSECT.DAT (with UltraEdit or something alike), replace "I386" with "
WPER".
5. In sourceroot, Creating the
WPER folder by copying the WPRO folder.
6. Copying the 3 files (setupreg.hiv, setupldr.bin, txtsetup.sif) from the i386 folder of Home Edition (E:\CORP2IN1_EN\WXHVOL_EN\i386) to the WPER folder (E:\CORP2IN1_EN\WPER). Overwriting those existings.
7. Turn off the READ-ONLY Attribute; Edit (or check) the 3 files in the WPER foler: SETUPREG.HIV (with full retail Professional ID),
SETUPLDR.BIN (4 "I386" entries replaced with "WPER")&
TXTSETUP.SIF (setupsourcepath="\WXHVOL_EN\"). Double check on them.
8. Now open the file diskemu.cmd with a text editor, try to understand its contents or change the wordings of the menu-section to whatever you like. Close it after it is done.
9. Delete the previous 2in1 ISO (E:\CORP2IN1.ISO) to free up hard-drive space.
10. In DOS Window, Enter the following command to create a Multi-Bootable 2in1 ISO with loader.bin as the Boot-Image:
cdimage -lCORP2IN1_EN -t08/23/2001,12:00:00 -bE:\CORP2IN1_EN\loader.bin -h -n -m -o E:\CORP2IN1_EN E:\CORP2IN1.ISO
11. In about 5 minutes, we can enjoy what we have just cooked: The generated CORP2IN1.ISO is a CD-Image contains the DevilsOwn (i386 folder located under \ of the CD) and the Home Edition (i386 folder under \WXHVOL_EN of the CD). The CD is multi-bootable to to a menu from which we can select to setup either DevilsOwn or Home Edition. If you insert the CD under Win32, it will auto-run the setup.exe of the DevilsOwn (\setup.exe)