How To Create Bootable CDs

|

There are many applications for bootable CDs - the most common being when undertaking large roll-outs and when using test rigs,where it is often useful to combine operating systems with boot and diagnostic diskettes to automate the process of setting up machines.

If you need to repeatedly test from clean installations it can save lots of time if you image a disk drive and put the image, along with the imagingsoftware, on a bootable CD. It can also be a timesaver to have frequently-used boot and diagnostic diskettes on CD, and it’s an easy way to work with PCs that do not have a floppy disk drive.

To see if a PC supports booting from a CD, check your BIOS setup screens. SCSI drives have their own BIOS on the adapter; IDE drives use code in the system BIOS.Most modern SCSI adapters have a BIOS that allows it, and most motherboards of the last two years support booting from IDE CDdrives. If you are able to change the
boot options, and it lists “CD-ROM”, your system supports booting from a CD. If you have a 1995 or 1996motherboard or SCSI cardthat doesnot support it, it’s probably worth contacting the manufacturer - many have BIOS upgrades available.

Technical Details
When a bootable CD is created, a “boot record” is put at the very beginning of the CD, just as it is with a bootable floppy or hard disk. This record specifies whether the CD is to emulate a floppy or hard disk drive, and contains a pointer to the location of the actual boot image file.

The El Torito specification, created by IBM and Phoenix Technologies,was designed to be completely compatiblewith the ISO 9660CDstandard.It adds to the ISO 9660 specification by requiring a boot record at sector 11 of the last session on the CD. The boot record contains an absolute sector number that points to the “boot catalog”.There’s no restriction on the location of the boot catalog.

The catalog contains a list of entries describing all the “boot images” present
on the CD. Again, there’s no restriction on where the boot images can be on theCD. There can be any number
of them, of three different types:

  • “Bootable emulation” causes the image to be mapped to drive A or C, as a conventional bootable storage device.
  • “Non-bootable emulation” maps the image as a conventional storage device, and allocates the last drive letter to it.
  • “No emulation” is a special mode which loads the image intomemory and executes it - extremely useful when developing copy protection or “smart” CDs designed for a variety of disparate systems. For example, the “no emulation” mode is used in the Windows NT operating system CDs.

BIOSes do not allow selection of the image and you will have to write a small amount of low-level system code to do it.
CDs can be set to boot as drive A or C. The fact that they are a late addition to the PC makes them subject to certain other restrictions. To boot as drive A, the boot image must be made in the same format as a 1.2MB, 1.4MB or 2.88 MB floppy disk. The first floppy disk drive, if present, will become the B drive. If the system has a second floppy disk drive, it will not be accessible.

If the CD is set to boot as the C drive, it replaces the normal hard disk drive C, and has no size limit other than that of the CD itself. However, the source drive image must have only one partition. This partition must be both the first entry in the partition table and a standard DOS partition.

Creating The Image
Most currentCDRpublishing packages are capable of reading a floppy disk and creating a boot image from it.With the appropriate menu choices made, they will utomatically “inject”it into the CDimage.With thismethod it is extremely easy tomake a bootable CD. Some of the more advanced packages like Nero can create a bootable CD from any disk image, and allow fine-tuning of parameters such as the emulation type and startup message.
The basic process for making a bootable CD from a floppy disk is as follows:

1 Create a bootable floppy disk that has all required driver and startup software on it. You will need a CD driver in order to use the CD in conventional manner once the system has finished booting. It is wise to use a generic CD driver if you plan on using it in a few different systems.

2 Make sure that any path names in the config.sys andautoexec.bat files do not specify drive letters. 3 Make sure your boot process does
not attempt to write to the disk. Set the read-only flag on all files and write-protect the disk if possible. If your system tries towrite to the CD on boot-up, it will crash.

4 Test this disk thoroughly in whatever PC environments you wish to use it.

5 Once you are happy with the bootable disk, create the CD with your CDR publishing package. Selecting the “bootable” option will usually
prompt for the floppy disk. Put any other data onto the CD in the same session.

Larger Images

If you wish to create a larger, harddisk type image, there are a few more things to do. You will need to choose and size your source image hard disk carefully. A program such as Power-Quest’s Partition Magic is very handy for tasks like this.

Create and test your image in the same manner as the floppy image procedure detailed above. When you are happywith it, use a program likeNorton’s DiskEdit or PowerQuest’s Drive-Image to read the drive and create an image of it in a single file.At this point, if your CDR publishing software supports disk file images, you can simply select the appropriate file and it will automatically create the correct boot records.

If your software does not support hard disk images, it is still possible to create them if you are willing to delve into image files and boot records with a hex editor. This is not as difficult as it sounds, and Phoenix Technologies have an excellent guide on how to do it on theirWeb site at www.ptltd.com.

It should be noted, however, that in most cases the floppy disk image method is sufficient because drivers can be loaded that allowthe rest of the CD to be mounted in the DOS session.

Tips

  • A rewriteable CDR drive is an extremely useful tool when experimenting with bootable CDs. Although your test CDRW may be unusable in some standard CD drives, it can be used on themastering systemif the CDRWdrive is set as the primary CD, and this is enough for general test purposes. If you are planning on making a variety of bootable CDs, or just experimenting,CDRW has the obvious advantage of media cost. If you
    don’t have a CDRW, any failed experiments can be used as multi-session backups.
  • When making hard disk image CDs, an old hard disk drive around 650MB in sizemakes a useful addition to your mastering system. As hard disk images have certain partitioning requirements, detailed above, it’s much easier to have a whole disk to use for your layout if you are doing this type of work.
  • UnderWindows NT, you will need to have administrative rights if you are creating hard disk images (this requires access to all disk sectors).
  • It is possible that you will encounter older CDs that start to boot, fail immediately and hang your system. This is because there was no
    initial standard for the first few sectors of CDs and, although unlikely, somemay contain a correct “validation entry” without any of the other required boot files.

CDR Software
Until fairly recently, bootable CDs had to be made manually with a combination of low-level tools. Utility programs such as BOOTISO and DISKIMG were used to read bootable disks and write images to disk files. These disk images were then hex edited and manually added to the CD layout.
It has now become much easier, with many current CDR writer software packages able to make bootable CDs from a floppy disk image, a hard disk or an image file.Notable software packages are Easy CD Creator, Win-OnCD, CDRWIN, HyCD and Nero.
The latter is an extremely powerful tool that offers complete control of the CD writing process, and can create bootable CDs for many platforms. It can also create “oversized” CDswhich can be used to gain a small amount of copy protection.

Many of these programs can be evaluated before purchase, and this is advisable due to the wide variation in CDR drivers and hardware.