VIRTUTECH CONFIDENTIAL    Previous - Up - Next

6   Installing an OS on Simics

6.1   Installing Solaris on Simics

Solaris can be installed directly on the simulated machine in Simics. Solaris can be obtained from Sun's web-site at http://www.sun.com/software/solaris/binaries/get.html in the form of ISO images.

To simplify the installation process, some scripts are supplied with the Simics distribution for the peanut machine: peanut-sol<version>-cd-install1.simics, peanut-sol<version>-cd-install2.simics and peanut-sol<version>-cd-install3.simics, where <version> is 8, 9 or 10. The scripts will answer all questions automatically to create a standard workstation install.

It is also possible to install Solaris 2.6 and Solaris 7 on Simics, but for that, no automatic scripts are supplied.

6.1.1   Installation, step by step

This section describes how to install Solaris using the command-line version Simics.

  1. Select the install script to use, depeding on Solaris version to install, either peanut-sol10-cd-install1.simics for Solaris 10, peanut-sol9-cd-install1.simics for Solaris 9, or peanut-sol8-cd-install1.simics for Solaris 8.
  2. Set the path to the CD image in the simics script. The line
        $cdrom_path = "sol-10-u2-ga-sparc-v1.iso"
    
    should be changed to reflect the location and name of the CD image for stage one of the installlation. It can either be an ISO image file, or a CD-ROM device file (Linux and Solaris host only).
  3. Start the first installation script, for example:
      $ ./simics targets/sunfire/peanut-sol10-cd-install1.simics
      
    and wait for it to complete. This may take several hours, depending on the performance of the host machine.
  4. When the script stops, installation from the first CD is finished, and Solaris has tried to reboot the system. Since Simics does not support system reboot for this architecture, exit Simics at this point.

    If the installation is performed from a real CD, it is now time to change disc in the drive. Also make sure that the path to the CD is correct in the second install script.

  5. Now run the second script in the same way as the first, this script may also take a few hours to complete.
  6. When the second script has stopped, run the third and last one. This script only takes a few minutes to finish.
  7. When the third script has stopped the installation is ready. The newly created disk image has the following file name: peanut-sol<version>-install.disk. There are also a number of persistent state files.
  8. To boot a machine with the newly installed Solaris OS, run the peanut-common.simics and make sure that the variable $os is set to "solaris10", "solaris9" or "solaris8" depending on the operating system version installed). Add a line like the following first in that simics script:
      $os = "solaris10"
    
  9. An optional last step is to compress the disk image with the craff utility to save some disk space.

6.2   Installing Linux or another OS on Simics

The files walnut-cd-install1.simics and walnut-cd-install2.simics, that are supplied with the walnut simulated machine provide a way to install an operating system on Simics from a bootable CD-ROM. Before starting, please read the instructions in walnut-cd-install1.simics.


Note: If you plan to mount your finished disk using loopback, you should make sure that each simulated file system is small enough to fit uncompressed on your local machine.


Note: The instructions given here for installing from CD-ROM also apply to installing from DVD. The ISO format is the same for data CD-ROMs and DVDs and you can install from an ISO image of any size using the new-file-cdrom command described below.

  1. Create an ISO image file of the bootable CD-ROM you want to install from. Linux example:

    $ dd if=/dev/cdrom of=myos.iso
    

    On Windows, a third-party tool is necessary to create the ISO image. For more information on how to deal with CD-ROMs and other disk images, see the chapter titled Managing Disks, Floppies, and CD-ROMs in the Simics User Guide. On Linux and Solaris hosts it is not necessary to create the ISO file, Simics can also access the actual CD directly by specifying the device file.

  2. Run Simics with the first script:

    $ ./simics targets/sunfire/walnut-cd-install1.simics
    
  3. Insert the ISO image with the OS into the simulated CD-ROM drive with the following two commands, and then start the simulation.

    simics> new-file-cdrom myos.iso
    cdrom 'myos' created
    simics> cd0.insert myos
    simics> c
    

    To install from a CD that is inserted in the host CD-ROM unit instead of from an ISO file, replace the first line in the example above with the following example line. The argument /dev/cdrom is the path to the device and may be different depending on your host system. Note that this is not the path to the files on the CD, such as /mnt/cdrom. Accessing a CD on the host is not supported on Windows hosts.

    simics> new-file-cdrom "/dev/cdrom" myos
    
  4. When the installation is finished, shutdown the simulated machine (a lot of OSes do this automatically when the install is complete). The way to shutdown the machine differs between operating systems, but there is usually some help available on the screen.
  5. You may get a error message from Simics saying that reboot/suspend/shutdown is an experimental feature, but that can be ignored. At this point save the persistent state of the machine:
    simics> save-persistent-state install-phase1.state
    
    The persistent state contains all information on the disk, as well as the contents of NVRAMs and other devices that survive reboot. Finally exit Simics.
  6. Start Simics using the second script, which will boot from the installation disk and not from the CD-ROM. If the CD-ROM is needed, it has to be inserted into the machine in the same way as in the first phase of the installation.

    If the installer program in the simulated machine asks for the path to the CD-ROM, give the path in the simulated machine. Since there is only one CD-ROM in the default machine setup, this should be quite easy to identify.

    $ ./simics targets/sunfire/walnut-cd-install2.simics
    

    Then, before starting the simulation, load the persistent state that was saved at the end of the first phase.

    simics> load-persistent-state install-phase1.state
    
  7. Since there are probably changes done to the disk in the second phase as well, reboot the simulated machine, and when it has completed the shut down, save the persistent state to a new file.
  8. If there are several reboots during the installation process, save a new state file each time. Only the most recent one has to be loaded when Simics is restarted, but all state files must be kept since they depend on each other.
  9. When the install is complete, you will have one or more persistent state files. To create a single one, use the checkpoint-merge utility to join them. After verifying that the combined persistent state works, the previous ones can be removed.
  10. To run the machine with the newly installed operating system, start the walnut-common.simics and load the most recent persistent state file, or the combined state file that was created using the checkpoint-merge utility.
  11. If you want to change the number of processors in the machine or some other machine parameters, you can do so now (provided that you have installed support for multiple processors or other hardware during your install). See chapter 3.6.

VIRTUTECH CONFIDENTIAL    Previous - Up - Next