Preparing Simple cdrom.image Files

The first step in creating your CD-ROM is to generate a simple, nonoptimized cdrom.image file. You create the CD-ROM image file using the laytool program. This program uses a cdrom.tcl script file to create the image file. This section describes:

All files and folders needed to create the image file are in the /cdrommaster folder named after the current version of the operating system.

To step through this section, you should have already set up your files, as explained in Preparing Your Title's Files for the Layout Process.

About the cdrom.tcl File

The cdrom.tcl script file contains variables that affect the final form of the CD-ROM image file. Variables are defined with set commands in the script. If a command is preceded by an initial hash sign (#), it is considered a comment and won't execute.

Editing the cdrom.tcl File for the Simple Image

To edit the cdrom.tcl file for first-time layout, follow these steps:

  1. Launch MPW.

  2. From the Directory menu, choose Set Directory and select the folder inside the cdrommaster folder that is named like the most recent operating system.

  3. From the File menu, choose Open and select the cdrom.tcl file.

    Note: The cdrom.tcl file is commented extensively; if you pay attention to the comments, you should find editing the file quite easy.

  4. Edit the file so the variables have the values shown in the table below:
    Table 1:  Variable settings for simple image creation.
    --------------------------------------------------------
    Variable      |Setting                                  
    --------------------------------------------------------
    imagefile     |Pathname of a cdrom.image file to be     
                  |created on a hard disk that has at least 
                  |640 MB space.                            
    --------------------------------------------------------
    label         |Set to "cd-rom" during initial testing of
                  |the CD-ROM image.                        
    --------------------------------------------------------
    takedirectory |Pathname of the /takeme folder that      
                  |contains the title.                      
    --------------------------------------------------------
    megabytes     |Rule of Thumb: Use 110% of the size of   
                  |the /takeme folder (with your executable 
                  |and data files), and use that number as  
                  |the number of megabytes. If you allocate 
                  |too little, the layout process           
                  |terminates. If you allocate too much, the
                  |process takes longer but there won't be  
                  |other problems. The number of blocks must
                  |be a multiple of 16.The number of        
                  |kilobytes must be a multiple of 32.      
    --------------------------------------------------------
    directoryavata|The number of directory avatars defaults 
    rs            |to 3 and may be safely reduced to 2.     
    --------------------------------------------------------
    rootavatars   |The number of root avatars defaults to 7 
                  |and may be safely reduced to 2.          
    --------------------------------------------------------
    labelavatars  |The number of label avatars defaults to  
                  |2, and must not be changed.              
    --------------------------------------------------------
    
The different avatars are discussed in some detail in the cdrom.tcl file itself.

Creating the Simple Image

To create a CD-ROM image using the layout tool, follow these steps:

  1. In the MPW Worksheet window, make sure /cdrommaster/_version_ is the working directory.

    The /cdrommaster/_version_ folder contains the /takeme folder with your executables and data.

  2. Type laytool < cdrom.tcl and press the Enter key (not the Return key).

    After you've started the image creation process, the layout tool does the following:

    At the end of the process, the MPW shell should display the line "layout successful."

    If you don't see the line "layout successful," or if something else goes wrong:

Testing the Simple Image

To test the CD-ROM image file, follow these steps:

  1. Rename any additional copies of your title's executable and data folders you have on your Macintosh so they aren't accessed instead of the files in the CD-ROM image you want to test.

  2. Make sure there are no other cdrom.image files anywhere on your Macintosh.

  3. Make sure your environment is set up for debugging.

  4. Open the Debugger and select Cancel when prompted for a script to execute.

  5. From the Edit menu, choose Preferences and make sure the CD Emulation checkbox is checked.

  6. From the File menu, choose Directories, and then choose Setup. In the dialog that appears, click Data, then find the cdrom.image file you just created and click Select Current Directory.

  7. From the Target menu, select Launch.

  8. When prompted, select the boot script and click Execute.

  9. Press Command-G to start the operating system (if you didn't uncheck Set Initial Breakpoints).

  10. When you see a Mac-> prompt in the Debugger Terminal window, type the following:

    alias boot /cd-rom

    This sets the alias boot to /cd-rom. In turn, any pathname in the application that contains $boot will properly reference the files on the CD-ROM.

  11. Execute the program contained in the image file by typing the following command into the Terminal window:

    $boot/launchme

    The Debugger runs your title from the image file and you can perform the first round of testing.