Building a DOS Boot CDROM

This page uses techniques and programs gathered from here and there on the Internet. The page consists of my notes on creating a bootable CDROM containing Partition Magic. The sample files have all the pieces except the actual Partition Magic programs. Those are still program products and it would be inappropriate for me to distribute them.

The techniques in this page use the "El Torito" method of building a boot CD. In a nutshell, you build a boot floppy and embed the floppy image in the CD. The mkisofs command, which creates the burnable image points to the floppy image.

The procedure for creating the boot CD rom was originally developed using both a Windows machine and a Linux machine. I have found and tested Windows versions of the Linux commands, so it could be done with just Windows. I have not seen how to build a boot floppy on Windows 2000 or XP, so a Windows 98 machine may come in handy. If Windows 98 is not available, there is an appropriate boot image file available in the bootcdrom.zip file.

End Result

The end result is a CDROM which will boot to DOS and run the program of your choice. In my case the choice was Partition Magic. The drive letter assignments in the generated system are as follows:

Other Options

As an aside, if you want to actually want to boot from CD to windows (GUI not just a command prompt), there is another option. I stumbled upon this solution by accident and it is a really slick setup. Bart PE - Bart's preinstalled windows environment Bart's PE (Preinstalled Environment) will take an XP system and create a boot CD that brings up windows. It is a good recovery option and easy to use. You can do a lot of tayloring of the environment. It deserves a look.

The Short Story

This section is for the person who does not care about how the boot cdrom is made. They just want to make a cdrom that can boot Partition Magic.

  1. Download and unzip the bootcdrom.zip file
     
  2. cd to bootcdrom\cdrom\PQMAGIC
     
  3. From your Paritition Magic diskettes that you can generate from the installed program, copy in the following files from the diskettes to the PQMAGIC directory.
     
  4. Open a command prompt window and cd to the bootcdrom\cdrom directory.
    Note that if you are on linux, slashes are forward slashes.
     
  5. On Windows run, mkiso.bat
    On Linux run, mkiso.sh
    Note that double clicking the .bat file from an explorer window on Windows did not work. The error went away too quick to read and the generated file was no good
     
  6. Go up one directory to the bootcdrom directory and find the generated ISO file.
     
  7. Burn this ISO to CD with the burner of your choice and you will have a bootable Partition Magic CD. Remember that this is burning a CD image and not just copying the image to a CD. If you look at the CD under windows, you should see several files, not just the .ISO file.
     

Now back to the detailed description

Parts List

The bootcdrom.zip file contains all the files listed here. It also contains my original notes in the README.TXT file.

Required Files:

Procedure

  1. To make your own boot floppy suitable for dd into a boot.img file, use a Windows 98 machine to do a
    format a: /s
    which installs the system. Then copy the files from the boot directory in the bootcdrom.zip file to the floppy. On Linux, the following commands will do this:
    mkdir /tmp/floppy
    mount /dev/fd0 /tmp/floppy
    cp (list of files from boot dir) /tmp/floppy
     
    On Windows you can just copy the files to the A: drive.
    Also note that if you do not have a Windows 98 machine available, you can use the rawrite2.exe program from the newboot directory in the zip file to create a bootable floppy from the boot.img file in the cdrom directory.
     
  2. You can edit CONFIG.SYS and AUTOEXEC.BAT to change the menu selections. The rest of the files you will want to leave alone. Note that you need the CR-LF format of line end in the files on the floppy. If you are using Linux, you can use the unix2dos command to insure that the line endings are correct.
    unix2dos -n CONFIG.SYS CONFIG.SYS2
     
  3. You can boot from the floppy to make sure you have the syntax right. You won't actually have the X: drive available unless you make a CD and put it in the CDROM drive. After you get the floppy to boot, put it in a linux floppy Drive and do:
    dd if=/dev/fd0 of=/tmp/boot.img
    You can also create the boot.img with the rawread program on Windows.
    rawread C:\temp\boot.img a:
    (A copy of the image file is in the cdrom directory of the zip file)
     
  4. Put the image file in the directory to become the CDROM root, for example, the cdrom directory from the zip file. Put any other files you need in the directory. This will end up being the X: drive. If you look at the AUTOEXEC.BAT file from the boot directory you will see that depending upon the boot config option, it will copy files from various directories on the CDROM (X:) to the R: drive which is the ram disk. It then executes the command from the RAM drive.
     
  5. In the cdrom directory of the zip file is a mkiso.sh file with the command to run mkiso and build the ISO image. This will build an image suitable for burning. The command, which expects to be run from the cdrom directory is:
    mkisofs -b boot.img -o ../pqmagic.iso .
    Under Windows you can run the program mkisofs.exe to acomplish the same thing. You will pick a name of your choosing in place of pqmagic.iso. It seems to take the same parms as the Linux mkisofs - At least the ones we are need. (I created an image using the command above from a DOS prompt.)
     
  6. You can the use the burning program of your choice to burn the ISO file to CDrom.
     

Other Dirs in bootcdrom.zip

The newboot directory has boot files in various stages of editing. It also has rawread.exe and rawrite2.exe and mkisofs.exe which allow you to get your cd ready. The boot directory also has the program to build the ram disk. I had to go here and there to collect these programs. Now they are in one place.

Sample Autoexec.bat and Config.sys files

######################################################################################
REM AUTOEXEC.BAT
REM @ECHO OFF
MSCDEX.EXE /D:CDDRIVER /L:X
XMSDSK.EXE 51200 R: /t /y
MOUSE.COM
PATH=A:\;R:\
GOTO %CONFIG%

REM :TESTDISK
REM COPY X:\TESTDISK\*.* R:
REM R:\TESTDISK.EXE
REM GOTO DOS

REM :GHOST
REM COPY X:\GHOST\GHOST.EXE R:
REM R:\GHOST.EXE
REM GOTO DOS

REM :NTFS
REM COPY X:\NTFS\*.* R:
REM R:\NTFS4DOS.EXE
REM GOTO DOS

:PM
COPY X:\PQMAGIC\*.* R:
R:\PQMAGIC.EXE
GOTO DOS

:DOS
ECHO  X: CD DRIVE
ECHO  R: RAM DRIVE
REM IF EXIST R:\PQMAGIC.EXE  R:\PQMAGIC.EXE


######################################################################################
REM CONFIG95.SYS
DEVICE=HIMEM.SYS
REM DEVICE=EMM386.EXE
DOS=HIGH,UMB
LASTDRIVE=Z


REM -------------------------------------------------------
REM -- Put code page variable (yyy) here.                --
REM -------------------------------------------------------

REM DEVICEHIGH=DISPLAY.SYS CON=(EGA,yyy,)


REM -------------------------------------------------------
REM -- Put network or CD-ROM drivers here.               --
REM -------------------------------------------------------

[MENU]
menuitem=PM, Partition Magic
menuitem=DOS, Dos

[PM]
include=DOS

[DOS]
DEVICE=OAKCDROM.SYS /D:CDDRIVER /L:X

[COMMON]
LASTDRIVE=Z
######################################################################################
######################################################################################

TWEEKING THE BOOT CD

Once a working procedure is in place, you might want to create variations on the working copy. The following steps were used to accomplish this. Note these steps were all done on Linux.

  1. Get a blank floppy.
     
  2. dd if=./cdrom/boot.img of=/dev/fd0
     
  3. mkdir /tmp/fd
     
  4. mount /dev/fd0 /tmp/fd
     
  5. cp /tmp/fd/config.sys /tmp/config.sys
     
  6. cp /tmp/fd/autoexec.bat /tmp/autoexec.bat
     
  7. Make the updates to the copies of config.sys and autoexec.bat and copy any needed drivers to the floppy.
     
  8. cp /tmp/autoexec.bat /tmp/fd/autoexec.bat
     
  9. cp /tmp/config.sys /tmp/fd/config.sys
     
  10. umount /tmp/fd
     
  11. Test the floppy
     
  12. mkdir tweeked_cdrom
     
  13. cp -r cdrom/* tweeked_cdrom
     
  14. dd if=/dev/fd0 of=./tweeked_cdrom/boot.img
     
  15. cd tweeked_cdrom
     
  16. vi mkiso.sh
     
  17. change the target file from ../pqmagic.iso to ../tweeked_pqmagic.iso or something similar
     
  18. ,/mkiso.sh
     
  19. Burn the image.
     

NOTE: The zip file has had the actual Partition Magic programs removed.


This page maintained by Bob Styma (Home Page)
Questions, comments, and corrections are welcome.
Last Maintained: Saturday, 31-Mar-2018 23:53:51 CDT